#include<bits/stdc++.h>
using namespace std;
template<typename T>
int SIZE(T (&t)){
return t.size();
}
template<typename T, size_t N>
int SIZE(T (&t)[N]){
return N;
}
string to_string(char t){
return "'" + string({t}) + "'";
}
string to_string(bool t){
return t ? "true" : "false";
}
string to_string(const string &t, int x1=0, int x2=1e9){
string ret = "";
for(int i = min(x1,SIZE(t)), _i = min(x2,SIZE(t)-1); i <= _i; ++i){
ret += t[i];
}
return '"' + ret + '"';
}
string to_string(const char* t){
string ret(t);
return to_string(ret);
}
template<size_t N>
string to_string(const bitset<N> &t, int x1=0, int x2=1e9){
string ret = "";
for(int i = min(x1,SIZE(t)); i <= min(x2,SIZE(t)-1); ++i){
ret += t[i] + '0';
}
return to_string(ret);
}
template<typename T, typename... Coords>
string to_string(const T (&t), int x1=0, int x2=1e9, Coords... C);
template<typename T, typename S>
string to_string(const pair<T, S> &t){
return "(" + to_string(t.first) + ", " + to_string(t.second) + ")";
}
template<typename T, typename... Coords>
string to_string(const T (&t), int x1, int x2, Coords... C){
string ret = "[";
x1 = min(x1, SIZE(t));
auto e = begin(t);
advance(e,x1);
for(int i = x1, _i = min(x2,SIZE(t)-1); i <= _i; ++i){
ret += to_string(*e, C...) + (i != _i ? ", " : "");
e = next(e);
}
return ret + "]";
}
template<int Index, typename... Ts>
struct print_tuple{
string operator() (const tuple<Ts...>& t) {
string ret = print_tuple<Index - 1, Ts...>{}(t);
ret += (Index ? ", " : "");
return ret + to_string(get<Index>(t));
}
};
template<typename... Ts>
struct print_tuple<0, Ts...> {
string operator() (const tuple<Ts...>& t) {
return to_string(get<0>(t));
}
};
template<typename... Ts>
string to_string(const tuple<Ts...>& t) {
const auto Size = tuple_size<tuple<Ts...>>::value;
return print_tuple<Size - 1, Ts...>{}(t);
}
void dbgr(){;}
template<typename Heads, typename... Tails>
void dbgr(Heads H, Tails... T){
cout << to_string(H) << " | ";
dbgr(T...);
}
void dbgs(){;}
template<typename Heads, typename... Tails>
void dbgs(Heads H, Tails... T){
cout << H << " ";
dbgs(T...);
}
/*
formatted functions:
*/
/*
consider __VA_ARGS__ as a whole:
dbgv() prints values only
dbg() prints name and values
*/
#define dbgv(...) cout << to_string(__VA_ARGS__) << endl;
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgv(__VA_ARGS__);
/*
consider __VA_ARGS__ as a sequence of arguments:
dbgr() prints values only
dbgm() prints names and values
*/
#define dbgr(...) dbgr(__VA_ARGS__); cout << endl;
#define dbgm(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgr(__VA_ARGS__);
/*
dbgs() prints only values separated by spaces
*/
/*
compact version
template<typename T> int SIZE(T (&t)){ return t.size(); } template<typename T, size_t N> int SIZE(T (&t)[N]){ return N; } string to_string(char t){ return "'" + string({t}) + "'"; } string to_string(bool t){ return t ? "true" : "false"; } string to_string(const string &t, int x1=0, int x2=1e9){ string ret = ""; for(int i = min(x1,SIZE(t)), _i = min(x2,SIZE(t)-1); i <= _i; ++i){ ret += t[i]; } return '"' + ret + '"'; } string to_string(const char* t){ string ret(t); return to_string(ret); } template<size_t N> string to_string(const bitset<N> &t, int x1=0, int x2=1e9){ string ret = ""; for(int i = min(x1,SIZE(t)); i <= min(x2,SIZE(t)-1); ++i){ ret += t[i] + '0'; } return to_string(ret); } template<typename T, typename... Coords> string to_string(const T (&t), int x1=0, int x2=1e9, Coords... C); template<typename T, typename S> string to_string(const pair<T, S> &t){ return "(" + to_string(t.first) + ", " + to_string(t.second) + ")"; } template<typename T, typename... Coords> string to_string(const T (&t), int x1, int x2, Coords... C){ string ret = "["; x1 = min(x1, SIZE(t)); auto e = begin(t); advance(e,x1); for(int i = x1, _i = min(x2,SIZE(t)-1); i <= _i; ++i){ ret += to_string(*e, C...) + (i != _i ? ", " : ""); e = next(e); } return ret + "]"; } template<int Index, typename... Ts> struct print_tuple{ string operator() (const tuple<Ts...>& t) { string ret = print_tuple<Index - 1, Ts...>{}(t); ret += (Index ? ", " : ""); return ret + to_string(get<Index>(t)); } }; template<typename... Ts> struct print_tuple<0, Ts...> { string operator() (const tuple<Ts...>& t) { return to_string(get<0>(t)); } }; template<typename... Ts> string to_string(const tuple<Ts...>& t) { const auto Size = tuple_size<tuple<Ts...>>::value; return print_tuple<Size - 1, Ts...>{}(t); } void dbgr(){;} template<typename Heads, typename... Tails> void dbgr(Heads H, Tails... T){ cout << to_string(H) << " | "; dbgr(T...); } void dbgs(){;} template<typename Heads, typename... Tails> void dbgs(Heads H, Tails... T){ cout << H << " "; dbgs(T...); }
#define dbgv(...) cout << to_string(__VA_ARGS__) << endl;
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgv(__VA_ARGS__);
#define dbgr(...) dbgr(__VA_ARGS__); cout << endl;
#define dbgm(...) cout << "[" << #__VA_ARGS__ << "]: "; dbgr(__VA_ARGS__);
*/
int main(){
/*...useful defines...*/
#define fou(i,a,b) for(int i = a, _i = b; i <= _i; ++i)
#define fod(i,a,b) for(int i = a, _i = b; i >= _i; --i)
/*...tests...*/
int j[2][2][3] = {{{4,5,6},{10,11,12}}, {{1,2,3}, {7,8,9}}};
dbg(j);
dbg(j,0,0,0,1,0,1);
fou(x,0,0) fou(y,0,1) dbgv(j[x][y]);
map<vector<int>, vector<string>> a = {{{3,4},{"sauron"}}, {{1,2},{"gandalf", "the", "grey"}}, {{5},{"frodo","bilbo"}}};
dbg(a);
dbg(a,0,1);
dbg(a,5,5);
set<vector<string>> b[3] = {{{"abc", "def"},{"ghi"}}, {{"klm","nop"},{"qrs"}}, {{"tuv", "wxy", "zab"}}};
dbg(b,1,2,0,0,0,0,1,2);
dbg(b,1,2,0,0,0,0);
dbg(b,1,2,0,0);
dbg(b,1,2);
dbg(b);
fou(i,0,2) dbgv(b[i]);
map<int, map<int,int>> c = {{1,{{2,3}}},{4,{{5,6},{7,8}}},{9,{{10,11}}}};
dbg(c,0,0);
dbg(c);
vector<bitset<10>> q = {{12},{13},{14},{15}};
dbg(q);
dbg(q,1,2,0,2);
dbg(q,5,5,0,2);
for(int i = 0; i < 2; ++i) {
dbgm(q[i]);
}
pair<int, set<int>> m = {1, {2,3,3,3,4}};
dbg(m);
deque<int> i = {9,10,11,12};
dbg(i);
dbg(i,2,3);
set<pair<int, int>> x{{1,2},{3,4}};
dbg(x,1,1);
dbg(x);
string s = {"codeforces"};
dbg(s,20,1);
dbg(s,1,4);
int t = 5; char u = 'R';
pair<pair<double, unsigned int>, pair<int, string>> v = {{234.34534, 42}, {133, "IOI"}};
dbgm(s,t,u,v);
dbgm(5.345,7,12);
struct S {int a, b; pair<int, bitset<4>> c; vector<int> d;} w{2,3,{5,6},{7,1,6,3,7}};
auto W = make_tuple(w.a, w.b, w.c, w.d);
dbg(W);
dbgm(w.a, w.b, w.c, w.d);
dbgs(4, "$", '^'); cout << endl;
dbgr(5, bitset<4>(2), vector<int>({4,5,2,8}));
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnRlbXBsYXRlPHR5cGVuYW1lIFQ+CmludCBTSVpFKFQgKCZ0KSl7CiAgICByZXR1cm4gdC5zaXplKCk7Cn0KCnRlbXBsYXRlPHR5cGVuYW1lIFQsIHNpemVfdCBOPgppbnQgU0laRShUICgmdClbTl0pewogICAgcmV0dXJuIE47Cn0KCnN0cmluZyB0b19zdHJpbmcoY2hhciB0KXsKICAgIHJldHVybiAiJyIgKyBzdHJpbmcoe3R9KSArICInIjsKfQoKc3RyaW5nIHRvX3N0cmluZyhib29sIHQpewogICAgcmV0dXJuIHQgPyAidHJ1ZSIgOiAiZmFsc2UiOwp9CgpzdHJpbmcgdG9fc3RyaW5nKGNvbnN0IHN0cmluZyAmdCwgaW50IHgxPTAsIGludCB4Mj0xZTkpewogICAgc3RyaW5nIHJldCA9ICIiOwogICAgZm9yKGludCBpID0gbWluKHgxLFNJWkUodCkpLCBfaSA9IG1pbih4MixTSVpFKHQpLTEpOyBpIDw9IF9pOyArK2kpewogICAgICAgIHJldCArPSB0W2ldOwogICAgfQogICAgcmV0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W50LCBzZXQ8aW50Pj4gbSA9IHsxLCB7MiwzLDMsMyw0fX07CiAgICBkYmcobSk7CgoKICAgIGRlcXVlPGludD4gaSA9IHs5LDEwLDExLDEyfTsKICAgIGRiZyhpKTsKICAgIGRiZyhpLDIsMyk7CgoKICAgIHNldDxwYWlyPGludCwgaW50Pj4geHt7MSwyfSx7Myw0fX07CiAgICBkYmcoeCwxLDEpOwogICAgZGJnKHgpOwoKCiAgICBzdHJpbmcgcyA9IHsiY29kZWZvcmNlcyJ9OwogICAgZGJnKHMsMjAsMSk7CiAgICBkYmcocywxLDQpOwoKCiAgICBpbnQgdCA9IDU7IGNoYXIgdSA9ICdSJzsKICAgIHBhaXI8cGFpcjxkb3VibGUsIHVuc2lnbmVkIGludD4sIHBhaXI8aW50LCBzdHJpbmc+PiB2ID0ge3syMzQuMzQ1MzQsIDQyfSwgezEzMywgIklPSSJ9fTsKCiAgICBkYmdtKHMsdCx1LHYpOwoKICAgIGRiZ20oNS4zNDUsNywxMik7CgogICAgc3RydWN0IFMge2ludCBhLCBiOyBwYWlyPGludCwgYml0c2V0PDQ+PiBjOyB2ZWN0b3I8aW50PiBkO30gd3syLDMsezUsNn0sezcsMSw2LDMsN319OwogICAgYXV0byBXID0gbWFrZV90dXBsZSh3LmEsIHcuYiwgdy5jLCB3LmQpOwoKICAgIGRiZyhXKTsKCiAgICBkYmdtKHcuYSwgdy5iLCB3LmMsIHcuZCk7CgogICAgZGJncyg0LCAiJCIsICdeJyk7IGNvdXQgPDwgZW5kbDsKCiAgICBkYmdyKDUsIGJpdHNldDw0PigyKSwgdmVjdG9yPGludD4oezQsNSwyLDh9KSk7Cn0=
[j]: [[[4, 5, 6], [10, 11, 12]], [[1, 2, 3], [7, 8, 9]]]
[j,0,0,0,1,0,1]: [[[4, 5], [10, 11]]]
[4, 5, 6]
[10, 11, 12]
[a]: [([1, 2], ["gandalf", "the", "grey"]), ([3, 4], ["sauron"]), ([5], ["frodo", "bilbo"])]
[a,0,1]: [([1, 2], ["gandalf", "the", "grey"]), ([3, 4], ["sauron"])]
[a,5,5]: []
[b,1,2,0,0,0,0,1,2]: [[["lm"]], [["uv"]]]
[b,1,2,0,0,0,0]: [[["klm"]], [["tuv"]]]
[b,1,2,0,0]: [[["klm", "nop"]], [["tuv", "wxy", "zab"]]]
[b,1,2]: [[["klm", "nop"], ["qrs"]], [["tuv", "wxy", "zab"]]]
[b]: [[["abc", "def"], ["ghi"]], [["klm", "nop"], ["qrs"]], [["tuv", "wxy", "zab"]]]
[["abc", "def"], ["ghi"]]
[["klm", "nop"], ["qrs"]]
[["tuv", "wxy", "zab"]]
[c,0,0]: [(1, [(2, 3)])]
[c]: [(1, [(2, 3)]), (4, [(5, 6), (7, 8)]), (9, [(10, 11)])]
[q]: ["0011000000", "1011000000", "0111000000", "1111000000"]
[q,1,2,0,2]: ["101", "011"]
[q,5,5,0,2]: []
[q[i]]: "0011000000" |
[q[i]]: "1011000000" |
[m]: (1, [2, 3, 4])
[i]: [9, 10, 11, 12]
[i,2,3]: [11, 12]
[x,1,1]: [(3, 4)]
[x]: [(1, 2), (3, 4)]
[s,20,1]: ""
[s,1,4]: "odef"
[s,t,u,v]: "codeforces" | 5 | 'R' | ((234.345340, 42), (133, "IOI")) |
[5.345,7,12]: 5.345000 | 7 | 12 |
[W]: 2, 3, (5, "0110"), [7, 1, 6, 3, 7]
[w.a, w.b, w.c, w.d]: 2 | 3 | (5, "0110") | [7, 1, 6, 3, 7] |
4 $ ^
5 | "0100" | [4, 5, 2, 8] |