MAMUN is a programmer. He is intelligent but not smart. One day he went to university. He saw a girl and follows her. But he doesn’t know, she has a boyfriend and he is very dangerous. His name is NAHID. ![enter image description here][1] After sometimes, NAHID goes there quickly. Then NAHID begin to hit him. MAMUN becomes angry. Then MAMUN also start hitting NAHID. **• NAHID’s number of hit is A • MAMUN’s number of hit is B** You are a junior programmer. The given input is the product of their hit number N (A*B). In this problem, you have to find the minimum difference between number of hit of MAMUN and NAHID. Input: ------ The first line of the input file contains an integer T(1<=T<=100), denoting the number of test cases. Each of the following T lines contains a single integer N(1<=N<=10<sup>12</sup>). Output: ------- Output **T** lines of non-negative integer, each line contains minimum possible difference between A & B. Sample Input ------------ 2 20 4 Sample Output ------------- 1 0 [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/e80a839b-1f81-c70f-3848-08d3ebbb9643_665c9a25f8df472cb95d26e5adca27db_W312xH140.png

Anowar Hossain Anu

Language |
Time Limit (seconds) |

C | 1.00 |

C++ | 1.00 |

C++14 | 1.00 |

C# | 3.00 |

Go | 3.00 |

Java | 3.00 |

JavaScript | 3.00 |

Objective-C | 3.00 |

Perl | 3.00 |

PHP | 3.00 |

Python | 3.00 |

Python3 | 3.00 |

Ruby | 3.00 |

VB.Net | 3.00 |

Solve/Submission

# | User | Language | Timing |
---|---|---|---|

01 | Morass | Cpp14 | 0.00s |

02 | souravahmed | C | 0.06s |

03 | SakibAlamin | Cpp14 | 0.06s |

04 | SugiuraAyano | C | 0.06s |

05 | vatsalsharma376 | Cpp14 | 0.07s |

06 | feodorv | Cpp14 | 0.07s |

07 | Nazmul0092 | Cpp14 | 0.07s |

08 | jayed_al_hasan | Cpp14 | 0.07s |

09 | sirpoka | Cpp14 | 0.07s |

10 | JubayerSohel | Cpp14 | 0.07s |

11 | Masum_ice | Cpp14 | 0.07s |

12 | afzalul | Cpp | 0.07s |

13 | tarikul_4152 | Cpp | 0.07s |

14 | twyu0721 | C | 0.07s |

15 | ss1230 | Cpp14 | 0.07s |

16 | pulak_ict_mbstu | Cpp | 0.07s |

17 | The_Viper | Cpp14 | 0.07s |

18 | Alamgir_JUST | Cpp14 | 0.08s |

19 | Ashish972 | Cpp14 | 0.08s |

20 | devcoder | CSharp | 0.09s |

21 | shishir09 | Cpp14 | 0.15s |

22 | Anubis | Cpp14 | 0.15s |

23 | I_Monimul | Cpp14 | 0.15s |

24 | Shajib | Cpp | 0.15s |

25 | Ashiq | CSharp | 0.17s |

26 | ronok_cse | Cpp14 | 0.19s |

27 | MAHRahat | Cpp14 | 0.22s |

28 | Najat | Cpp14 | 0.24s |

29 | nazmul_bzs | Cpp14 | 0.25s |

30 | 10102020 | Cpp | 0.26s |

31 | deder | Cpp14 | 0.26s |

32 | wayne6172 | Cpp | 0.27s |

33 | 7Mahfuz | Cpp14 | 0.27s |

34 | tariqiitju | Cpp | 0.28s |

35 | mamun02inf | Cpp | 0.28s |

36 | prateepm | Cpp14 | 0.29s |

37 | FahimSifnatul | Cpp14 | 0.30s |

38 | kakarotto | Cpp14 | 0.30s |

39 | sakib_ruet_13 | Cpp14 | 0.30s |

40 | Aint_Stain | Cpp14 | 0.31s |

41 | ryan | C | 0.32s |

42 | joymollick | Cpp | 0.33s |

43 | jubel | Cpp | 0.33s |

44 | Mahadi024 | Cpp14 | 0.33s |

45 | return_SS | Cpp14 | 0.33s |

46 | Dinar | Cpp14 | 0.34s |

47 | belal_mbstu | Cpp14 | 0.34s |

48 | emrul | Cpp14 | 0.36s |

49 | mazedulcs | CSharp | 0.37s |

50 | rabbicse | CSharp | 0.37s |

Copyright © 2015-2016 Dev Skill.

Feedback
#### Your feedback is our precious!

## Thank you for providing feedback! Our developers will be happy :)

## Sorry there was a problem when submitting the feedback. Please try again. :(