Yo`nalishlar
Hozirda online

Statistika

Masalalar soni: 909

Foydalanuvchilar soni: 8820

Jo'natishlar soni: 714406

Muhokama yozuvlari: 4541

Yangiliklar soni: 97

Yangiliklar izohlari: 1174


So'ngi izohlar

791. Long GCD
Vaqt limiti: 1 sekund
Xotira limiti: 64 MB

Eldor is student and he likes to work with big numbers. He is learning to find GCD (Greatest Common Divisor) of two big numbers.

Now he has N pairs of big numbers. He wants to find sum all of pairs of GCD. Please, help to Eldor  for to solve this problem.

 

Input:

Given the first line single integer number N (1<=N<=1000) – number of X and Y pairs. The next N lines given X and Y number of pairs(1<=X,Y<=10100).

Output:

Your task to print single integer number – the answer this problem.

Input

Output

2

1 10

3 6

4

1

10000000000000000000000 5000000

5000000

 

Tayyorladi: Doston Axmedov
Mening urinishlarim(0) Muhokama (0) Jo'natish Eng yaxshi yechimlar Barcha muvaffaqiyatli urinishlar(40) Barcha urinishlar(91)