Skip to content

Instantly share code, notes, and snippets.

@yurahuna
Last active October 2, 2016 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yurahuna/7017be62bab3973cf48cce89cd030fd6 to your computer and use it in GitHub Desktop.
Save yurahuna/7017be62bab3973cf48cce89cd030fd6 to your computer and use it in GitHub Desktop.
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
int T;
cin >> T;
rep(t, T) {
int N, D;
cin >> N >> D;
cout << 127 * (N - 1) + (N % 2 ? D : D ^ 127) << endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment