思路
这道题其实可以找规律。
找规律可以发现 且 时答案总为 。
当 时,如样例所示,答案为 ,此处需要特判。
代码
#include <bits/stdc++.h>
using namespace std;
int T, n, k;
signed main() {
cin >> T;
while (T--) {
cin >> n >> k;
if (n == 0 && k == 1)
cout << "11" << endl;
else {
cout << "213";
for (int i = 1; i <= n; i++) {
cout << "0";
}
cout << endl;
}
}
return 0;
}