#include <bits/stdc++.h>
#include <vector>
#include "Alice.h"
using namespace std;
using ll = long long;
vector<pair<int,int> > Alice() {
ll X = setN(1000);
vector<pair<int, int> > treeEdges;
treeEdges.reserve(1000 - 1);
// always connect to previous index, which is GUARANTEED to be connected
// by induction; moreover N - 1 edges w/ N vertices guarantees tree
for (ll mod = 2; mod <= 1000; mod++) {
// at most [1, mod - 1]
treeEdges.push_back({(X % (mod - 1)) + 1, mod});
}
return treeEdges;
}
#include <bits/stdc++.h>
#include <vector>
#include "Bob.h"
using namespace std;
using ll = long long;
const ll MAX_CAP = 1e18;
ll Bob(vector<pair<int, int> > V) {
// totalX (mod totalM)
ll totalX = 0, totalM = 1;
for (auto &congruence: V) {
// it is in form r (mod m)
auto [r, m] = congruence;
// r: [0, mod - 2], which is of class (mod m - 1)
r--; m--;
while (totalX % m != r) {
totalX += totalM;
}
totalM = lcm(totalM, m);
totalX %= totalM;
if (totalX > MAX_CAP) break;
}
return totalX;
}