Programming contests

DEIK Regionális Programozó Csapatverseny, középiskolai kategória, 2023. december 3.

December 3, 2023, 10:00 AM – December 3, 2023, 3:30 PM

Biscuit

Peter’s grandma is baking biscuits.

She starts with Vcm3V \text{cm}^3 of dough, which she first rolls out into a square of thickness v1=1cmv_1=1cm. In every step, she cuts circular pieces (biscuits) of diameter dd from the rolled out though, in such a way that the centers of these cut out pieces form a regular square lattice. If she can’t cut out even a single piece, she stops. If she’s done with the kkth step, she examines vk+1=vk2v_{k+1}=\frac{v_k}{2}, if this number is less than vminv_{min} she stops, otherwise she continues with kneading and rolls out a square of thickness vk+1v_{k+1} from the remaining dough.

Peter’s job is to calculate from the parameters V,d,vminV, d, v_{min} how many biscuits the grandma will be able to make.

Input specification

A line with the space separated floating point numbers V,d,vminV,\ d,\ v_{min}.

Output specification

Output a single integer: the maximal number of biscuits that can be made.

Constraints

1V100001\le V \le 10000
1d101\le d \le 10
0.000001vmin10.000001\le v_{min} \le 1

Sample input 1

  1. 10.0 3.0 0.01
download as text file

Sample output 1

  1. 1
download as text file

Sample input 2

  1. 100.0 3.0 0.1
download as text file

Sample output 2

  1. 26
download as text file

Sample input 3

  1. 100.0 3.0 0.5
download as text file

Sample output 3

  1. 13
download as text file
University of Debrecen; Faculty of Informatics; v. 09/30/2024