QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#298328 | #7899. Say Hello to the Future | ucup-team266# | WA | 0ms | 3552kb | C++23 | 16.1kb | 2024-01-05 23:57:27 | 2024-01-05 23:57:28 |
Judging History
answer
//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
vector<vector<int>> table={{2,2,2,3,1,2,1,3},
{3,2,3,4,1,2,1,4,2,3},
{3,3,3,4,1,2,1,4,2,3},
{4,2,4,5,1,2,1,4,2,3,4,5},
{4,3,4,5,1,2,1,4,2,3,4,5},
{4,4,4,5,1,2,1,4,2,3,4,5},
{5,2,5,6,1,2,1,5,2,3,3,4,5,6},
{5,3,5,6,1,2,1,4,1,6,2,3,4,5},
{5,4,5,6,1,2,1,4,1,6,2,3,4,5},
{5,5,5,6,1,2,1,4,1,6,2,3,4,5},
{6,2,7,7,1,2,1,5,2,3,3,4,5,6,6,7},
{6,3,8,7,1,2,1,4,1,6,2,3,4,5,6,7},
{6,4,8,7,1,2,1,4,1,6,2,3,4,5,6,7},
{6,5,8,7,1,2,1,4,1,6,2,3,4,5,6,7},
{6,6,8,7,1,2,1,4,1,6,2,3,4,5,6,7},
{7,2,9,8,1,2,1,6,2,3,3,4,4,5,6,7,7,8},
{7,3,9,8,1,2,1,5,1,7,2,3,3,4,5,6,7,8},
{7,4,9,8,1,2,1,4,1,6,1,8,2,3,4,5,6,7},
{7,5,9,8,1,2,1,4,1,6,1,8,2,3,4,5,6,7},
{7,6,9,8,1,2,1,4,1,6,1,8,2,3,4,5,6,7},
{7,7,9,8,1,2,1,4,1,6,1,8,2,3,4,5,6,7},
{8,2,12,9,1,2,1,6,2,3,3,4,4,5,6,7,7,8,8,9},
{8,3,13,9,1,2,1,6,1,8,2,3,3,4,4,5,6,7,8,9},
{8,4,16,9,1,2,1,4,1,6,1,8,2,3,4,5,6,7,8,9},
{8,5,16,9,1,2,1,4,1,6,1,8,2,3,4,5,6,7,8,9},
{8,6,16,9,1,2,1,4,1,6,1,8,2,3,4,5,6,7,8,9},
{8,7,16,9,1,2,1,4,1,6,1,8,2,3,4,5,6,7,8,9},
{8,8,16,9,1,2,1,4,1,6,1,8,2,3,4,5,6,7,8,9},
{9,2,16,10,1,2,1,7,2,3,3,4,4,5,5,6,7,8,8,9,9,10},
{9,3,17,10,1,2,1,7,1,9,2,3,3,4,4,5,5,6,7,8,9,10},
{9,4,17,10,1,2,1,5,1,7,1,9,2,3,3,4,5,6,7,8,9,10},
{9,5,17,10,1,2,1,4,1,6,1,8,1,10,2,3,4,5,6,7,8,9},
{9,6,17,10,1,2,1,4,1,6,1,8,1,10,2,3,4,5,6,7,8,9},
{9,7,17,10,1,2,1,4,1,6,1,8,1,10,2,3,4,5,6,7,8,9},
{9,8,17,10,1,2,1,4,1,6,1,8,1,10,2,3,4,5,6,7,8,9},
{9,9,17,10,1,2,1,4,1,6,1,8,1,10,2,3,4,5,6,7,8,9},
{10,2,21,11,1,2,1,7,2,3,3,4,4,5,5,6,7,8,8,9,9,10,10,11},
{10,3,23,11,1,2,1,7,2,3,2,4,3,6,4,5,7,8,7,9,8,11,9,10},
{10,4,25,11,1,2,1,6,1,8,1,10,2,3,3,4,4,5,6,7,8,9,10,11},
{10,5,32,11,1,2,1,4,1,6,1,8,1,10,2,3,4,5,6,7,8,9,10,11},
{10,6,32,11,1,2,1,4,1,6,1,8,1,10,2,3,4,5,6,7,8,9,10,11},
{10,7,32,11,1,2,1,4,1,6,1,8,1,10,2,3,4,5,6,7,8,9,10,11},
{10,8,32,11,1,2,1,4,1,6,1,8,1,10,2,3,4,5,6,7,8,9,10,11},
{10,9,32,11,1,2,1,4,1,6,1,8,1,10,2,3,4,5,6,7,8,9,10,11},
{10,10,32,11,1,2,1,4,1,6,1,8,1,10,2,3,4,5,6,7,8,9,10,11},
{11,2,28,12,1,2,1,8,2,3,3,4,4,5,5,6,6,7,8,9,9,10,10,11,11,12},
{11,3,33,12,1,2,1,8,2,3,3,4,3,5,4,7,5,6,8,9,8,10,9,12,10,11},
{11,4,33,12,1,2,1,7,1,9,1,11,2,3,3,4,4,5,5,6,7,8,9,10,11,12},
{11,5,33,12,1,2,1,5,1,7,1,9,1,11,2,3,3,4,5,6,7,8,9,10,11,12},
{11,6,33,12,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11},
{11,7,33,12,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11},
{11,8,33,12,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11},
{11,9,33,12,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11},
{11,10,33,12,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11},
{11,11,33,12,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11},
{12,2,37,13,1,2,1,8,2,3,3,4,4,5,5,6,6,7,8,9,9,10,10,11,11,12,12,13},
{12,3,40,13,1,2,1,8,2,3,3,4,3,5,4,7,5,6,8,9,9,10,9,11,10,13,11,12},
{12,4,43,13,1,2,1,8,1,10,1,12,2,3,3,4,3,5,4,7,5,6,8,9,10,11,12,13},
{12,5,49,13,1,2,1,6,1,8,1,10,1,12,2,3,3,4,4,5,6,7,8,9,10,11,12,13},
{12,6,64,13,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11,12,13},
{12,7,64,13,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11,12,13},
{12,8,64,13,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11,12,13},
{12,9,64,13,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11,12,13},
{12,10,64,13,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11,12,13},
{12,11,64,13,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11,12,13},
{12,12,64,13,1,2,1,4,1,6,1,8,1,10,1,12,2,3,4,5,6,7,8,9,10,11,12,13},
{13,2,49,14,1,2,1,9,2,3,3,4,4,5,5,6,6,7,7,8,9,10,10,11,11,12,12,13,13,14},
{13,3,56,14,1,2,1,9,2,3,3,4,4,5,4,6,5,8,6,7,9,10,10,11,10,12,11,14,12,13},
{13,4,65,14,1,2,1,9,1,11,1,13,2,3,2,4,2,5,3,8,4,7,5,6,9,10,11,12,13,14},
{13,5,65,14,1,2,1,7,1,9,1,11,1,13,2,3,3,4,4,5,5,6,7,8,9,10,11,12,13,14},
{13,6,65,14,1,2,1,5,1,7,1,9,1,11,1,13,2,3,3,4,5,6,7,8,9,10,11,12,13,14},
{13,7,65,14,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13},
{13,8,65,14,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13},
{13,9,65,14,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13},
{13,10,65,14,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13},
{13,11,65,14,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13},
{13,12,65,14,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13},
{13,13,65,14,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13},
{14,2,65,15,1,2,1,9,2,3,3,4,4,5,5,6,6,7,7,8,9,10,10,11,11,12,12,13,13,14,14,15},
{14,3,73,15,1,2,1,9,2,3,3,4,4,5,4,6,5,8,6,7,9,10,10,11,11,12,11,13,12,15,13,14},
{14,4,79,15,1,2,1,9,2,3,2,4,2,5,3,8,4,7,5,6,9,10,9,11,9,12,10,15,11,14,12,13},
{14,5,83,15,1,2,1,8,1,10,1,12,1,14,2,3,3,4,3,5,4,7,5,6,8,9,10,11,12,13,14,15},
{14,6,97,15,1,2,1,6,1,8,1,10,1,12,1,14,2,3,3,4,4,5,6,7,8,9,10,11,12,13,14,15},
{14,7,128,15,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{14,8,128,15,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{14,9,128,15,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{14,10,128,15,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{14,11,128,15,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{14,12,128,15,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{14,13,128,15,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{14,14,128,15,1,2,1,4,1,6,1,8,1,10,1,12,1,14,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{15,2,86,16,1,2,1,10,2,3,3,4,4,5,5,6,6,7,7,8,8,9,10,11,11,12,12,13,13,14,14,15,15,16},
{15,3,101,16,1,2,1,7,1,12,2,3,2,4,3,6,4,5,7,8,7,9,8,11,9,10,12,13,12,14,13,16,14,15},
{15,4,129,16,1,2,1,10,2,3,3,4,3,5,3,6,4,9,5,8,6,7,10,11,10,12,10,13,11,16,12,15,13,14},
{15,5,129,16,1,2,1,9,1,11,1,13,1,15,2,3,2,4,2,5,3,8,4,7,5,6,9,10,11,12,13,14,15,16},
{15,6,129,16,1,2,1,7,1,9,1,11,1,13,1,15,2,3,3,4,4,5,5,6,7,8,9,10,11,12,13,14,15,16},
{15,7,129,16,1,2,1,5,1,7,1,9,1,11,1,13,1,15,2,3,3,4,5,6,7,8,9,10,11,12,13,14,15,16},
{15,8,129,16,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{15,9,129,16,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{15,10,129,16,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{15,11,129,16,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{15,12,129,16,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{15,13,129,16,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{15,14,129,16,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{15,15,129,16,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15},
{16,2,114,17,1,2,1,10,2,3,3,4,4,5,5,6,6,7,7,8,8,9,10,11,11,12,12,13,13,14,14,15,15,16,16,17},
{16,3,137,17,1,2,1,9,1,16,2,3,3,4,4,5,4,6,5,8,6,7,9,10,10,11,11,12,11,13,12,15,13,14,16,17},
{16,4,144,17,1,2,1,10,2,3,3,4,3,5,3,6,4,9,5,8,6,7,10,11,11,12,11,13,11,14,12,17,13,16,14,15},
{16,5,151,17,1,2,1,10,1,12,1,14,1,16,2,3,3,4,3,5,3,6,4,9,5,8,6,7,10,11,12,13,14,15,16,17},
{16,6,163,17,1,2,1,8,1,10,1,12,1,14,1,16,2,3,3,4,3,5,4,7,5,6,8,9,10,11,12,13,14,15,16,17},
{16,7,193,17,1,2,1,6,1,8,1,10,1,12,1,14,1,16,2,3,3,4,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{16,8,256,17,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{16,9,256,17,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{16,10,256,17,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{16,11,256,17,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{16,12,256,17,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{16,13,256,17,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{16,14,256,17,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{16,15,256,17,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{16,16,256,17,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{17,2,151,18,1,2,1,11,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,11,12,12,13,13,14,14,15,15,16,16,17,17,18},
{17,3,172,18,1,2,1,9,1,14,2,3,3,4,4,5,4,6,5,8,6,7,9,10,9,11,10,13,11,12,14,15,14,16,15,18,16,17},
{17,4,208,18,1,2,1,11,2,3,3,4,4,5,4,6,4,7,5,10,6,9,7,8,11,12,12,13,12,14,12,15,13,18,14,17,15,16},
{17,5,257,18,1,2,1,11,1,13,1,15,1,17,2,3,3,4,4,5,4,6,4,7,5,10,6,9,7,8,11,12,13,14,15,16,17,18},
{17,6,257,18,1,2,1,9,1,11,1,13,1,15,1,17,2,3,2,4,2,5,3,8,4,7,5,6,9,10,11,12,13,14,15,16,17,18},
{17,7,257,18,1,2,1,7,1,9,1,11,1,13,1,15,1,17,2,3,3,4,4,5,5,6,7,8,9,10,11,12,13,14,15,16,17,18},
{17,8,257,18,1,2,1,5,1,7,1,9,1,11,1,13,1,15,1,17,2,3,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18},
{17,9,257,18,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{17,10,257,18,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{17,11,257,18,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{17,12,257,18,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{17,13,257,18,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{17,14,257,18,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{17,15,257,18,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{17,16,257,18,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{17,17,257,18,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17},
{18,2,200,19,1,2,1,11,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19},
{18,3,236,19,1,2,1,10,1,15,2,3,3,4,4,5,5,6,5,7,6,9,7,8,10,11,10,12,11,14,12,13,15,16,15,17,16,19,17,18},
{18,4,273,19,1,2,1,11,2,3,3,4,4,5,4,6,4,7,5,10,6,9,7,8,11,12,12,13,13,14,13,15,13,16,14,19,15,18,16,17},
{18,5,287,19,1,2,1,11,2,3,2,4,2,5,2,6,3,10,4,9,5,8,6,7,11,12,11,13,11,14,11,15,12,19,13,18,14,17,15,16},
{18,6,295,19,1,2,1,10,1,12,1,14,1,16,1,18,2,3,3,4,3,5,3,6,4,9,5,8,6,7,10,11,12,13,14,15,16,17,18,19},
{18,7,323,19,1,2,1,8,1,10,1,12,1,14,1,16,1,18,2,3,3,4,3,5,4,7,5,6,8,9,10,11,12,13,14,15,16,17,18,19},
{18,8,385,19,1,2,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,3,4,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{18,9,512,19,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{18,10,512,19,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{18,11,512,19,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{18,12,512,19,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{18,13,512,19,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{18,14,512,19,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{18,15,512,19,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{18,16,512,19,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{18,17,512,19,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{18,18,512,19,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{19,2,265,20,1,2,1,12,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20},
{19,3,308,20,1,2,1,9,1,16,2,3,3,4,4,5,4,6,5,8,6,7,9,10,10,11,11,12,11,13,12,15,13,14,16,17,16,18,17,20,18,19},
{19,4,365,20,1,2,1,9,1,16,2,3,2,4,2,5,3,8,4,7,5,6,9,10,9,11,9,12,10,15,11,14,12,13,16,17,16,18,17,20,18,19},
{19,5,513,20,1,2,1,12,2,3,3,4,3,5,3,6,3,7,4,11,5,10,6,9,7,8,12,13,12,14,12,15,12,16,13,20,14,19,15,18,16,17},
{19,6,513,20,1,2,1,11,1,13,1,15,1,17,1,19,2,3,3,4,4,5,4,6,4,7,5,10,6,9,7,8,11,12,13,14,15,16,17,18,19,20},
{19,7,513,20,1,2,1,9,1,11,1,13,1,15,1,17,1,19,2,3,2,4,2,5,3,8,4,7,5,6,9,10,11,12,13,14,15,16,17,18,19,20},
{19,8,513,20,1,2,1,7,1,9,1,11,1,13,1,15,1,17,1,19,2,3,3,4,4,5,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20},
{19,9,513,20,1,2,1,5,1,7,1,9,1,11,1,13,1,15,1,17,1,19,2,3,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20},
{19,10,513,20,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{19,11,513,20,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{19,12,513,20,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{19,13,513,20,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{19,14,513,20,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{19,15,513,20,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{19,16,513,20,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{19,17,513,20,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{19,18,513,20,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{19,19,513,20,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19},
{20,2,351,21,1,2,1,12,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21},
{20,3,420,21,1,2,1,12,1,17,2,3,2,4,3,11,4,5,5,6,6,7,6,8,7,10,8,9,12,13,12,14,13,16,14,15,17,18,17,19,18,21,19,20},
{20,4,529,21,1,2,1,11,1,20,2,3,3,4,4,5,4,6,4,7,5,10,6,9,7,8,11,12,12,13,13,14,13,15,13,16,14,19,15,18,16,17,20,21},
{20,5,544,21,1,2,1,12,2,3,3,4,3,5,3,6,3,7,4,11,5,10,6,9,7,8,12,13,13,14,13,15,13,16,13,17,14,21,15,20,16,19,17,18},
{20,6,559,21,1,2,1,12,1,14,1,16,1,18,1,20,2,3,3,4,3,5,3,6,3,7,4,11,5,10,6,9,7,8,12,13,14,15,16,17,18,19,20,21},
{20,7,583,21,1,2,1,10,1,12,1,14,1,16,1,18,1,20,2,3,3,4,3,5,3,6,4,9,5,8,6,7,10,11,12,13,14,15,16,17,18,19,20,21},
{20,8,643,21,1,2,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,3,4,3,5,4,7,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
{20,9,769,21,1,2,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,3,4,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
{20,10,1024,21,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
{20,11,1024,21,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
{20,12,1024,21,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
{20,13,1024,21,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
{20,14,1024,21,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
{20,15,1024,21,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
{20,16,1024,21,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
{20,17,1024,21,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
{20,18,1024,21,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
{20,19,1024,21,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21},
{20,20,1024,21,1,2,1,4,1,6,1,8,1,10,1,12,1,14,1,16,1,18,1,20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21}};
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--)
{
int m,d;
cin>>m>>d;
for(auto vec:table)
if(vec[0]==m&&vec[1]==d)
{
cout<<vec[2]<<endl;
cout<<vec[3]<<endl;
for(int i=4;i<sz(vec);i+=2)
cout<<vec[i]<<" "<<vec[i+1]<<endl;
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3552kb
input:
5 1 3 2 1 2
output:
result:
wrong answer Unexpected EOF in the participants output