SAC '22 Code Challenge 3 P2 - Unicycle License

View as PDF

Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 256M

Problem types

After having his driver's license revoked for speeding, Zain is forced to bike to school on his electric unicycle.

On his unicycle, his speed in metres can be modelled by the function S(t) = 12t^2 - 5t + 1, where t is the time in seconds that have passed (and must be positive).

Since Zain is a model citizen (and does not want his electric unicycle license revoked as well), he will stop when he reaches a speed above M.

Because Zain does not trust himself to stop, he entrusts you with telling him the exact time to stop within an absolute error of 10^{-6}.

Can you save Zain's license?

Input Specification

The first line will contain M (1 \le M \le 10^9), the speed where Zain dismounts his unicycle.

Output Specification

Output the time Zain should dismount his unicycle in seconds.

Note: A solution will be accepted with up to an error of 10^{-6}.

Sample Input


Sample Output



  • 0
    catamaran_detergent  commented on Sept. 11, 2023, 9:33 p.m.

    never did i ever think i was going to need the quadratic formula to solve dmoj problems, but here we are...