Large Gcd (Keteki)
All submissions for this problem are available.Find the biggest integer d, such that all integers a, a + 1, a + 2, ..., b are divisible by d. Note: Large Constraints.
First line contains integer T (T<=10),number of test case
Next each T line of the input contains two integers a and b (1 ≤ a ≤ b ≤ 10^100000).
Output one integer — greatest common divisor of all integers from a to b inclusive.
1 <= T <= 10
1 <= a <= b <=10^100000
|Tags||chandubaba, keteki, kq162019|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.