QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#314879 | #4834. Trijection | duongnc000 | AC ✓ | 18ms | 3988kb | C++20 | 10.1kb | 2024-01-26 13:51:24 | 2024-01-26 13:51:26 |
Judging History
answer
/*
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,fma,bmi,bmi2,sse4.2,popcnt,lzcnt")
*/
#include <bits/stdc++.h>
#define taskname ""
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define i64 long long
#define pb push_back
#define ff first
#define ss second
#define isz(x) (int)x.size()
using namespace std;
const int mxN = 2e5 + 5;
const int mod = 1e9 + 7;
const i64 oo = 1e18;
string poly_to_string(vector<vector<char>> &a) {
int n = isz(a), m = isz(a[0]);
vector<int> chosen(m);
for (int j = 0; j < m; ++j) {
for (int i = 0; i < n; ++i) {
if (a[i][j] == '#') {
chosen[j] = i;
break;
}
}
}
vector<int> v;
int ptr = 1;
for (int j = 0; j < m; ++j) {
--ptr;
while (ptr < n and a[ptr][j] == '#') v.emplace_back((++ptr) - chosen[j]);
}
int sum = 0;
string s = "";
for (int val : v) {
while (sum > val - 1) {
s.push_back(')');
--sum;
}
s.push_back('(');
++sum;
}
while (sum > 0) {
s.push_back(')');
--sum;
}
return s;
}
string perm_to_string(vector<int> &a) {
int n = isz(a);
vector<int> v;
int maxx = 0, pfx = 0;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < a[i] - maxx; ++j)
v.emplace_back(++pfx);
--pfx;
maxx = max(maxx, a[i]);
}
int sum = 0;
string s = "";
for (int val : v) {
while (sum > val - 1) {
s.push_back(')');
--sum;
}
s.push_back('(');
++sum;
}
while (sum > 0) {
s.push_back(')');
--sum;
}
return s;
}
string triang_to_string(vector<array<int, 3>> &a) {
int n = isz(a);
vector<vector<int>> edges(n + 10);
map<pair<int, int>, int> mp;
int root;
auto cook = [&](int x, int y, int idx) -> void {
if (x > y) swap(x, y);
if (x + 1 == y or x + n + 1 == y) {
// cout << x << " " << y << " = " << idx << endl;
if (y == 2) root = idx;
else edges[idx].emplace_back(x != 1 ? -x : -y);
return;
}
// cout << x << " " << y << " " << idx << endl;
if (mp.find({x, y}) == mp.end()) mp[{x, y}] = idx;
else {
int cidx = mp[{x, y}];
// cout << idx << " <-> " << cidx << endl;
edges[cidx].emplace_back(idx), edges[idx].emplace_back(cidx);
}
};
for (int i = 0; i < n; ++i) {
auto [x, y, z] = a[i];
cook(x, y, i);
cook(y, z, i);
cook(z, x, i);
}
auto dfs = [&](int v, int p, auto dfs) -> pair<int, string> {
vector<pair<int, string>> vec;
for (int u : edges[v]) if (u != p) {
// cout << v << " -> " << u << endl;
if (u < 0) vec.emplace_back(u, "");
else vec.push_back(dfs(u, v, dfs));
}
sort(rall(vec));
assert(isz(vec) == 2);
if (vec[0].ss.empty() and vec[1].ss.empty()) return {vec[0].ff, "()"};
if (vec[0].ss.empty()) return {vec[0].ff, "(" + vec[1].ss + ")"};
if (vec[1].ss.empty()) return {vec[0].ff, vec[0].ss + "()"};
return {vec[0].ff, vec[0].ss + "(" + vec[1].ss + ")"};
};
// cout << root << endl;
return dfs(root, root, dfs).ss;
}
vector<vector<char>> string_to_poly(string s) {
int sum = 0;
vector<int> v;
for (char ch : s) {
if (ch == '(') v.emplace_back(++sum);
else --sum;
}
sum = 0;
int x = -1, y = 0;
vector<pair<int, int>> allpos;
for (int val : v) {
if (sum >= val) {
++y;
for (int i = 0; i < val; ++i) {
// cout << x - i << " " << y << endl;
allpos.emplace_back(x - i, y);
}
}
else {
// cout << x + 1 << " " << y << endl;
allpos.emplace_back(++x, y);
}
sum = val;
}
int mx, my; tie(mx, my) = *max_element(all(allpos));
// cout << mx << " " << my << endl;
vector<vector<char>> res(mx + 1, vector<char>(my + 1, '.'));
for (auto [x, y] : allpos) res[x][y] = '#';
return res;
}
vector<int> string_to_perm(string s) {
set<int> st;
for (int i = 1; i <= isz(s) / 2; ++i) st.insert(i);
int sum = 0;
vector<int> v;
for (int i = 0; i < isz(s); ++i) {
if (s[i] == '(') ++sum;
else {
if (s[i - 1] == '(') {
v.emplace_back(sum);
st.erase(sum);
}
else {
v.emplace_back(*st.begin());
st.erase(st.begin());
}
}
}
return v;
}
void sortge(array<int, 3> &a) {
if (a[0] > a[1]) swap(a[0], a[1]);
if (a[0] > a[2]) swap(a[0], a[2]);
if (a[1] > a[2]) swap(a[1], a[2]);
}
vector<array<int, 3>> ar3res;
void dfs(string s, int l, int r, int u, int v) {
int len = isz(s), sum = 0, pos = -1;
if (len == 2) {
array<int, 3> a = {u, v, r};
sortge(a); ar3res.push_back(a);
return;
}
for (int i = len - 1; i >= 0; --i) {
sum += (s[i] == ')' ? 1 : -1);
if (sum == 0) {
pos = i;
break;
}
}
if (pos == 0) {
array<int, 3> a = {u, v, l + 1};
sortge(a); ar3res.push_back(a);
dfs(s.substr(1, len - 2), l + 1, r, l + 1, v);
}
else if (pos == len - 2) {
array<int, 3> a = {u, v, r};
sortge(a); ar3res.push_back(a);
dfs(s.substr(0, len - 2), l, r - 1, u, r);
}
else {
int inter = l + pos / 2 + 1;
array<int, 3> a = {u, v, inter};
sortge(a); ar3res.push_back(a);
dfs(s.substr(0, pos), l, inter - 1, u, inter);
dfs(s.substr(pos + 1, len - pos - 2), inter, r, inter, v);
}
}
vector<array<int, 3>> string_to_triang(string s) {
ar3res.clear();
dfs(s, 2, isz(s) / 2 + 2, 2, 1);
sort(all(ar3res));
return ar3res;
}
vector<int> brackets_to_sum;
long long dp[100][100];
long long F(int i, int j){
if(j < 0)return 0;
if(i == 0)return (j==0);
if(dp[i][j] != -1)return dp[i][j];
dp[i][j] = F(i-1, j-1) + F(i-1, j+1);
return dp[i][j];
}
long long get_order(vector<int> vec){
long long res = 0, total = 0;
for(int i = 0; i < vec.size(); i++){
if(vec[i] == 1)res += F(vec.size() - i - 1, total-1);
// cout << res << endl;
total += vec[i];
}
return res;
}
vector<int> get_bracket(long long ord, int n){
vector<int> res;
int total = 0;
for(int i = 0; i < n; i++){
if(!total)res.push_back(1);
else {
// cout << F(n-i-1, total-1) << endl;
if(F(n-i-1, total-1) <= ord){
ord -= F(n-i-1, total-1);
res.push_back(1);
}
else res.push_back(-1);
}
total += res.back();
}
return res;
}
string vec_to_string(vector<int> v) {
string res = "";
for (int val : v) res.push_back(val == 1 ? '(' : ')');
return res;
}
vector<int> string_to_vec(string s) {
vector<int> res;
for (char ch : s) res.push_back(ch == '(' ? 1 : -1);
return res;
}
void get(string s, int tp) {
if (tp == 0) {
auto a = string_to_poly(s);
int n = isz(a), m = isz(a[0]);
cout << "poly\n" << n << " " << m << "\n";
for (int i = n - 1; i >= 0; --i) {
for (int j = 0; j < m; ++j) cout << a[i][j];
cout << "\n";
}
}
else if (tp == 1) {
// cout << s << " " << tp << endl;
auto a = string_to_perm(s);
cout << "perm" << "\n";
for (int val : a) cout << val << " ";
cout << "\n";
}
else {
auto a = string_to_triang(s);
cout << "triang" << "\n";
for (auto [x, y, z] : a) cout << x << " " << y << " " << z << "\n";
}
}
void xor_1_bracket(string s, int tp) {
auto vec = string_to_vec(s);
auto order = get_order(vec) ^ 1;
auto nvec = get_bracket(order, vec.size());
s = vec_to_string(nvec);
if (order & 1) tp = (tp + 1) % 3;
else tp = (tp + 2) % 3;
get(s, tp);
}
string s;
int N, n, m, q;
// vector<int> a;
vector<array<int, 3>> a;
// vector<vector<char>> a;
void solve() {
memset(dp, -1, sizeof dp);
cin >> N >> q;
cout << N << " " << q << "\n";
while (q--) {
string s; cin >> s;
if (s == "poly") {
cin >> n >> m;
vector<vector<char>> a(n, vector<char>(m));
for (int i = n - 1; i >= 0; --i) for (int j = 0; j < m; ++j) cin >> a[i][j];
// cout << poly_to_string(a) << endl;
xor_1_bracket(poly_to_string(a), 0);
}
else if (s == "perm") {
vector<int> a(N);
for (int &val : a) cin >> val;
xor_1_bracket(perm_to_string(a), 1);
}
else {
vector<array<int, 3>> a(N);
for (auto &[x, y, z] : a) cin >> x >> y >> z;
xor_1_bracket(triang_to_string(a), 2);
}
}
}
signed main() {
#ifndef CDuongg
if(fopen(taskname".inp", "r"))
assert(freopen(taskname".inp", "r", stdin)), assert(freopen(taskname".out", "w", stdout));
#else
freopen("bai3.inp", "r", stdin);
freopen("bai3.out", "w", stdout);
auto start = chrono::high_resolution_clock::now();
#endif
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1; //cin >> t;
while(t--) solve();
#ifdef CDuongg
auto end = chrono::high_resolution_clock::now();
cout << "\n"; for(int i = 1; i <= 100; ++i) cout << '=';
cout << "\nExecution time: " << chrono::duration_cast<chrono::milliseconds> (end - start).count() << "[ms]" << endl;
cout << "Check array size pls sir" << endl;
#endif
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3724kb
input:
5 4 poly 4 2 .# ## ## #. perm 4 1 5 2 3 triang 1 2 4 1 4 5 1 5 7 2 3 4 5 6 7 perm 2 1 3 5 4
output:
5 4 perm 3 4 1 2 5 poly 4 2 ## ## #. #. poly 4 2 .# .# .# ## poly 2 4 #### #...
input:
5 4 perm 3 4 1 2 5 poly 4 2 ## ## #. #. poly 4 2 .# .# .# ## poly 2 4 #### #...
output:
5 4 poly 4 2 .# ## ## #. perm 4 1 5 2 3 triang 1 2 4 1 4 5 1 5 7 2 3 4 5 6 7 perm 2 1 3 5 4
result:
ok good communication process (4 test cases)
Test #2:
score: 100
Accepted
time: 0ms
memory: 3916kb
input:
2 6 poly 2 1 # # poly 1 2 ## perm 2 1 perm 1 2 triang 1 2 3 1 3 4 triang 1 2 4 2 3 4
output:
2 6 triang 1 2 4 2 3 4 perm 2 1 poly 1 2 ## triang 1 2 3 1 3 4 perm 1 2 poly 2 1 # #
input:
2 6 triang 1 2 4 2 3 4 perm 2 1 poly 1 2 ## triang 1 2 3 1 3 4 perm 1 2 poly 2 1 # #
output:
2 6 poly 2 1 # # poly 1 2 ## perm 2 1 perm 1 2 triang 1 2 3 1 3 4 triang 1 2 4 2 3 4
result:
ok good communication process (6 test cases)
Test #3:
score: 100
Accepted
time: 0ms
memory: 3744kb
input:
4 42 poly 3 2 .# .# ## poly 3 2 .# ## #. poly 3 2 ## #. #. poly 2 3 ### #.. poly 2 3 ### ##. poly 2 3 .## ### poly 4 1 # # # # poly 3 2 ## ## #. poly 1 4 #### poly 3 2 ## ## ## poly 3 2 .# ## ## poly 2 3 .## ##. poly 2 3 ..# ### poly 2 3 ### ### perm 1 4 2 3 perm 2 3 4 1 perm 2 4 1 3 perm 2 1 3 4 pe...
output:
4 42 perm 2 1 3 4 perm 2 3 1 4 perm 3 1 4 2 triang 1 2 4 1 4 5 1 5 6 2 3 4 triang 1 2 5 1 5 6 2 3 5 3 4 5 triang 1 2 6 2 3 4 2 4 6 4 5 6 triang 1 2 3 1 3 4 1 4 6 4 5 6 triang 1 2 6 2 3 6 3 4 6 4 5 6 perm 1 2 4 3 perm 4 1 2 3 triang 1 2 3 1 3 6 3 4 5 3 5 6 perm 1 3 4 2 triang 1 2 6 2 3 4 2 4 5 ...
input:
4 42 perm 2 1 3 4 perm 2 3 1 4 perm 3 1 4 2 triang 1 2 4 1 4 5 1 5 6 2 3 4 triang 1 2 5 1 5 6 2 3 5 3 4 5 triang 1 2 6 2 3 4 2 4 6 4 5 6 triang 1 2 3 1 3 4 1 4 6 4 5 6 triang 1 2 6 2 3 6 3 4 6 4 5 6 perm 1 2 4 3 perm 4 1 2 3 triang 1 2 3 1 3 6 3 4 5 3 5 6 perm 1 3 4 2 triang 1 2 6 2 3 4 2 4 5 2 5 6 ...
output:
4 42 poly 3 2 .# .# ## poly 3 2 .# ## #. poly 3 2 ## #. #. poly 2 3 ### #.. poly 2 3 ### ##. poly 2 3 .## ### poly 4 1 # # # # poly 3 2 ## ## #. poly 1 4 #### poly 3 2 ## ## ## poly 3 2 .# ## ## poly 2 3 .## ##. poly 2 3 ..# ### poly 2 3 ### ### perm 1 4 2 3 perm 2 3 4 1 perm 2 4 1 3 perm 2 1 3 4...
result:
ok good communication process (42 test cases)
Test #4:
score: 100
Accepted
time: 1ms
memory: 3748kb
input:
5 126 poly 3 3 .## ##. ##. poly 3 3 ..# .## ##. poly 3 3 ### ### ##. poly 2 4 .### ###. poly 3 3 ..# .## ### poly 4 2 .# .# ## #. poly 2 4 #### #### poly 4 2 .# ## #. #. poly 3 3 ### ##. #.. poly 2 4 #### ##.. poly 4 2 ## ## ## ## poly 4 2 ## #. #. #. poly 3 3 .## .## ### poly 2 4 ..## ###. poly 4 2...
output:
5 126 perm 2 4 1 5 3 perm 1 3 4 2 5 perm 3 4 5 1 2 triang 1 2 6 1 6 7 2 3 4 2 4 6 4 5 6 triang 1 2 4 1 4 7 2 3 4 4 5 6 4 6 7 perm 2 3 1 4 5 perm 2 3 5 1 4 triang 1 2 7 2 3 6 2 6 7 3 4 6 4 5 6 perm 3 1 4 5 2 triang 1 2 5 1 5 6 1 6 7 2 3 5 3 4 5 perm 5 1 2 3 4 triang 1 2 3 1 3 4 1 4 6 1 6 7 4 5...
input:
5 126 perm 2 4 1 5 3 perm 1 3 4 2 5 perm 3 4 5 1 2 triang 1 2 6 1 6 7 2 3 4 2 4 6 4 5 6 triang 1 2 4 1 4 7 2 3 4 4 5 6 4 6 7 perm 2 3 1 4 5 perm 2 3 5 1 4 triang 1 2 7 2 3 6 2 6 7 3 4 6 4 5 6 perm 3 1 4 5 2 triang 1 2 5 1 5 6 1 6 7 2 3 5 3 4 5 perm 5 1 2 3 4 triang 1 2 3 1 3 4 1 4 6 1 6 7 4 5 6 perm...
output:
5 126 poly 3 3 .## ##. ##. poly 3 3 ..# .## ##. poly 3 3 ### ### ##. poly 2 4 .### ###. poly 3 3 ..# .## ### poly 4 2 .# .# ## #. poly 2 4 #### #### poly 4 2 .# ## #. #. poly 3 3 ### ##. #.. poly 2 4 #### ##.. poly 4 2 ## ## ## ## poly 4 2 ## #. #. #. poly 3 3 .## .## ### poly 2 4 ..## ###. poly 4 2...
result:
ok good communication process (126 test cases)
Test #5:
score: 100
Accepted
time: 1ms
memory: 3956kb
input:
6 396 poly 5 2 .# .# .# ## ## poly 3 4 ..## #### ###. poly 3 4 .### .##. ##.. poly 4 3 .## ### ### ### poly 4 3 ..# .## ##. ##. poly 3 4 .### .#.. ##.. poly 2 5 ..### ##### poly 4 3 ..# ### ### #.. poly 3 4 ..## .### ###. poly 2 5 .#### ###.. poly 3 4 ...# #### #### poly 3 4 #### #### ###. poly 4 3 ...
output:
6 396 triang 1 2 3 1 3 5 1 5 6 1 6 8 3 4 5 6 7 8 triang 1 2 8 2 3 8 3 4 5 3 5 6 3 6 8 6 7 8 perm 1 4 2 5 6 3 perm 3 6 1 2 4 5 triang 1 2 8 2 3 7 2 7 8 3 4 5 3 5 7 5 6 7 perm 1 4 2 3 6 5 perm 1 2 4 6 3 5 triang 1 2 3 1 3 8 3 4 6 3 6 7 3 7 8 4 5 6 triang 1 2 8 2 3 4 2 4 8 4 5 6 4 6 8 6 7 8 triang ...
input:
6 396 triang 1 2 3 1 3 5 1 5 6 1 6 8 3 4 5 6 7 8 triang 1 2 8 2 3 8 3 4 5 3 5 6 3 6 8 6 7 8 perm 1 4 2 5 6 3 perm 3 6 1 2 4 5 triang 1 2 8 2 3 7 2 7 8 3 4 5 3 5 7 5 6 7 perm 1 4 2 3 6 5 perm 1 2 4 6 3 5 triang 1 2 3 1 3 8 3 4 6 3 6 7 3 7 8 4 5 6 triang 1 2 8 2 3 4 2 4 8 4 5 6 4 6 8 6 7 8 triang 1 2 ...
output:
6 396 poly 5 2 .# .# .# ## ## poly 3 4 ..## #### ###. poly 3 4 .### .##. ##.. poly 4 3 .## ### ### ### poly 4 3 ..# .## ##. ##. poly 3 4 .### .#.. ##.. poly 2 5 ..### ##### poly 4 3 ..# ### ### #.. poly 3 4 ..## .### ###. poly 2 5 .#### ###.. poly 3 4 ...# #### #### poly 3 4 #### #### ###. poly 4 3 ...
result:
ok good communication process (396 test cases)
Test #6:
score: 100
Accepted
time: 3ms
memory: 3760kb
input:
8 1000 poly 6 3 ..# ..# ### ### ### ### poly 5 4 .### .### .##. ###. ###. poly 5 4 .### #### ###. ###. ##.. poly 5 4 #### #### #### #### ###. poly 4 5 ..### ##### ##### ##### poly 6 3 ### ### ### ### ### ### poly 4 5 .#### ##### ##... ##... poly 5 4 #### ##.. ##.. ##.. ##.. poly 4 5 ....# ##### ####...
output:
8 1000 perm 4 6 1 2 3 5 7 8 perm 2 6 7 1 3 8 4 5 triang 1 2 10 2 3 10 3 4 10 4 5 10 5 6 7 5 7 9 5 9 10 7 8 9 triang 1 2 3 1 3 4 1 4 10 4 5 10 5 6 10 6 7 8 6 8 9 6 9 10 perm 3 4 6 8 1 2 5 7 perm 6 8 1 2 3 4 5 7 perm 3 5 1 2 6 8 4 7 perm 5 6 1 2 3 4 8 7 triang 1 2 3 1 3 10 3 4 7 3 7 8 3 8 9 3 9 ...
input:
8 1000 perm 4 6 1 2 3 5 7 8 perm 2 6 7 1 3 8 4 5 triang 1 2 10 2 3 10 3 4 10 4 5 10 5 6 7 5 7 9 5 9 10 7 8 9 triang 1 2 3 1 3 4 1 4 10 4 5 10 5 6 10 6 7 8 6 8 9 6 9 10 perm 3 4 6 8 1 2 5 7 perm 6 8 1 2 3 4 5 7 perm 3 5 1 2 6 8 4 7 perm 5 6 1 2 3 4 8 7 triang 1 2 3 1 3 10 3 4 7 3 7 8 3 8 9 3 9 10 4 5...
output:
8 1000 poly 6 3 ..# ..# ### ### ### ### poly 5 4 .### .### .##. ###. ###. poly 5 4 .### #### ###. ###. ##.. poly 5 4 #### #### #### #### ###. poly 4 5 ..### ##### ##### ##### poly 6 3 ### ### ### ### ### ### poly 4 5 .#### ##### ##... ##... poly 5 4 #### ##.. ##.. ##.. ##.. poly 4 5 ....# ##### ####...
result:
ok good communication process (1000 test cases)
Test #7:
score: 100
Accepted
time: 1ms
memory: 3756kb
input:
2 1000 triang 1 2 3 1 3 4 perm 1 2 poly 2 1 # # poly 1 2 ## perm 2 1 poly 1 2 ## poly 1 2 ## perm 1 2 perm 2 1 triang 1 2 3 1 3 4 perm 2 1 poly 2 1 # # perm 2 1 perm 2 1 poly 1 2 ## perm 1 2 poly 2 1 # # poly 1 2 ## triang 1 2 4 2 3 4 triang 1 2 4 2 3 4 perm 2 1 poly 2 1 # # triang 1 2 3 1 3 4 poly ...
output:
2 1000 perm 1 2 triang 1 2 3 1 3 4 triang 1 2 4 2 3 4 perm 2 1 poly 1 2 ## perm 2 1 perm 2 1 triang 1 2 3 1 3 4 poly 1 2 ## perm 1 2 poly 1 2 ## triang 1 2 4 2 3 4 poly 1 2 ## poly 1 2 ## perm 2 1 triang 1 2 3 1 3 4 triang 1 2 4 2 3 4 perm 2 1 poly 2 1 # # poly 2 1 # # poly 1 2 ## triang 1 2 ...
input:
2 1000 perm 1 2 triang 1 2 3 1 3 4 triang 1 2 4 2 3 4 perm 2 1 poly 1 2 ## perm 2 1 perm 2 1 triang 1 2 3 1 3 4 poly 1 2 ## perm 1 2 poly 1 2 ## triang 1 2 4 2 3 4 poly 1 2 ## poly 1 2 ## perm 2 1 triang 1 2 3 1 3 4 triang 1 2 4 2 3 4 perm 2 1 poly 2 1 # # poly 2 1 # # poly 1 2 ## triang 1 2 4 2 3 4...
output:
2 1000 triang 1 2 3 1 3 4 perm 1 2 poly 2 1 # # poly 1 2 ## perm 2 1 poly 1 2 ## poly 1 2 ## perm 1 2 perm 2 1 triang 1 2 3 1 3 4 perm 2 1 poly 2 1 # # perm 2 1 perm 2 1 poly 1 2 ## perm 1 2 poly 2 1 # # poly 1 2 ## triang 1 2 4 2 3 4 triang 1 2 4 2 3 4 perm 2 1 poly 2 1 # # triang 1 2 3 1 ...
result:
ok good communication process (1000 test cases)
Test #8:
score: 100
Accepted
time: 2ms
memory: 3912kb
input:
4 1000 perm 3 1 2 4 triang 1 2 6 2 3 6 3 4 6 4 5 6 poly 2 3 .## ### perm 3 1 4 2 perm 1 3 4 2 poly 2 3 ..# ### poly 3 2 ## ## ## poly 2 3 ### #.. perm 1 3 2 4 triang 1 2 3 1 3 4 1 4 6 4 5 6 poly 3 2 .# ## ## poly 4 1 # # # # perm 2 4 1 3 perm 3 4 1 2 triang 1 2 4 1 4 6 2 3 4 4 5 6 perm 1 3 4 2 poly ...
output:
4 1000 triang 1 2 3 1 3 6 3 4 6 4 5 6 poly 3 2 ## ## #. triang 1 2 6 2 3 4 2 4 6 4 5 6 poly 3 2 ## #. #. poly 2 3 .## ##. triang 1 2 6 2 3 4 2 4 5 2 5 6 perm 4 1 2 3 triang 1 2 4 1 4 5 1 5 6 2 3 4 triang 1 2 4 1 4 6 2 3 4 4 5 6 poly 4 1 # # # # triang 1 2 3 1 3 6 3 4 5 3 5 6 triang 1 2 3 1 3 4 1 4 ...
input:
4 1000 triang 1 2 3 1 3 6 3 4 6 4 5 6 poly 3 2 ## ## #. triang 1 2 6 2 3 4 2 4 6 4 5 6 poly 3 2 ## #. #. poly 2 3 .## ##. triang 1 2 6 2 3 4 2 4 5 2 5 6 perm 4 1 2 3 triang 1 2 4 1 4 5 1 5 6 2 3 4 triang 1 2 4 1 4 6 2 3 4 4 5 6 poly 4 1 # # # # triang 1 2 3 1 3 6 3 4 5 3 5 6 triang 1 2 3 1 3 4 1 4 6...
output:
4 1000 perm 3 1 2 4 triang 1 2 6 2 3 6 3 4 6 4 5 6 poly 2 3 .## ### perm 3 1 4 2 perm 1 3 4 2 poly 2 3 ..# ### poly 3 2 ## ## ## poly 2 3 ### #.. perm 1 3 2 4 triang 1 2 3 1 3 4 1 4 6 4 5 6 poly 3 2 .# ## ## poly 4 1 # # # # perm 2 4 1 3 perm 3 4 1 2 triang 1 2 4 1 4 6 2 3 4 4 5 6 perm 1 3 4 2...
result:
ok good communication process (1000 test cases)
Test #9:
score: 100
Accepted
time: 2ms
memory: 3888kb
input:
5 1000 perm 2 3 4 5 1 triang 1 2 3 1 3 6 1 6 7 3 4 5 3 5 6 triang 1 2 7 2 3 4 2 4 5 2 5 6 2 6 7 triang 1 2 3 1 3 6 1 6 7 3 4 6 4 5 6 triang 1 2 7 2 3 4 2 4 5 2 5 6 2 6 7 perm 2 1 4 5 3 perm 3 1 4 2 5 perm 5 1 2 3 4 poly 4 2 .# ## ## #. triang 1 2 3 1 3 7 3 4 7 4 5 7 5 6 7 triang 1 2 4 1 4 7 2 3 4 4 ...
output:
5 1000 triang 1 2 3 1 3 6 1 6 7 3 4 5 3 5 6 perm 2 3 4 5 1 poly 2 4 ...# #### poly 3 3 ### ##. ##. poly 2 4 ...# #### poly 3 3 .## ##. #.. triang 1 2 3 1 3 7 3 4 6 3 6 7 4 5 6 poly 4 2 ## ## ## ## perm 3 4 1 2 5 poly 4 2 ## ## ## #. poly 3 3 ..# .## ### poly 3 3 .## ### #.. poly 4 2 .# ## #. #. po...
input:
5 1000 triang 1 2 3 1 3 6 1 6 7 3 4 5 3 5 6 perm 2 3 4 5 1 poly 2 4 ...# #### poly 3 3 ### ##. ##. poly 2 4 ...# #### poly 3 3 .## ##. #.. triang 1 2 3 1 3 7 3 4 6 3 6 7 4 5 6 poly 4 2 ## ## ## ## perm 3 4 1 2 5 poly 4 2 ## ## ## #. poly 3 3 ..# .## ### poly 3 3 .## ### #.. poly 4 2 .# ## #. #. poly...
output:
5 1000 perm 2 3 4 5 1 triang 1 2 3 1 3 6 1 6 7 3 4 5 3 5 6 triang 1 2 7 2 3 4 2 4 5 2 5 6 2 6 7 triang 1 2 3 1 3 6 1 6 7 3 4 6 4 5 6 triang 1 2 7 2 3 4 2 4 5 2 5 6 2 6 7 perm 2 1 4 5 3 perm 3 1 4 2 5 perm 5 1 2 3 4 poly 4 2 .# ## ## #. triang 1 2 3 1 3 7 3 4 7 4 5 7 5 6 7 triang 1 2 4 1 4 7 2 3 ...
result:
ok good communication process (1000 test cases)
Test #10:
score: 100
Accepted
time: 3ms
memory: 3620kb
input:
6 1000 perm 6 1 2 3 4 5 triang 1 2 3 1 3 5 1 5 8 3 4 5 5 6 8 6 7 8 triang 1 2 5 1 5 6 1 6 8 2 3 4 2 4 5 6 7 8 poly 4 3 ..# .## .#. ##. poly 4 3 .## .## ### #.. triang 1 2 3 1 3 4 1 4 5 1 5 6 1 6 8 6 7 8 poly 3 4 #### ##.. ##.. perm 1 4 2 5 6 3 triang 1 2 3 1 3 7 1 7 8 3 4 6 3 6 7 4 5 6 poly 4 3 ### ...
output:
6 1000 poly 5 2 ## ## ## ## ## perm 2 5 1 3 6 4 poly 4 3 ..# ..# ..# ### triang 1 2 8 2 3 4 2 4 7 2 7 8 4 5 7 5 6 7 perm 2 1 6 3 4 5 poly 6 1 # # # # # # perm 3 4 1 2 6 5 poly 3 4 .### .##. ##.. perm 3 1 4 5 6 2 triang 1 2 3 1 3 8 3 4 8 4 5 7 4 7 8 5 6 7 triang 1 2 3 1 3 4 1 4 8 4 5 6 4 6 8 6 7 ...
input:
6 1000 poly 5 2 ## ## ## ## ## perm 2 5 1 3 6 4 poly 4 3 ..# ..# ..# ### triang 1 2 8 2 3 4 2 4 7 2 7 8 4 5 7 5 6 7 perm 2 1 6 3 4 5 poly 6 1 # # # # # # perm 3 4 1 2 6 5 poly 3 4 .### .##. ##.. perm 3 1 4 5 6 2 triang 1 2 3 1 3 8 3 4 8 4 5 7 4 7 8 5 6 7 triang 1 2 3 1 3 4 1 4 8 4 5 6 4 6 8 6 7 8 pe...
output:
6 1000 perm 6 1 2 3 4 5 triang 1 2 3 1 3 5 1 5 8 3 4 5 5 6 8 6 7 8 triang 1 2 5 1 5 6 1 6 8 2 3 4 2 4 5 6 7 8 poly 4 3 ..# .## .#. ##. poly 4 3 .## .## ### #.. triang 1 2 3 1 3 4 1 4 5 1 5 6 1 6 8 6 7 8 poly 3 4 #### ##.. ##.. perm 1 4 2 5 6 3 triang 1 2 3 1 3 7 1 7 8 3 4 6 3 6 7 4 5 6 poly 4 3 ##...
result:
ok good communication process (1000 test cases)
Test #11:
score: 100
Accepted
time: 4ms
memory: 3760kb
input:
8 1000 triang 1 2 3 1 3 10 3 4 5 3 5 9 3 9 10 5 6 8 5 8 9 6 7 8 triang 1 2 3 1 3 4 1 4 6 1 6 7 1 7 8 1 8 9 1 9 10 4 5 6 poly 4 5 ...## ..##. .###. ###.. perm 3 1 2 6 4 5 7 8 triang 1 2 6 1 6 10 2 3 4 2 4 6 4 5 6 6 7 8 6 8 10 8 9 10 triang 1 2 3 1 3 7 1 7 10 3 4 7 4 5 6 4 6 7 7 8 10 8 9 10 perm 2 5 1...
output:
8 1000 poly 5 4 ...# .### .### ###. ##.. poly 4 5 ##### #.... #.... #.... perm 1 3 5 2 7 4 8 6 triang 1 2 9 1 9 10 2 3 6 2 6 9 3 4 6 4 5 6 6 7 9 7 8 9 perm 1 3 2 5 7 4 6 8 perm 3 4 1 7 2 5 8 6 poly 6 3 ..# ..# ..# .## ### ### triang 1 2 3 1 3 6 1 6 7 1 7 9 1 9 10 3 4 5 3 5 6 7 8 9 poly 3 6 ...###...
input:
8 1000 poly 5 4 ...# .### .### ###. ##.. poly 4 5 ##### #.... #.... #.... perm 1 3 5 2 7 4 8 6 triang 1 2 9 1 9 10 2 3 6 2 6 9 3 4 6 4 5 6 6 7 9 7 8 9 perm 1 3 2 5 7 4 6 8 perm 3 4 1 7 2 5 8 6 poly 6 3 ..# ..# ..# .## ### ### triang 1 2 3 1 3 6 1 6 7 1 7 9 1 9 10 3 4 5 3 5 6 7 8 9 poly 3 6 ...### .#...
output:
8 1000 triang 1 2 3 1 3 10 3 4 5 3 5 9 3 9 10 5 6 8 5 8 9 6 7 8 triang 1 2 3 1 3 4 1 4 6 1 6 7 1 7 8 1 8 9 1 9 10 4 5 6 poly 4 5 ...## ..##. .###. ###.. perm 3 1 2 6 4 5 7 8 triang 1 2 6 1 6 10 2 3 4 2 4 6 4 5 6 6 7 8 6 8 10 8 9 10 triang 1 2 3 1 3 7 1 7 10 3 4 7 4 5 6 4 6 7 7 8 10 8 9 10 perm 2 5 ...
result:
ok good communication process (1000 test cases)
Test #12:
score: 100
Accepted
time: 4ms
memory: 3752kb
input:
9 1000 triang 1 2 8 1 8 11 2 3 8 3 4 6 3 6 7 3 7 8 4 5 6 8 9 10 8 10 11 poly 5 5 ....# ...## .#### ###.. #.... poly 6 4 .### .### .### .##. .##. ##.. perm 3 1 2 5 4 6 7 8 9 poly 6 4 ...# ..## .### #### #### #... poly 3 7 .###### .####.. ##..... perm 4 5 1 7 2 3 8 9 6 perm 2 1 5 3 4 8 6 7 9 poly 5 5 ...
output:
9 1000 poly 5 5 ....# ...## ##### ###.. #.... triang 1 2 8 1 8 11 2 3 5 2 5 8 3 4 5 5 6 7 5 7 8 8 9 10 8 10 11 triang 1 2 4 1 4 11 2 3 4 4 5 11 5 6 11 6 7 11 7 8 10 7 10 11 8 9 10 triang 1 2 10 1 10 11 2 3 6 2 6 8 2 8 9 2 9 10 3 4 6 4 5 6 6 7 8 triang 1 2 3 1 3 6 1 6 8 1 8 11 3 4 6 4 5 6 6 7 8 8 9 1...
input:
9 1000 poly 5 5 ....# ...## ##### ###.. #.... triang 1 2 8 1 8 11 2 3 5 2 5 8 3 4 5 5 6 7 5 7 8 8 9 10 8 10 11 triang 1 2 4 1 4 11 2 3 4 4 5 11 5 6 11 6 7 11 7 8 10 7 10 11 8 9 10 triang 1 2 10 1 10 11 2 3 6 2 6 8 2 8 9 2 9 10 3 4 6 4 5 6 6 7 8 triang 1 2 3 1 3 6 1 6 8 1 8 11 3 4 6 4 5 6 6 7 8 8 9 1...
output:
9 1000 triang 1 2 8 1 8 11 2 3 8 3 4 6 3 6 7 3 7 8 4 5 6 8 9 10 8 10 11 poly 5 5 ....# ...## .#### ###.. #.... poly 6 4 .### .### .### .##. .##. ##.. perm 3 1 2 5 4 6 7 8 9 poly 6 4 ...# ..## .### #### #### #... poly 3 7 .###### .####.. ##..... perm 4 5 1 7 2 3 8 9 6 perm 2 1 5 3 4 8 6 7 9 poly 5...
result:
ok good communication process (1000 test cases)
Test #13:
score: 100
Accepted
time: 4ms
memory: 3764kb
input:
10 1000 perm 5 7 1 2 8 3 4 10 6 9 poly 6 5 ....# ..### .#### ####. ####. #.... poly 4 7 .....## ####### ######. ######. perm 2 1 3 5 4 8 9 10 6 7 triang 1 2 11 1 11 12 2 3 8 2 8 11 3 4 5 3 5 6 3 6 8 6 7 8 8 9 10 8 10 11 perm 1 8 2 3 9 4 10 5 6 7 perm 4 1 7 8 2 9 3 10 5 6 perm 6 1 2 7 3 4 8 10 5 9 tr...
output:
10 1000 poly 6 5 .#### ##### ###.. ###.. ##... ##... perm 3 1 5 7 8 2 9 4 6 10 triang 1 2 12 2 3 12 3 4 12 4 5 6 4 6 7 4 7 8 4 8 9 4 9 10 4 10 12 10 11 12 poly 5 6 ...### ...### ..###. ###... #..... poly 4 7 ...#### ..####. ###.... ###.... poly 7 4 .### .### .### .##. .##. .#.. ##.. triang 1 2 3 1 ...
input:
10 1000 poly 6 5 .#### ##### ###.. ###.. ##... ##... perm 3 1 5 7 8 2 9 4 6 10 triang 1 2 12 2 3 12 3 4 12 4 5 6 4 6 7 4 7 8 4 8 9 4 9 10 4 10 12 10 11 12 poly 5 6 ...### ...### ..###. ###... #..... poly 4 7 ...#### ..####. ###.... ###.... poly 7 4 .### .### .### .##. .##. .#.. ##.. triang 1 2 3 1 3...
output:
10 1000 perm 5 7 1 2 8 3 4 10 6 9 poly 6 5 ....# ..### .#### ####. ####. #.... poly 4 7 .....## ####### ######. ######. perm 2 1 3 5 4 8 9 10 6 7 triang 1 2 11 1 11 12 2 3 8 2 8 11 3 4 5 3 5 6 3 6 8 6 7 8 8 9 10 8 10 11 perm 1 8 2 3 9 4 10 5 6 7 perm 4 1 7 8 2 9 3 10 5 6 perm 6 1 2 7 3 4 8 10 5 ...
result:
ok good communication process (1000 test cases)
Test #14:
score: 100
Accepted
time: 5ms
memory: 3696kb
input:
11 1000 triang 1 2 13 2 3 12 2 12 13 3 4 7 3 7 8 3 8 12 4 5 7 5 6 7 8 9 11 8 11 12 9 10 11 perm 2 1 4 3 6 5 9 10 11 7 8 poly 7 5 ..### ..### .#### .#... ##... #.... #.... triang 1 2 4 1 4 12 1 12 13 2 3 4 4 5 11 4 11 12 5 6 11 6 7 8 6 8 11 8 9 10 8 10 11 perm 4 7 1 8 2 3 10 5 6 9 11 triang 1 2 13 2 ...
output:
11 1000 perm 4 1 2 5 8 3 6 11 7 9 10 poly 6 6 ...### ...### ..###. .##... ##.... #..... triang 1 2 9 1 9 13 2 3 6 2 6 9 3 4 6 4 5 6 6 7 9 7 8 9 9 10 13 10 11 12 10 12 13 perm 1 5 7 8 2 3 4 9 10 11 6 poly 7 5 ....# .#### .#### ##### ###.. ###.. ##... poly 7 5 ..### ..### ####. ###.. ###.. ###.. ###...
input:
11 1000 perm 4 1 2 5 8 3 6 11 7 9 10 poly 6 6 ...### ...### ..###. .##... ##.... #..... triang 1 2 9 1 9 13 2 3 6 2 6 9 3 4 6 4 5 6 6 7 9 7 8 9 9 10 13 10 11 12 10 12 13 perm 1 5 7 8 2 3 4 9 10 11 6 poly 7 5 ....# .#### .#### ##### ###.. ###.. ##... poly 7 5 ..### ..### ####. ###.. ###.. ###.. ###.....
output:
11 1000 triang 1 2 13 2 3 12 2 12 13 3 4 7 3 7 8 3 8 12 4 5 7 5 6 7 8 9 11 8 11 12 9 10 11 perm 2 1 4 3 6 5 9 10 11 7 8 poly 7 5 ..### ..### .#### .#... ##... #.... #.... triang 1 2 4 1 4 12 1 12 13 2 3 4 4 5 11 4 11 12 5 6 11 6 7 8 6 8 11 8 9 10 8 10 11 perm 4 7 1 8 2 3 10 5 6 9 11 triang 1 2 13 ...
result:
ok good communication process (1000 test cases)
Test #15:
score: 100
Accepted
time: 5ms
memory: 3768kb
input:
12 1000 triang 1 2 4 1 4 5 1 5 14 2 3 4 5 6 7 5 7 14 7 8 9 7 9 14 9 10 14 10 11 13 10 13 14 11 12 13 triang 1 2 12 1 12 14 2 3 4 2 4 12 4 5 11 4 11 12 5 6 11 6 7 9 6 9 11 7 8 9 9 10 11 12 13 14 perm 4 5 1 6 2 7 9 10 11 12 3 8 perm 1 2 4 6 7 3 5 9 8 10 12 11 poly 7 6 ...### .####. .####. .####. ####....
output:
12 1000 poly 7 6 ...### ...### ...### ..#### .####. .####. ####.. poly 8 5 ....# ....# ..### .###. .##.. .##.. .##.. ##... poly 5 8 ....#### ######## #######. ###..... ##...... triang 1 2 14 2 3 4 2 4 5 2 5 10 2 10 12 2 12 14 5 6 7 5 7 10 7 8 9 7 9 10 10 11 12 12 13 14 triang 1 2 3 1 3 6 1 6 13 1 13...
input:
12 1000 poly 7 6 ...### ...### ...### ..#### .####. .####. ####.. poly 8 5 ....# ....# ..### .###. .##.. .##.. .##.. ##... poly 5 8 ....#### ######## #######. ###..... ##...... triang 1 2 14 2 3 4 2 4 5 2 5 10 2 10 12 2 12 14 5 6 7 5 7 10 7 8 9 7 9 10 10 11 12 12 13 14 triang 1 2 3 1 3 6 1 6 13 1 13...
output:
12 1000 triang 1 2 4 1 4 5 1 5 14 2 3 4 5 6 7 5 7 14 7 8 9 7 9 14 9 10 14 10 11 13 10 13 14 11 12 13 triang 1 2 12 1 12 14 2 3 4 2 4 12 4 5 11 4 11 12 5 6 11 6 7 9 6 9 11 7 8 9 9 10 11 12 13 14 perm 4 5 1 6 2 7 9 10 11 12 3 8 perm 1 2 4 6 7 3 5 9 8 10 12 11 poly 7 6 ...### .####. .####. .####. ###...
result:
ok good communication process (1000 test cases)
Test #16:
score: 100
Accepted
time: 6ms
memory: 3924kb
input:
13 1000 perm 3 5 8 9 1 2 4 6 7 11 10 13 12 triang 1 2 3 1 3 15 3 4 5 3 5 10 3 10 11 3 11 15 5 6 9 5 9 10 6 7 8 6 8 9 11 12 15 12 13 15 13 14 15 poly 4 10 ......#### .######... #######... #####..... perm 5 1 2 3 6 4 10 7 11 12 8 13 9 poly 6 8 ......## ....#### ....###. .######. #####... ##...... poly...
output:
13 1000 poly 7 7 ....### ..###.. ..##... .###... ####... ####... ####... perm 2 5 6 1 7 3 8 12 4 9 10 11 13 perm 2 4 5 6 7 1 8 10 3 9 11 13 12 triang 1 2 9 1 9 10 1 10 15 2 3 9 3 4 8 3 8 9 4 5 8 5 6 8 6 7 8 10 11 13 10 13 14 10 14 15 11 12 13 triang 1 2 15 2 3 15 3 4 5 3 5 7 3 7 8 3 8 9 3 9 15 5 6...
input:
13 1000 poly 7 7 ....### ..###.. ..##... .###... ####... ####... ####... perm 2 5 6 1 7 3 8 12 4 9 10 11 13 perm 2 4 5 6 7 1 8 10 3 9 11 13 12 triang 1 2 9 1 9 10 1 10 15 2 3 9 3 4 8 3 8 9 4 5 8 5 6 8 6 7 8 10 11 13 10 13 14 10 14 15 11 12 13 triang 1 2 15 2 3 15 3 4 5 3 5 7 3 7 8 3 8 9 3 9 15 5 6 7...
output:
13 1000 perm 3 5 8 9 1 2 4 6 7 11 10 13 12 triang 1 2 3 1 3 15 3 4 5 3 5 10 3 10 11 3 11 15 5 6 9 5 9 10 6 7 8 6 8 9 11 12 15 12 13 15 13 14 15 poly 4 10 ......#### .######... #######... #####..... perm 5 1 2 3 6 4 10 7 11 12 8 13 9 poly 6 8 ......## ....#### ....###. .######. #####... ##...... po...
result:
ok good communication process (1000 test cases)
Test #17:
score: 100
Accepted
time: 6ms
memory: 3680kb
input:
14 1000 perm 5 6 1 8 2 9 3 4 11 13 14 7 10 12 triang 1 2 3 1 3 8 1 8 10 1 10 16 3 4 5 3 5 8 5 6 7 5 7 8 8 9 10 10 11 16 11 12 13 11 13 16 13 14 16 14 15 16 poly 9 6 .....# ....## ....## ..#### ..#### .##### ####.. ####.. #..... triang 1 2 3 1 3 11 1 11 12 1 12 14 1 14 16 3 4 11 4 5 8 4 8 11 5 6 8 6 ...
output:
14 1000 poly 8 7 .....## ....### ..##### ######. ####... ####... ###.... ##..... perm 2 4 5 1 7 10 13 3 6 8 9 14 11 12 triang 1 2 3 1 3 6 1 6 12 1 12 13 1 13 16 3 4 6 4 5 6 6 7 8 6 8 12 8 9 12 9 10 11 9 11 12 13 14 15 13 15 16 poly 10 5 ....# ....# ...## ...## .#### ##### ###.. ###.. #.... #.... po...
input:
14 1000 poly 8 7 .....## ....### ..##### ######. ####... ####... ###.... ##..... perm 2 4 5 1 7 10 13 3 6 8 9 14 11 12 triang 1 2 3 1 3 6 1 6 12 1 12 13 1 13 16 3 4 6 4 5 6 6 7 8 6 8 12 8 9 12 9 10 11 9 11 12 13 14 15 13 15 16 poly 10 5 ....# ....# ...## ...## .#### ##### ###.. ###.. #.... #.... pol...
output:
14 1000 perm 5 6 1 8 2 9 3 4 11 13 14 7 10 12 triang 1 2 3 1 3 8 1 8 10 1 10 16 3 4 5 3 5 8 5 6 7 5 7 8 8 9 10 10 11 16 11 12 13 11 13 16 13 14 16 14 15 16 poly 9 6 .....# ....## ....## ..#### ..#### .##### ####.. ####.. #..... triang 1 2 3 1 3 11 1 11 12 1 12 14 1 14 16 3 4 11 4 5 8 4 8 11 5 6 8 6...
result:
ok good communication process (1000 test cases)
Test #18:
score: 100
Accepted
time: 7ms
memory: 3764kb
input:
16 1000 poly 9 8 ....#### ....#### ....##.. ....#... ..###... .####... .####... ####.... ##...... poly 7 10 .........# .......### ......#### ..#####... ..###..... .####..... ##........ poly 9 8 .......# .####### .####### ######## #####... ####.... ####.... ####.... #....... triang 1 2 18 2 3 18 3 4 ...
output:
16 1000 perm 2 5 1 7 8 3 13 4 6 9 10 14 11 16 12 15 triang 1 2 14 1 14 18 2 3 4 2 4 6 2 6 11 2 11 12 2 12 14 4 5 6 6 7 11 7 8 9 7 9 10 7 10 11 12 13 14 14 15 16 14 16 17 14 17 18 perm 6 1 9 10 11 2 3 4 12 5 13 15 7 8 14 16 perm 6 1 7 8 2 10 11 3 14 4 5 9 16 12 13 15 triang 1 2 18 2 3 4 2 4 18 4 5...
input:
16 1000 perm 2 5 1 7 8 3 13 4 6 9 10 14 11 16 12 15 triang 1 2 14 1 14 18 2 3 4 2 4 6 2 6 11 2 11 12 2 12 14 4 5 6 6 7 11 7 8 9 7 9 10 7 10 11 12 13 14 14 15 16 14 16 17 14 17 18 perm 6 1 9 10 11 2 3 4 12 5 13 15 7 8 14 16 perm 6 1 7 8 2 10 11 3 14 4 5 9 16 12 13 15 triang 1 2 18 2 3 4 2 4 18 4 5 6 ...
output:
16 1000 poly 9 8 ....#### ....#### ....##.. ....#... ..###... .####... .####... ####.... ##...... poly 7 10 .........# .......### ......#### ..#####... ..###..... .####..... ##........ poly 9 8 .......# .####### .####### ######## #####... ####.... ####.... ####.... #....... triang 1 2 18 2 3 18 3 4 ...
result:
ok good communication process (1000 test cases)
Test #19:
score: 100
Accepted
time: 8ms
memory: 3760kb
input:
17 1000 perm 2 1 3 6 4 10 11 5 12 15 7 8 9 13 14 17 16 triang 1 2 5 1 5 19 2 3 5 3 4 5 5 6 7 5 7 8 5 8 18 5 18 19 8 9 11 8 11 18 9 10 11 11 12 14 11 14 15 11 15 16 11 16 18 12 13 14 16 17 18 triang 1 2 3 1 3 18 1 18 19 3 4 16 3 16 18 4 5 6 4 6 9 4 9 10 4 10 11 4 11 16 6 7 9 7 8 9 11 12 14 11 14 15 1...
output:
17 1000 poly 9 9 ......### ......#.. ...####.. ...####.. ...####.. ..#####.. ..###.... ###...... #........ perm 2 1 4 5 8 3 11 6 12 13 15 7 9 10 16 14 17 perm 3 6 1 2 7 8 11 4 12 13 5 9 15 10 16 17 14 perm 6 8 9 1 10 2 11 12 3 13 16 17 4 5 7 14 15 poly 9 9 ......### .....#### .....###. ....##... ...
input:
17 1000 poly 9 9 ......### ......#.. ...####.. ...####.. ...####.. ..#####.. ..###.... ###...... #........ perm 2 1 4 5 8 3 11 6 12 13 15 7 9 10 16 14 17 perm 3 6 1 2 7 8 11 4 12 13 5 9 15 10 16 17 14 perm 6 8 9 1 10 2 11 12 3 13 16 17 4 5 7 14 15 poly 9 9 ......### .....#### .....###. ....##... ......
output:
17 1000 perm 2 1 3 6 4 10 11 5 12 15 7 8 9 13 14 17 16 triang 1 2 5 1 5 19 2 3 5 3 4 5 5 6 7 5 7 8 5 8 18 5 18 19 8 9 11 8 11 18 9 10 11 11 12 14 11 14 15 11 15 16 11 16 18 12 13 14 16 17 18 triang 1 2 3 1 3 18 1 18 19 3 4 16 3 16 18 4 5 6 4 6 9 4 9 10 4 10 11 4 11 16 6 7 9 7 8 9 11 12 14 11 14 15 ...
result:
ok good communication process (1000 test cases)
Test #20:
score: 100
Accepted
time: 8ms
memory: 3796kb
input:
18 1000 triang 1 2 17 1 17 19 1 19 20 2 3 4 2 4 11 2 11 13 2 13 17 4 5 6 4 6 9 4 9 10 4 10 11 6 7 9 7 8 9 11 12 13 13 14 15 13 15 16 13 16 17 17 18 19 poly 10 9 ......### ......### ....####. ....####. #####.... ###...... ##....... #........ #........ #........ triang 1 2 3 1 3 11 1 11 20 3 4 5 3 5 1...
output:
18 1000 perm 1 3 6 2 4 7 8 5 10 9 12 13 14 11 16 17 18 15 triang 1 2 20 2 3 11 2 11 12 2 12 20 3 4 10 3 10 11 4 5 9 4 9 10 5 6 9 6 7 9 7 8 9 12 13 15 12 15 16 12 16 20 13 14 15 16 17 20 17 18 19 17 19 20 perm 2 4 7 1 3 5 8 13 6 9 15 10 17 11 12 14 18 16 triang 1 2 20 2 3 4 2 4 5 2 5 6 2 6 7 2 7 8 ...
input:
18 1000 perm 1 3 6 2 4 7 8 5 10 9 12 13 14 11 16 17 18 15 triang 1 2 20 2 3 11 2 11 12 2 12 20 3 4 10 3 10 11 4 5 9 4 9 10 5 6 9 6 7 9 7 8 9 12 13 15 12 15 16 12 16 20 13 14 15 16 17 20 17 18 19 17 19 20 perm 2 4 7 1 3 5 8 13 6 9 15 10 17 11 12 14 18 16 triang 1 2 20 2 3 4 2 4 5 2 5 6 2 6 7 2 7 8 2 ...
output:
18 1000 triang 1 2 17 1 17 19 1 19 20 2 3 4 2 4 11 2 11 13 2 13 17 4 5 6 4 6 9 4 9 10 4 10 11 6 7 9 7 8 9 11 12 13 13 14 15 13 15 16 13 16 17 17 18 19 poly 10 9 ......### ......### ....####. ....####. #####.... ###...... ##....... #........ #........ #........ triang 1 2 3 1 3 11 1 11 20 3 4 5 3 5 1...
result:
ok good communication process (1000 test cases)
Test #21:
score: 100
Accepted
time: 8ms
memory: 3980kb
input:
19 1000 poly 12 8 .......# .......# ......## ....###. ....###. .####... .###.... ####.... ##...... ##...... ##...... ##...... poly 10 10 ........## ........#. .......##. .......#.. ...#####.. ..####.... .####..... .##....... ###....... ###....... poly 9 11 .........## ....####### ...######## ...####...
output:
19 1000 perm 5 8 1 2 3 4 9 10 6 7 13 11 14 16 12 17 15 18 19 triang 1 2 18 1 18 20 1 20 21 2 3 14 2 14 15 2 15 18 3 4 5 3 5 10 3 10 13 3 13 14 5 6 10 6 7 8 6 8 10 8 9 10 10 11 12 10 12 13 15 16 18 16 17 18 18 19 20 perm 1 6 7 2 10 3 12 4 13 14 5 8 15 9 16 19 11 17 18 perm 2 3 4 5 1 9 11 6 7 13 14 ...
input:
19 1000 perm 5 8 1 2 3 4 9 10 6 7 13 11 14 16 12 17 15 18 19 triang 1 2 18 1 18 20 1 20 21 2 3 14 2 14 15 2 15 18 3 4 5 3 5 10 3 10 13 3 13 14 5 6 10 6 7 8 6 8 10 8 9 10 10 11 12 10 12 13 15 16 18 16 17 18 18 19 20 perm 1 6 7 2 10 3 12 4 13 14 5 8 15 9 16 19 11 17 18 perm 2 3 4 5 1 9 11 6 7 13 14 8 ...
output:
19 1000 poly 12 8 .......# .......# ......## ....###. ....###. .####... .###.... ####.... ##...... ##...... ##...... ##...... poly 10 10 ........## ........#. .......##. .......#.. ...#####.. ..####.... .####..... .##....... ###....... ###....... poly 9 11 .........## ....####### ...######## ...####...
result:
ok good communication process (1000 test cases)
Test #22:
score: 100
Accepted
time: 9ms
memory: 3768kb
input:
20 1000 triang 1 2 3 1 3 21 1 21 22 3 4 17 3 17 18 3 18 19 3 19 20 3 20 21 4 5 10 4 10 11 4 11 17 5 6 10 6 7 9 6 9 10 7 8 9 11 12 13 11 13 16 11 16 17 13 14 15 13 15 16 triang 1 2 4 1 4 5 1 5 14 1 14 21 1 21 22 2 3 4 5 6 13 5 13 14 6 7 10 6 10 11 6 11 13 7 8 9 7 9 10 11 12 13 14 15 16 14 16 21 16 17...
output:
20 1000 perm 6 1 7 2 3 8 10 12 13 4 14 5 9 15 16 17 18 19 20 11 perm 1 6 7 2 8 10 3 4 11 13 15 18 5 9 12 19 20 14 16 17 triang 1 2 4 1 4 5 1 5 22 2 3 4 5 6 22 6 7 9 6 9 10 6 10 14 6 14 18 6 18 19 6 19 22 7 8 9 10 11 13 10 13 14 11 12 13 14 15 18 15 16 17 15 17 18 19 20 22 20 21 22 poly 12 9 .........
input:
20 1000 perm 6 1 7 2 3 8 10 12 13 4 14 5 9 15 16 17 18 19 20 11 perm 1 6 7 2 8 10 3 4 11 13 15 18 5 9 12 19 20 14 16 17 triang 1 2 4 1 4 5 1 5 22 2 3 4 5 6 22 6 7 9 6 9 10 6 10 14 6 14 18 6 18 19 6 19 22 7 8 9 10 11 13 10 13 14 11 12 13 14 15 18 15 16 17 15 17 18 19 20 22 20 21 22 poly 12 9 .......#...
output:
20 1000 triang 1 2 3 1 3 21 1 21 22 3 4 17 3 17 18 3 18 19 3 19 20 3 20 21 4 5 10 4 10 11 4 11 17 5 6 10 6 7 9 6 9 10 7 8 9 11 12 13 11 13 16 11 16 17 13 14 15 13 15 16 triang 1 2 4 1 4 5 1 5 14 1 14 21 1 21 22 2 3 4 5 6 13 5 13 14 6 7 10 6 10 11 6 11 13 7 8 9 7 9 10 11 12 13 14 15 16 14 16 21 16 17...
result:
ok good communication process (1000 test cases)
Test #23:
score: 100
Accepted
time: 9ms
memory: 3972kb
input:
21 1000 perm 2 5 1 3 6 4 12 7 16 8 9 10 11 13 18 14 15 19 17 21 20 triang 1 2 3 1 3 21 1 21 22 1 22 23 3 4 5 3 5 7 3 7 8 3 8 16 3 16 17 3 17 21 5 6 7 8 9 16 9 10 16 10 11 13 10 13 15 10 15 16 11 12 13 13 14 15 17 18 19 17 19 21 19 20 21 perm 6 1 7 9 10 2 11 3 13 16 4 5 8 17 19 12 20 14 15 18 21 tria...
output:
21 1000 triang 1 2 23 2 3 9 2 9 23 3 4 5 3 5 8 3 8 9 5 6 8 6 7 8 9 10 21 9 21 22 9 22 23 10 11 19 10 19 21 11 12 19 12 13 15 12 15 19 13 14 15 15 16 19 16 17 19 17 18 19 19 20 21 perm 2 4 1 5 10 3 12 6 13 7 8 9 14 16 18 11 15 20 21 17 19 triang 1 2 3 1 3 23 3 4 23 4 5 23 5 6 14 5 14 19 5 19 20 5 20...
input:
21 1000 triang 1 2 23 2 3 9 2 9 23 3 4 5 3 5 8 3 8 9 5 6 8 6 7 8 9 10 21 9 21 22 9 22 23 10 11 19 10 19 21 11 12 19 12 13 15 12 15 19 13 14 15 15 16 19 16 17 19 17 18 19 19 20 21 perm 2 4 1 5 10 3 12 6 13 7 8 9 14 16 18 11 15 20 21 17 19 triang 1 2 3 1 3 23 3 4 23 4 5 23 5 6 14 5 14 19 5 19 20 5 20 ...
output:
21 1000 perm 2 5 1 3 6 4 12 7 16 8 9 10 11 13 18 14 15 19 17 21 20 triang 1 2 3 1 3 21 1 21 22 1 22 23 3 4 5 3 5 7 3 7 8 3 8 16 3 16 17 3 17 21 5 6 7 8 9 16 9 10 16 10 11 13 10 13 15 10 15 16 11 12 13 13 14 15 17 18 19 17 19 21 19 20 21 perm 6 1 7 9 10 2 11 3 13 16 4 5 8 17 19 12 20 14 15 18 21 tr...
result:
ok good communication process (1000 test cases)
Test #24:
score: 100
Accepted
time: 10ms
memory: 3748kb
input:
22 1000 poly 11 12 .........### .......##### .....######. .....#####.. .....###.... .....##..... ...###...... ..####...... .####....... .####....... ###......... perm 1 7 2 9 3 4 10 12 14 17 5 6 19 8 11 13 20 21 15 16 18 22 perm 2 4 5 10 1 13 3 6 14 7 16 8 18 9 19 11 12 21 15 17 22 20 poly 11 12 ......
output:
22 1000 perm 1 4 6 2 8 9 3 5 14 7 10 15 11 17 12 18 20 13 21 22 16 19 triang 1 2 4 1 4 24 2 3 4 4 5 24 5 6 24 6 7 12 6 12 13 6 13 22 6 22 23 6 23 24 7 8 10 7 10 12 8 9 10 10 11 12 13 14 15 13 15 22 15 16 17 15 17 20 15 20 22 17 18 20 18 19 20 20 21 22 triang 1 2 3 1 3 5 1 5 24 3 4 5 5 6 7 5 7 8 5 8...
input:
22 1000 perm 1 4 6 2 8 9 3 5 14 7 10 15 11 17 12 18 20 13 21 22 16 19 triang 1 2 4 1 4 24 2 3 4 4 5 24 5 6 24 6 7 12 6 12 13 6 13 22 6 22 23 6 23 24 7 8 10 7 10 12 8 9 10 10 11 12 13 14 15 13 15 22 15 16 17 15 17 20 15 20 22 17 18 20 18 19 20 20 21 22 triang 1 2 3 1 3 5 1 5 24 3 4 5 5 6 7 5 7 8 5 8 ...
output:
22 1000 poly 11 12 .........### .......##### .....######. .....#####.. .....###.... .....##..... ...###...... ..####...... .####....... .####....... ###......... perm 1 7 2 9 3 4 10 12 14 17 5 6 19 8 11 13 20 21 15 16 18 22 perm 2 4 5 10 1 13 3 6 14 7 16 8 18 9 19 11 12 21 15 17 22 20 poly 11 12 ....
result:
ok good communication process (1000 test cases)
Test #25:
score: 100
Accepted
time: 10ms
memory: 3756kb
input:
23 1000 triang 1 2 3 1 3 25 3 4 10 3 10 11 3 11 14 3 14 15 3 15 16 3 16 19 3 19 21 3 21 25 4 5 7 4 7 8 4 8 10 5 6 7 8 9 10 11 12 14 12 13 14 16 17 19 17 18 19 19 20 21 21 22 23 21 23 24 21 24 25 poly 16 8 ....#### ....#### ....#### ....#### ....#### ....#### ....#### ....#### ....#### ...####. .####...
output:
23 1000 perm 4 1 5 7 2 3 8 11 6 9 12 13 16 10 14 18 15 20 21 22 17 19 23 perm 4 1 7 8 2 3 10 5 20 6 21 22 9 23 11 12 13 14 15 16 17 18 19 poly 14 10 .......### ....###### ....#####. ....#####. ....#####. ....####.. ...##..... ...#...... ..##...... ..##...... ..##...... .###...... .###...... ###......
input:
23 1000 perm 4 1 5 7 2 3 8 11 6 9 12 13 16 10 14 18 15 20 21 22 17 19 23 perm 4 1 7 8 2 3 10 5 20 6 21 22 9 23 11 12 13 14 15 16 17 18 19 poly 14 10 .......### ....###### ....#####. ....#####. ....#####. ....####.. ...##..... ...#...... ..##...... ..##...... ..##...... .###...... .###...... ###........
output:
23 1000 triang 1 2 3 1 3 25 3 4 10 3 10 11 3 11 14 3 14 15 3 15 16 3 16 19 3 19 21 3 21 25 4 5 7 4 7 8 4 8 10 5 6 7 8 9 10 11 12 14 12 13 14 16 17 19 17 18 19 19 20 21 21 22 23 21 23 24 21 24 25 poly 16 8 ....#### ....#### ....#### ....#### ....#### ....#### ....#### ....#### ....#### ...####. .####...
result:
ok good communication process (1000 test cases)
Test #26:
score: 100
Accepted
time: 11ms
memory: 3776kb
input:
24 1000 triang 1 2 3 1 3 11 1 11 17 1 17 18 1 18 19 1 19 21 1 21 26 3 4 11 4 5 6 4 6 7 4 7 11 7 8 9 7 9 10 7 10 11 11 12 13 11 13 15 11 15 17 13 14 15 15 16 17 19 20 21 21 22 24 21 24 25 21 25 26 22 23 24 triang 1 2 3 1 3 9 1 9 26 3 4 5 3 5 9 5 6 9 6 7 9 7 8 9 9 10 26 10 11 12 10 12 15 10 15 17 10 1...
output:
24 1000 poly 13 12 ...........# .........### .........### ........#### ........#### ........#### .......##### ......###### .....#####.. ..######.... #######..... #####....... #####....... perm 2 6 1 3 4 9 11 12 5 14 7 16 19 20 22 8 10 23 13 15 17 18 24 21 perm 4 7 1 2 9 3 10 11 5 6 13 14 15 16 17 8...
input:
24 1000 poly 13 12 ...........# .........### .........### ........#### ........#### ........#### .......##### ......###### .....#####.. ..######.... #######..... #####....... #####....... perm 2 6 1 3 4 9 11 12 5 14 7 16 19 20 22 8 10 23 13 15 17 18 24 21 perm 4 7 1 2 9 3 10 11 5 6 13 14 15 16 17 8 ...
output:
24 1000 triang 1 2 3 1 3 11 1 11 17 1 17 18 1 18 19 1 19 21 1 21 26 3 4 11 4 5 6 4 6 7 4 7 11 7 8 9 7 9 10 7 10 11 11 12 13 11 13 15 11 15 17 13 14 15 15 16 17 19 20 21 21 22 24 21 24 25 21 25 26 22 23 24 triang 1 2 3 1 3 9 1 9 26 3 4 5 3 5 9 5 6 9 6 7 9 7 8 9 9 10 26 10 11 12 10 12 15 10 15 17 10 1...
result:
ok good communication process (1000 test cases)
Test #27:
score: 100
Accepted
time: 11ms
memory: 3980kb
input:
25 1000 poly 16 10 .........# ........## ......#### .....##### ....###### ...####### ...####### ...######. ...######. ..####.... ..####.... ..###..... ..###..... ####...... ###....... ##........ triang 1 2 6 1 6 7 1 7 8 1 8 11 1 11 13 1 13 14 1 14 18 1 18 19 1 19 25 1 25 27 2 3 4 2 4 5 2 5 6 8 9 11 ...
output:
25 1000 triang 1 2 3 1 3 7 1 7 8 1 8 9 1 9 12 1 12 27 3 4 7 4 5 6 4 6 7 9 10 12 10 11 12 12 13 21 12 21 26 12 26 27 13 14 19 13 19 21 14 15 17 14 17 19 15 16 17 17 18 19 19 20 21 21 22 23 21 23 24 21 24 26 24 25 26 perm 1 2 3 8 4 10 14 15 5 20 21 6 7 22 24 9 25 11 12 13 16 17 18 19 23 poly 16 10 .....
input:
25 1000 triang 1 2 3 1 3 7 1 7 8 1 8 9 1 9 12 1 12 27 3 4 7 4 5 6 4 6 7 9 10 12 10 11 12 12 13 21 12 21 26 12 26 27 13 14 19 13 19 21 14 15 17 14 17 19 15 16 17 17 18 19 19 20 21 21 22 23 21 23 24 21 24 26 24 25 26 perm 1 2 3 8 4 10 14 15 5 20 21 6 7 22 24 9 25 11 12 13 16 17 18 19 23 poly 16 10 ......
output:
25 1000 poly 16 10 .........# ........## ......#### .....##### ....###### ...####### ...####### ...######. ...######. ..####.... ..####.... ..###..... ..###..... ####...... ###....... ##........ triang 1 2 6 1 6 7 1 7 8 1 8 11 1 11 13 1 13 14 1 14 18 1 18 19 1 19 25 1 25 27 2 3 4 2 4 5 2 5 6 8 9 11 ...
result:
ok good communication process (1000 test cases)
Test #28:
score: 100
Accepted
time: 11ms
memory: 3976kb
input:
26 1000 triang 1 2 28 2 3 5 2 5 6 2 6 28 3 4 5 6 7 8 6 8 10 6 10 28 8 9 10 10 11 22 10 22 25 10 25 27 10 27 28 11 12 13 11 13 15 11 15 22 13 14 15 15 16 21 15 21 22 16 17 20 16 20 21 17 18 19 17 19 20 22 23 25 23 24 25 25 26 27 poly 14 13 ..........### .........#### ......####### ......######. ....#...
output:
26 1000 perm 2 1 3 5 7 4 10 12 6 16 17 8 18 9 19 11 13 22 14 15 24 20 21 26 23 25 perm 3 1 2 9 10 12 4 5 14 6 15 7 8 18 19 11 20 22 13 24 16 25 26 17 21 23 triang 1 2 4 1 4 14 1 14 26 1 26 27 1 27 28 2 3 4 4 5 13 4 13 14 5 6 7 5 7 9 5 9 12 5 12 13 7 8 9 9 10 12 10 11 12 14 15 26 15 16 17 15 17 21 ...
input:
26 1000 perm 2 1 3 5 7 4 10 12 6 16 17 8 18 9 19 11 13 22 14 15 24 20 21 26 23 25 perm 3 1 2 9 10 12 4 5 14 6 15 7 8 18 19 11 20 22 13 24 16 25 26 17 21 23 triang 1 2 4 1 4 14 1 14 26 1 26 27 1 27 28 2 3 4 4 5 13 4 13 14 5 6 7 5 7 9 5 9 12 5 12 13 7 8 9 9 10 12 10 11 12 14 15 26 15 16 17 15 17 21 15...
output:
26 1000 triang 1 2 28 2 3 5 2 5 6 2 6 28 3 4 5 6 7 8 6 8 10 6 10 28 8 9 10 10 11 22 10 22 25 10 25 27 10 27 28 11 12 13 11 13 15 11 15 22 13 14 15 15 16 21 15 21 22 16 17 20 16 20 21 17 18 19 17 19 20 22 23 25 23 24 25 25 26 27 poly 14 13 ..........### .........#### ......####### ......######. ....#...
result:
ok good communication process (1000 test cases)
Test #29:
score: 100
Accepted
time: 12ms
memory: 3972kb
input:
27 1000 perm 2 4 7 1 10 14 15 3 5 6 8 9 11 18 20 23 24 12 25 13 16 17 19 21 27 22 26 poly 13 15 .............## .............## ...........###. ...........###. ...........##.. .......######.. .......######.. .......####.... ......#####.... ..#########.... ..#########.... .#######....... #####..........
output:
27 1000 poly 15 13 ........##### ........##### .......####.. ......#####.. ......#####.. ....#######.. ....#######.. ....######... ...###....... ...###....... ..####....... ..####....... .#####....... ######....... ###.......... perm 1 3 6 7 8 2 9 11 15 4 16 17 18 5 10 12 13 22 23 14 19 20 26 21 27 ...
input:
27 1000 poly 15 13 ........##### ........##### .......####.. ......#####.. ......#####.. ....#######.. ....#######.. ....######... ...###....... ...###....... ..####....... ..####....... .#####....... ######....... ###.......... perm 1 3 6 7 8 2 9 11 15 4 16 17 18 5 10 12 13 22 23 14 19 20 26 21 27 ...
output:
27 1000 perm 2 4 7 1 10 14 15 3 5 6 8 9 11 18 20 23 24 12 25 13 16 17 19 21 27 22 26 poly 13 15 .............## .............## ...........###. ...........###. ...........##.. .......######.. .......######.. .......####.... ......#####.... ..#########.... ..#########.... .#######....... #####.........
result:
ok good communication process (1000 test cases)
Test #30:
score: 100
Accepted
time: 13ms
memory: 3940kb
input:
28 1000 poly 13 16 ............#### ........######.. ......#######... ......#######... ....#########... ....#######..... ....#######..... ....#####....... ....##.......... ..####.......... ..###........... .####........... ####............ triang 1 2 3 1 3 6 1 6 7 1 7 9 1 9 10 1 10 11 1 11 15 1 15 3...
output:
28 1000 triang 1 2 28 1 28 29 1 29 30 2 3 4 2 4 28 4 5 6 4 6 28 6 7 10 6 10 28 7 8 9 7 9 10 10 11 17 10 17 25 10 25 26 10 26 28 11 12 17 12 13 16 12 16 17 13 14 16 14 15 16 17 18 25 18 19 20 18 20 21 18 21 23 18 23 24 18 24 25 21 22 23 26 27 28 perm 3 1 6 12 2 4 19 20 21 5 7 8 22 24 25 9 10 27 11 13...
input:
28 1000 triang 1 2 28 1 28 29 1 29 30 2 3 4 2 4 28 4 5 6 4 6 28 6 7 10 6 10 28 7 8 9 7 9 10 10 11 17 10 17 25 10 25 26 10 26 28 11 12 17 12 13 16 12 16 17 13 14 16 14 15 16 17 18 25 18 19 20 18 20 21 18 21 23 18 23 24 18 24 25 21 22 23 26 27 28 perm 3 1 6 12 2 4 19 20 21 5 7 8 22 24 25 9 10 27 11 13...
output:
28 1000 poly 13 16 ............#### ........######.. ......#######... ......#######... ....#########... ....#######..... ....#######..... ....#####....... ....##.......... ..####.......... ..###........... .####........... ####............ triang 1 2 3 1 3 6 1 6 7 1 7 9 1 9 10 1 10 11 1 11 15 1 15 3...
result:
ok good communication process (1000 test cases)
Test #31:
score: 100
Accepted
time: 13ms
memory: 3944kb
input:
29 1000 perm 1 4 2 3 5 6 8 13 7 9 18 20 10 23 11 12 14 15 16 17 19 21 24 26 22 27 28 25 29 poly 11 19 ................### .............####.. ......########..... .....########...... ....########....... ..##########....... ..########......... .#######........... .######............ ######...............
output:
29 1000 poly 17 13 ............# ..........### ........####. ........###.. .......##.... ......###.... ......###.... ......###.... ......###.... .....####.... .....####.... .....####.... .....###..... ....##....... .#####....... .#........... ##........... triang 1 2 29 1 29 30 1 30 31 2 3 24 2 24 2...
input:
29 1000 poly 17 13 ............# ..........### ........####. ........###.. .......##.... ......###.... ......###.... ......###.... ......###.... .....####.... .....####.... .....####.... .....###..... ....##....... .#####....... .#........... ##........... triang 1 2 29 1 29 30 1 30 31 2 3 24 2 24 2...
output:
29 1000 perm 1 4 2 3 5 6 8 13 7 9 18 20 10 23 11 12 14 15 16 17 19 21 24 26 22 27 28 25 29 poly 11 19 ................### .............####.. ......########..... .....########...... ....########....... ..##########....... ..########......... .#######........... .######............ ######..............
result:
ok good communication process (1000 test cases)
Test #32:
score: 100
Accepted
time: 13ms
memory: 3908kb
input:
30 1000 perm 3 5 6 10 11 12 1 2 14 4 7 16 8 19 24 9 13 15 25 26 17 18 27 28 29 20 21 22 30 23 poly 11 20 ................#### ...............##... ........#########... ........#######..... .......######....... .....#######........ .....#####.......... .....####........... .....##............. .#####...
output:
30 1000 poly 15 16 .........####### .........######. .........######. .........######. ........#######. ........####.... .......#####.... ......####...... ...#######...... ...#######...... ...#####........ .######......... #######......... ######.......... ######.......... perm 1 3 4 5 6 2 11 12 7 8...
input:
30 1000 poly 15 16 .........####### .........######. .........######. .........######. ........#######. ........####.... .......#####.... ......####...... ...#######...... ...#######...... ...#####........ .######......... #######......... ######.......... ######.......... perm 1 3 4 5 6 2 11 12 7 8...
output:
30 1000 perm 3 5 6 10 11 12 1 2 14 4 7 16 8 19 24 9 13 15 25 26 17 18 27 28 29 20 21 22 30 23 poly 11 20 ................#### ...............##... ........#########... ........#######..... .......######....... .....#######........ .....#####.......... .....####........... .....##............. .####...
result:
ok good communication process (1000 test cases)
Test #33:
score: 100
Accepted
time: 15ms
memory: 3776kb
input:
32 1000 perm 1 6 2 7 3 4 8 11 12 13 15 16 19 20 21 5 23 9 10 24 14 25 26 28 30 17 31 32 18 22 27 29 triang 1 2 29 1 29 34 2 3 13 2 13 14 2 14 15 2 15 18 2 18 19 2 19 22 2 22 24 2 24 29 3 4 13 4 5 10 4 10 11 4 11 12 4 12 13 5 6 7 5 7 9 5 9 10 7 8 9 15 16 17 15 17 18 19 20 22 20 21 22 22 23 24 24 25 2...
output:
32 1000 triang 1 2 4 1 4 11 1 11 12 1 12 29 1 29 33 1 33 34 2 3 4 4 5 10 4 10 11 5 6 10 6 7 9 6 9 10 7 8 9 12 13 14 12 14 15 12 15 16 12 16 27 12 27 28 12 28 29 16 17 18 16 18 19 16 19 26 16 26 27 19 20 24 19 24 26 20 21 22 20 22 23 20 23 24 24 25 26 29 30 31 29 31 33 31 32 33 perm 4 6 1 7 2 8 9 10 ...
input:
32 1000 triang 1 2 4 1 4 11 1 11 12 1 12 29 1 29 33 1 33 34 2 3 4 4 5 10 4 10 11 5 6 10 6 7 9 6 9 10 7 8 9 12 13 14 12 14 15 12 15 16 12 16 27 12 27 28 12 28 29 16 17 18 16 18 19 16 19 26 16 26 27 19 20 24 19 24 26 20 21 22 20 22 23 20 23 24 24 25 26 29 30 31 29 31 33 31 32 33 perm 4 6 1 7 2 8 9 10 ...
output:
32 1000 perm 1 6 2 7 3 4 8 11 12 13 15 16 19 20 21 5 23 9 10 24 14 25 26 28 30 17 31 32 18 22 27 29 triang 1 2 29 1 29 34 2 3 13 2 13 14 2 14 15 2 15 18 2 18 19 2 19 22 2 22 24 2 24 29 3 4 13 4 5 10 4 10 11 4 11 12 4 12 13 5 6 7 5 7 9 5 9 10 7 8 9 15 16 17 15 17 18 19 20 22 20 21 22 22 23 24 24 25 ...
result:
ok good communication process (1000 test cases)
Test #34:
score: 100
Accepted
time: 15ms
memory: 3764kb
input:
33 1000 triang 1 2 28 1 28 35 2 3 28 3 4 5 3 5 23 3 23 24 3 24 28 5 6 7 5 7 23 7 8 16 7 16 19 7 19 20 7 20 23 8 9 10 8 10 15 8 15 16 10 11 13 10 13 15 11 12 13 13 14 15 16 17 18 16 18 19 20 21 22 20 22 23 24 25 26 24 26 28 26 27 28 28 29 31 28 31 35 29 30 31 31 32 33 31 33 35 33 34 35 perm 2 3 5 6 7...
output:
33 1000 poly 16 18 ................## ...............### ..............#### ..............###. .............##... ............##.... .........#####.... ......########.... ....#######....... ...########....... ...########....... ..######.......... ..####............ .####............. #####.............
input:
33 1000 poly 16 18 ................## ...............### ..............#### ..............###. .............##... ............##.... .........#####.... ......########.... ....#######....... ...########....... ...########....... ..######.......... ..####............ .####............. #####.............
output:
33 1000 triang 1 2 28 1 28 35 2 3 28 3 4 5 3 5 23 3 23 24 3 24 28 5 6 7 5 7 23 7 8 16 7 16 19 7 19 20 7 20 23 8 9 10 8 10 15 8 15 16 10 11 13 10 13 15 11 12 13 13 14 15 16 17 18 16 18 19 20 21 22 20 22 23 24 25 26 24 26 28 26 27 28 28 29 31 28 31 35 29 30 31 31 32 33 31 33 35 33 34 35 perm 2 3 5 6 7...
result:
ok good communication process (1000 test cases)
Test #35:
score: 100
Accepted
time: 17ms
memory: 3784kb
input:
34 1000 triang 1 2 36 2 3 36 3 4 34 3 34 36 4 5 6 4 6 32 4 32 33 4 33 34 6 7 8 6 8 10 6 10 11 6 11 12 6 12 13 6 13 32 8 9 10 13 14 18 13 18 32 14 15 18 15 16 18 16 17 18 18 19 20 18 20 22 18 22 23 18 23 32 20 21 22 23 24 32 24 25 32 25 26 31 25 31 32 26 27 29 26 29 30 26 30 31 27 28 29 34 35 36 poly...
output:
34 1000 poly 17 18 ................## ..........######## ..........#######. ..........######.. ..........####.... ..........####.... ........######.... .......#######.... ......########.... ......########.... ......#######..... ......#####....... ..#######......... .######........... #######...........
input:
34 1000 poly 17 18 ................## ..........######## ..........#######. ..........######.. ..........####.... ..........####.... ........######.... .......#######.... ......########.... ......########.... ......#######..... ......#####....... ..#######......... .######........... #######...........
output:
34 1000 triang 1 2 36 2 3 36 3 4 34 3 34 36 4 5 6 4 6 32 4 32 33 4 33 34 6 7 8 6 8 10 6 10 11 6 11 12 6 12 13 6 13 32 8 9 10 13 14 18 13 18 32 14 15 18 15 16 18 16 17 18 18 19 20 18 20 22 18 22 23 18 23 32 20 21 22 23 24 32 24 25 32 25 26 31 25 31 32 26 27 29 26 29 30 26 30 31 27 28 29 34 35 36 poly...
result:
ok good communication process (1000 test cases)
Test #36:
score: 100
Accepted
time: 17ms
memory: 3916kb
input:
35 1000 poly 19 17 .............#### ..........####### ..........######. ..........####... ..........####... .........#####... .........#####... .........#####... .........#####... ........####..... ........####..... ........##....... ......####....... .#########....... ##............... #.............
output:
35 1000 perm 5 1 2 3 4 7 6 8 9 10 11 13 14 18 23 12 15 16 28 29 17 19 30 32 20 21 22 24 25 26 33 34 35 27 31 triang 1 2 3 1 3 37 3 4 37 4 5 35 4 35 36 4 36 37 5 6 8 5 8 9 5 9 14 5 14 35 6 7 8 9 10 13 9 13 14 10 11 13 11 12 13 14 15 16 14 16 18 14 18 35 16 17 18 18 19 30 18 30 34 18 34 35 19 20 22 1...
input:
35 1000 perm 5 1 2 3 4 7 6 8 9 10 11 13 14 18 23 12 15 16 28 29 17 19 30 32 20 21 22 24 25 26 33 34 35 27 31 triang 1 2 3 1 3 37 3 4 37 4 5 35 4 35 36 4 36 37 5 6 8 5 8 9 5 9 14 5 14 35 6 7 8 9 10 13 9 13 14 10 11 13 11 12 13 14 15 16 14 16 18 14 18 35 16 17 18 18 19 30 18 30 34 18 34 35 19 20 22 19...
output:
35 1000 poly 19 17 .............#### ..........####### ..........######. ..........####... ..........####... .........#####... .........#####... .........#####... .........#####... ........####..... ........####..... ........##....... ......####....... .#########....... ##............... #.............
result:
ok good communication process (1000 test cases)
Test #37:
score: 100
Accepted
time: 18ms
memory: 3748kb
input:
35 1000 triang 1 2 6 1 6 9 1 9 31 1 31 37 2 3 6 3 4 6 4 5 6 6 7 8 6 8 9 9 10 12 9 12 31 10 11 12 12 13 14 12 14 30 12 30 31 14 15 17 14 17 18 14 18 23 14 23 30 15 16 17 18 19 22 18 22 23 19 20 21 19 21 22 23 24 26 23 26 27 23 27 30 24 25 26 27 28 29 27 29 30 31 32 33 31 33 34 31 34 35 31 35 36 31 36...
output:
35 1000 poly 16 20 ...................# ...............##### ............######## ..........########## ..........########## .......########..... .......#######...... .....#########...... .....#########...... ....#######......... ...#######.......... ...######........... .#####.............. ####.......
input:
35 1000 poly 16 20 ...................# ...............##### ............######## ..........########## ..........########## .......########..... .......#######...... .....#########...... .....#########...... ....#######......... ...#######.......... ...######........... .#####.............. ####.......
output:
35 1000 triang 1 2 6 1 6 9 1 9 31 1 31 37 2 3 6 3 4 6 4 5 6 6 7 8 6 8 9 9 10 12 9 12 31 10 11 12 12 13 14 12 14 30 12 30 31 14 15 17 14 17 18 14 18 23 14 23 30 15 16 17 18 19 22 18 22 23 19 20 21 19 21 22 23 24 26 23 26 27 23 27 30 24 25 26 27 28 29 27 29 30 31 32 33 31 33 34 31 34 35 31 35 36 31 36...
result:
ok good communication process (1000 test cases)
Test #38:
score: 100
Accepted
time: 18ms
memory: 3988kb
input:
35 1000 perm 1 2 6 3 4 10 11 5 7 13 16 8 9 12 17 14 15 21 22 24 18 19 27 20 23 31 25 26 32 35 28 29 30 33 34 triang 1 2 4 1 4 31 1 31 32 1 32 35 1 35 37 2 3 4 4 5 6 4 6 7 4 7 8 4 8 31 8 9 31 9 10 30 9 30 31 10 11 30 11 12 15 11 15 16 11 16 17 11 17 28 11 28 29 11 29 30 12 13 15 13 14 15 17 18 19 17 ...
output:
35 1000 triang 1 2 37 2 3 4 2 4 5 2 5 20 2 20 36 2 36 37 5 6 9 5 9 20 6 7 9 7 8 9 9 10 14 9 14 19 9 19 20 10 11 14 11 12 13 11 13 14 14 15 16 14 16 19 16 17 19 17 18 19 20 21 36 21 22 27 21 27 30 21 30 36 22 23 24 22 24 25 22 25 27 25 26 27 27 28 30 28 29 30 30 31 34 30 34 36 31 32 34 32 33 34 34 35...
input:
35 1000 triang 1 2 37 2 3 4 2 4 5 2 5 20 2 20 36 2 36 37 5 6 9 5 9 20 6 7 9 7 8 9 9 10 14 9 14 19 9 19 20 10 11 14 11 12 13 11 13 14 14 15 16 14 16 19 16 17 19 17 18 19 20 21 36 21 22 27 21 27 30 21 30 36 22 23 24 22 24 25 22 25 27 25 26 27 27 28 30 28 29 30 30 31 34 30 34 36 31 32 34 32 33 34 34 35...
output:
35 1000 perm 1 2 6 3 4 10 11 5 7 13 16 8 9 12 17 14 15 21 22 24 18 19 27 20 23 31 25 26 32 35 28 29 30 33 34 triang 1 2 4 1 4 31 1 31 32 1 32 35 1 35 37 2 3 4 4 5 6 4 6 7 4 7 8 4 8 31 8 9 31 9 10 30 9 30 31 10 11 30 11 12 15 11 15 16 11 16 17 11 17 28 11 28 29 11 29 30 12 13 15 13 14 15 17 18 19 17...
result:
ok good communication process (1000 test cases)
Test #39:
score: 100
Accepted
time: 17ms
memory: 3784kb
input:
35 1000 triang 1 2 33 1 33 34 1 34 37 2 3 29 2 29 30 2 30 33 3 4 11 3 11 29 4 5 6 4 6 7 4 7 9 4 9 11 7 8 9 9 10 11 11 12 13 11 13 29 13 14 15 13 15 18 13 18 29 15 16 17 15 17 18 18 19 20 18 20 27 18 27 28 18 28 29 20 21 22 20 22 23 20 23 25 20 25 26 20 26 27 23 24 25 30 31 32 30 32 33 34 35 36 34 36...
output:
35 1000 perm 3 4 6 1 8 2 5 10 12 14 15 7 17 19 20 22 9 23 24 11 25 26 13 16 18 21 27 29 30 28 33 34 31 35 32 triang 1 2 34 1 34 35 1 35 36 1 36 37 2 3 33 2 33 34 3 4 33 4 5 6 4 6 7 4 7 8 4 8 33 8 9 33 9 10 13 9 13 14 9 14 15 9 15 29 9 29 30 9 30 32 9 32 33 10 11 13 11 12 13 15 16 17 15 17 18 15 18 ...
input:
35 1000 perm 3 4 6 1 8 2 5 10 12 14 15 7 17 19 20 22 9 23 24 11 25 26 13 16 18 21 27 29 30 28 33 34 31 35 32 triang 1 2 34 1 34 35 1 35 36 1 36 37 2 3 33 2 33 34 3 4 33 4 5 6 4 6 7 4 7 8 4 8 33 8 9 33 9 10 13 9 13 14 9 14 15 9 15 29 9 29 30 9 30 32 9 32 33 10 11 13 11 12 13 15 16 17 15 17 18 15 18 2...
output:
35 1000 triang 1 2 33 1 33 34 1 34 37 2 3 29 2 29 30 2 30 33 3 4 11 3 11 29 4 5 6 4 6 7 4 7 9 4 9 11 7 8 9 9 10 11 11 12 13 11 13 29 13 14 15 13 15 18 13 18 29 15 16 17 15 17 18 18 19 20 18 20 27 18 27 28 18 28 29 20 21 22 20 22 23 20 23 25 20 25 26 20 26 27 23 24 25 30 31 32 30 32 33 34 35 36 34 36...
result:
ok good communication process (1000 test cases)
Test #40:
score: 100
Accepted
time: 18ms
memory: 3796kb
input:
35 1000 poly 18 18 ................## ...............### ...............#.. ...............#.. ..............##.. ............###... ...........####... .........####..... ......######...... ......#####....... ..#########....... ..#########....... .#######.......... .#####............ ######............
output:
35 1000 triang 1 2 37 2 3 31 2 31 35 2 35 37 3 4 24 3 24 26 3 26 28 3 28 29 3 29 31 4 5 7 4 7 16 4 16 24 5 6 7 7 8 16 8 9 10 8 10 16 10 11 14 10 14 15 10 15 16 11 12 13 11 13 14 16 17 20 16 20 21 16 21 24 17 18 19 17 19 20 21 22 23 21 23 24 24 25 26 26 27 28 29 30 31 31 32 35 32 33 35 33 34 35 35 36...
input:
35 1000 triang 1 2 37 2 3 31 2 31 35 2 35 37 3 4 24 3 24 26 3 26 28 3 28 29 3 29 31 4 5 7 4 7 16 4 16 24 5 6 7 7 8 16 8 9 10 8 10 16 10 11 14 10 14 15 10 15 16 11 12 13 11 13 14 16 17 20 16 20 21 16 21 24 17 18 19 17 19 20 21 22 23 21 23 24 24 25 26 26 27 28 29 30 31 31 32 35 32 33 35 33 34 35 35 36...
output:
35 1000 poly 18 18 ................## ...............### ...............#.. ...............#.. ..............##.. ............###... ...........####... .........####..... ......######...... ......#####....... ..#########....... ..#########....... .#######.......... .#####............ ######............
result:
ok good communication process (1000 test cases)
Test #41:
score: 100
Accepted
time: 17ms
memory: 3772kb
input:
35 1000 poly 19 17 ................# ................# ................# ...............## ..............### ............##### ............##### ............###.. ...........###... .....#########... ....#######...... ....#######...... ....#####........ ...#####......... ..######......... ..#####.......
output:
35 1000 triang 1 2 23 1 23 25 1 25 32 1 32 34 1 34 35 1 35 37 2 3 4 2 4 23 4 5 6 4 6 10 4 10 23 6 7 10 7 8 10 8 9 10 10 11 12 10 12 21 10 21 22 10 22 23 12 13 20 12 20 21 13 14 20 14 15 16 14 16 19 14 19 20 16 17 18 16 18 19 23 24 25 25 26 30 25 30 32 26 27 30 27 28 29 27 29 30 30 31 32 32 33 34 35 ...
input:
35 1000 triang 1 2 23 1 23 25 1 25 32 1 32 34 1 34 35 1 35 37 2 3 4 2 4 23 4 5 6 4 6 10 4 10 23 6 7 10 7 8 10 8 9 10 10 11 12 10 12 21 10 21 22 10 22 23 12 13 20 12 20 21 13 14 20 14 15 16 14 16 19 14 19 20 16 17 18 16 18 19 23 24 25 25 26 30 25 30 32 26 27 30 27 28 29 27 29 30 30 31 32 32 33 34 35 ...
output:
35 1000 poly 19 17 ................# ................# ................# ...............## ..............### ............##### ............##### ............###.. ...........###... .....#########... ....#######...... ....#######...... ....#####........ ...#####......... ..######......... ..#####.......
result:
ok good communication process (1000 test cases)
Test #42:
score: 100
Accepted
time: 18ms
memory: 3916kb
input:
35 1000 poly 12 24 ...............######### ...........############# ...........##########... ...........######....... ..........#######....... .........#######........ ........#######......... .......#######.......... ....########............ ...########............. ..#######............... ######...
output:
35 1000 triang 1 2 37 2 3 4 2 4 5 2 5 37 5 6 7 5 7 35 5 35 36 5 36 37 7 8 9 7 9 31 7 31 32 7 32 33 7 33 34 7 34 35 9 10 11 9 11 12 9 12 13 9 13 17 9 17 31 13 14 15 13 15 17 15 16 17 17 18 19 17 19 21 17 21 28 17 28 30 17 30 31 19 20 21 21 22 27 21 27 28 22 23 25 22 25 26 22 26 27 23 24 25 28 29 30 t...
input:
35 1000 triang 1 2 37 2 3 4 2 4 5 2 5 37 5 6 7 5 7 35 5 35 36 5 36 37 7 8 9 7 9 31 7 31 32 7 32 33 7 33 34 7 34 35 9 10 11 9 11 12 9 12 13 9 13 17 9 17 31 13 14 15 13 15 17 15 16 17 17 18 19 17 19 21 17 21 28 17 28 30 17 30 31 19 20 21 21 22 27 21 27 28 22 23 25 22 25 26 22 26 27 23 24 25 28 29 30 t...
output:
35 1000 poly 12 24 ...............######### ...........############# ...........##########... ...........######....... ..........#######....... .........#######........ ........#######......... .......#######.......... ....########............ ...########............. ..#######............... ######...
result:
ok good communication process (1000 test cases)
Test #43:
score: 100
Accepted
time: 18ms
memory: 3780kb
input:
35 1000 triang 1 2 13 1 13 36 1 36 37 2 3 13 3 4 9 3 9 12 3 12 13 4 5 6 4 6 9 6 7 9 7 8 9 9 10 11 9 11 12 13 14 36 14 15 16 14 16 29 14 29 36 16 17 18 16 18 29 18 19 29 19 20 22 19 22 28 19 28 29 20 21 22 22 23 27 22 27 28 23 24 27 24 25 27 25 26 27 29 30 33 29 33 36 30 31 33 31 32 33 33 34 35 33 35...
output:
35 1000 poly 20 16 ............#### ...........####. ...........####. ...........###.. ........######.. ........####.... ........####.... ........###..... .......####..... .......####..... .......###...... ......###....... .....####....... .....####....... ..######........ .####........... .###........
input:
35 1000 poly 20 16 ............#### ...........####. ...........####. ...........###.. ........######.. ........####.... ........####.... ........###..... .......####..... .......####..... .......###...... ......###....... .....####....... .....####....... ..######........ .####........... .###........
output:
35 1000 triang 1 2 13 1 13 36 1 36 37 2 3 13 3 4 9 3 9 12 3 12 13 4 5 6 4 6 9 6 7 9 7 8 9 9 10 11 9 11 12 13 14 36 14 15 16 14 16 29 14 29 36 16 17 18 16 18 29 18 19 29 19 20 22 19 22 28 19 28 29 20 21 22 22 23 27 22 27 28 23 24 27 24 25 27 25 26 27 29 30 33 29 33 36 30 31 33 31 32 33 33 34 35 33 35...
result:
ok good communication process (1000 test cases)
Test #44:
score: 100
Accepted
time: 17ms
memory: 3768kb
input:
35 1000 poly 16 20 .................### .................### ................###. ..............####.. .........########... .........########... .....############... .....############... .....###########.... .....#########...... ...##########....... ...#########........ ...######........... .######....
output:
35 1000 perm 1 4 5 2 9 10 15 3 16 6 17 18 7 21 22 23 8 24 11 25 12 27 28 13 30 14 19 20 26 33 29 34 35 31 32 triang 1 2 3 1 3 4 1 4 37 4 5 9 4 9 37 5 6 9 6 7 8 6 8 9 9 10 37 10 11 37 11 12 15 11 15 21 11 21 37 12 13 15 13 14 15 15 16 21 16 17 20 16 20 21 17 18 19 17 19 20 21 22 24 21 24 33 21 33 34...
input:
35 1000 perm 1 4 5 2 9 10 15 3 16 6 17 18 7 21 22 23 8 24 11 25 12 27 28 13 30 14 19 20 26 33 29 34 35 31 32 triang 1 2 3 1 3 4 1 4 37 4 5 9 4 9 37 5 6 9 6 7 8 6 8 9 9 10 37 10 11 37 11 12 15 11 15 21 11 21 37 12 13 15 13 14 15 15 16 21 16 17 20 16 20 21 17 18 19 17 19 20 21 22 24 21 24 33 21 33 34 ...
output:
35 1000 poly 16 20 .................### .................### ................###. ..............####.. .........########... .........########... .....############... .....############... .....###########.... .....#########...... ...##########....... ...#########........ ...######........... .######....
result:
ok good communication process (1000 test cases)
Test #45:
score: 100
Accepted
time: 18ms
memory: 3768kb
input:
35 1000 perm 3 1 4 5 8 9 2 11 6 15 17 20 7 22 10 23 25 12 28 13 31 33 14 16 18 34 19 35 21 24 26 27 29 30 32 perm 4 1 7 2 3 8 5 13 18 19 20 6 9 21 24 10 26 28 11 12 14 29 31 15 32 33 16 17 34 22 23 25 35 27 30 poly 18 18 .................# ...............### ............###### ............###### ......
output:
35 1000 poly 19 17 ..............### .............#### .............#### ............##### ............##### ...........###### .........######## ........########. ........########. .......########.. ......#########.. ......#########.. ......#######.... .....#######..... ...#######....... ...######.....
input:
35 1000 poly 19 17 ..............### .............#### .............#### ............##### ............##### ...........###### .........######## ........########. ........########. .......########.. ......#########.. ......#########.. ......#######.... .....#######..... ...#######....... ...######.....
output:
35 1000 perm 3 1 4 5 8 9 2 11 6 15 17 20 7 22 10 23 25 12 28 13 31 33 14 16 18 34 19 35 21 24 26 27 29 30 32 perm 4 1 7 2 3 8 5 13 18 19 20 6 9 21 24 10 26 28 11 12 14 29 31 15 32 33 16 17 34 22 23 25 35 27 30 poly 18 18 .................# ...............### ............###### ............###### ....
result:
ok good communication process (1000 test cases)