intgcd(int a, int b) { return b ? gcd(b, a % b) : a; }
intmain() { int x, y; cin >> x >> y; constint n = 10000; vector<int> uq(x); uq[0] = n; int sum = n; for (int i = 1; i < x; ++i) { uq[i] = x - i; sum += uq[i]; } int target = n * y; for (int i = 1; i < x; ++i) { int maxuq = uq[i - 1] - 1; int maxadd = maxuq - uq[i]; int taradd = target - sum; if (taradd > maxadd) { uq[i] = maxuq; sum += maxadd; } else { uq[i] += taradd; sum += taradd; break; } } for (int i = 0; i < x - 1; ++i) { int up = uq[i + 1]; int dp = uq[i]; up = dp - up; int gp = gcd(up, dp); up /= gp; dp /= gp; cout << up << " " << dp << "\n"; } cout << "1 1"; return0; }