Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Montu Mia and the pillar of Nurjahan

By khatribiru · Limits 1s, 512 MB

As you might know Mr Montu Mia is very passionate about any challenges he faces. One day he went to the famous Nurjahan restaurant at Bottola, Jahangirnagar University. Recognizing him the restaurant owner challenged him to climb the biggest pillar and said that if he can climb the pillar successfully he will be rewarded a free grill and nun at dinner.

The pillar is of height H and radius R. And Montu Mia wishes to climb the pillar at a specific angle of with the ground all the time. Now he wonders can he reach the top and how much distance he will have to walk to reach the top of the pillar.


Input starts with an integer T (≤ 10000), denoting the number of test cases.
Each case contains three integer numbers H (0 < H ≤ 500) denoting the height, R (0 < R ≤ 500) denoting the radius and (0 ≤ Θ ≤ 90) denoting the angle.


For each case, print the distance rounded to two places after the decimal point or print “Montu Mia, Super Dumb!” without quote if he fails to reach the top of the pillar at all.


10 5 90
10 5 45




69% Solution Ratio

SHOVON26Earliest, Apr '18

Onik123Fastest, 0.0s

SHOVON26Lightest, 131 kB

akib9ctgShortest, 317B


Login to submit

Toph uses cookies. By continuing you agree to our Cookie Policy.