
GCD+LCM
yuebaba
鶸鶸鶸
展开
-
HDU 1222Wolf and Rabbit
There is a hill with n holes around. The holes are signed from 0 to n-1. A rabbit must hide in one of the holes. A wolf searches the rabbit in anticlockwise order. The first hole he get into is t...原创 2018-07-19 16:48:18 · 140 阅读 · 0 评论 -
HDU 2504又见GCD
有三个正整数a,b,c(0<a,b,c<10^6),其中c不等于b。若a和c的最大公约数为b,现已知a和b,求满足条件的最小的c。 Input第一行输入一个n,表示有n组测试数据,接下来的n行,每行输入两个正整数a,b。 Output输出对应的c,每组测试数据占一行。 Sample Input26 212 4Sample Output48...原创 2018-07-19 16:53:06 · 176 阅读 · 0 评论