THREENUMBERS  nth number
Given two numbers a and b, you have to find nth number which is divisible by a or b.
Input
First line contains an integer T (<= 100000), denoting number of test cases.
Second line contains 3 positive integers a, b and n. (a, b <= 10000, n <= 1000000000)
Output
Print nth number in a new line.
Example
Input: 1 2 3 10
Output: 15
hide comments
nadstratosfer:
20180612 21:36:54
Kudos to wisfaq for figuring out that the missing testcase requires reprinting the last result. Completely lame from psetter to leave something like this for solvers to handle. 1 

sonuverma:
20180108 06:31:21
Binary Search :) 

Nishant Gupta:
20171224 21:04:44
Some input files seem to be broken which will cause Fast I/O yielding TLE.


holmesherlock:
20171105 19:39:58
very good problem :)


mahilewets:
20170916 17:05:14
Nice, I learned how to handle exceptions in Python 

Aleksandar Kostadinov:
20170911 21:46:55
@wisfaq: Thanks for usefull hint! 

wisfaq:
20170911 20:44:38
@David (and others having problems with NZEC)


David N. Springer:
20170911 15:30:37
If I check for premature EOF, I get WA otherwise I get NZEC.


vengatesh15:
20170911 08:27:26
easy one ..


kkgujjar:
20170910 20:01:59
can anyone send me the hint or solution of this problem ?? 
Added by:  surayans tiwari 
Date:  20170909 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 
Resource:  SELF 