Hdu 1851 Nim+巴什博弈
写出SG表 发现SG函数规律为Mi%(Li+1)
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; int ans = 0; for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; ans ^= a % (b + 1); } if (ans) { printf("No\n"); } else { printf("Yes\n"); } } return 0; }