#include using namespace std; int gcd(int a,int b){return b?gcd(b,a%b):a;} long A,B,K,L; main() { int N; cin>>N; for(int i=0;i