CF267A.Subtractions
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You've got two numbers. As long as they are both larger than zero, they go through the same operation: subtract the lesser number from the larger one. If they equal substract one number from the another. For example, one operation transforms pair (4,17) to pair (4,13), it transforms (5,5) to (0,5).
You've got some number of pairs ( ai,bi ). How many operations will be performed for each of them?
输入格式
The first line contains the number of pairs n ( 1<=n<=1000 ). Then follow n lines, each line contains a pair of positive integers ai,bi ( 1<=ai,bi<=109 ).
输出格式
Print the sought number of operations for each pair on a single line.
输入输出样例
输入#1
2 4 17 7 987654321
输出#1
8 141093479