RKMINIMA - Guess The Number

Ushio and Tora are always good friends. Ushio always wanted to play with numbers. But Tora is afraid of big numbers. One day Ushio took two distinct integers x,y and calculated their product m. As Ushio doesn't want Tora to get afraid, he wants to choose x and y in such a way that their product remains same but their average p is minimum. Ushio can fight Demons but he is weak in math. help ushio calculating this minimum value of p.


First Line of the input statement will contain an integer T. Each of the next T lines will contain an integer m ( as stated in the problem statement ).




Print the minimum possible value of p for each testcase. If there's no possible solution then print "Ushio is sad". If there's no lower bound on value of p then print "Tora is fearless".

Note: Average of a and b is the integer division of (a+b)/2.


Tora is fearless
Ushio is sad

hide comments
raka143: 2020-01-02 08:48:54

ok I will provide more testcases. But before accusing me please check the submissin status of this problem.

tarun_28: 2020-01-02 06:13:10

I agree with @nadstratosfer..
plz provide some testcases in sample section along with verification..
Otherwise only 'Comilla University' students will be able to get AC...smile if u get it;)

raka143: 2020-01-01 21:33:08

I hope u understand now...

raka143: 2020-01-01 21:27:13

"two distinct integers x,y"

tarun_28: 2020-01-01 20:43:03

Please explain a few test cases:(
For m=1,
x=y= (-1)
Hence average=(-1)
Still "Ushio is sad"....lol
am i missing something?

Last edit: 2020-01-01 20:51:47
nadstratosfer: 2020-01-01 20:06:13

Bullshit. 0 only factors in result for m=0, and when x, y are allowed to be negative the problem is trivial, yet the changed solution gets WA anyway.

Looks like a task set to boost psetters schoolbuddies' ratings, admins please hide the problem.

raka143: 2020-01-01 19:47:39

Yes I have checked your solution and you are missing something. x*y=m here x and y are "integers" .

nadstratosfer: 2020-01-01 19:19:48

I can't see anything of significance that was changed. x and y are still distinct divisors of m, p is still an integer division (floor). As division of an integer by 2 cannot be "infinitely long", the "Tora is fearless" case is redundant. I've tested my solution with bruteforce up to 10^7 and for several million of random large values of m.

Please clarify the statement if I'm missing something, provide more testcases in the sample section and verify the testdata.

raka143: 2020-01-01 19:12:29

Problem statement has been changed. There was a mistake. Read the statements and output specifications carefully now.

nadstratosfer: 2020-01-01 18:06:46

Please verify correctness of testdata.

Added by:Raka
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Resource:2019 GATE exam from IIT