Limits 1s, 512 MB

Kitorp loves his wife Asiar(who is a problem solver as well) but he loves math more. To get his attention, his wife took him to a bar and then they both got drunk. But now, being drunk, Kitorp can think more about math. Suddenly he came up with a math problem. He asked his wife, "We all know how to find the number of zeros at the end of factorial of a number." Being angry, his wife asked him to do the opposite of it. She said, "I give you a number x, find the smallest number n, such that n! (factorial n) ends with exactly x zeros." Now, Kitorp wants to find out the result, otherwise his wife will be more angry. So he seeks your help.
As Asiar is also drunk, there might be cases when there are no such number n. In that case Kitorp will get angry and will say, "Go Home! You are drunk!".


First line takes the number of test cases T. The following T lines take an integer x.

  • 1<=T<=100000

  • 0<=x<=100000000


Output the case number and the number n, if exists. Otherwise print "Go Home! You are drunk!".


Case 1: 10
Case 2: Go Home! You are drunk!


Login to submit.



77% Solution Ratio
alaminEarliest, May '18
steinumFastest, 0.0s
user.214434Lightest, 5.5 kB
NirjhorShortest, 536B
Toph uses cookies. By continuing you agree to our Cookie Policy.