标签:include names else link int ios pac ace problem
若 x 为偶数 L = x - 4 , R = x , 因为(x - 4) ^ (x - 3) = (x - 2) ^ (x - 1) = 1
若x 为奇数 L = x - 3 , R = x - 1 因为(x - 3) ^ (x - 2) = 1; (x - 1) ^ 1 = x;
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int T; cin >> T;
while(T--)
{
long long n;
cin >> n;
if(n == 0) cout << 1 << ' ' << 3 << '\n';
else if(n == 1) cout << 2 << ' ' << 3 << '\n';
else if(n == 2) cout << 3 << ' ' << 5 << '\n';
else if(n == 3) cout << 1 << ' ' << 2 << '\n';
else if(n == 4) cout << 1 << ' ' << 4 << '\n';
else if(n % 2 == 0) cout << n - 4 << ' ' << n << '\n';
else if(n % 2 == 1) cout << n - 3 << ' ' << n - 1 << '\n';
}
return 0;
}
标签:include names else link int ios pac ace problem
原文地址:https://www.cnblogs.com/R-Q-R-Q/p/12316293.html