DMOPC '18 Contest 2 P0 - Mimi and Video Games

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type

Mimi is playing her favourite video game, Enur Yrotcaf 4.

In this game, you own an N \times N field, and can water an i \times i square of plants at the cost of \alpha \times i EP (Enur Points).

Given that Mimi has R EP, what is the largest square of plants that she can water?


1 \leq N, \alpha, R \leq 1\,000\,000\,000

Input Specification

The only line of input will have 3 space-separated integers, N, \alpha and R.

Output Specification

The largest i less than or equal to N such that Mimi can water a field of size i \times i or 0 if she cannot water any field.

Sample Input 1

5 3 6

Sample Output 1


Sample Input 2

5 3 30

Sample Output 2



  • 1
    Charles232  commented on Dec. 7, 2018, 8:11 p.m.

    Enur Yrotcaf 4 is basically 4 Factory Rune which is basically Factory Rune 4