#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <vector> #include <algorithm> #include <queue> #include <map> using namespace std; int solveAC(int n, int k, vector<int> & v); int solveWA(int n, int k, vector<int> & v); int main() { for (int n = 2; n <= 8; n++) { for (int k = 2; k <= 8; k++) { vector<int> a(n); for (int i = 0; i < n; i++) { a[i] = 1 + i; } do { if (solveAC(n, k, a) != solveWA(n, k, a)) { printf("n=%d k=%d\n", n, k); for (int i = 0; i < n; i++) { printf("%d%c", a[i], " \n"[i == n - 1]); } printf("acceptedSolution=%d wrongSolution=%d\n\n", solveAC(n, k, a), solveWA(n, k, a)); } } while (next_permutation(a.begin(), a.end())); } } return 0; } int solveAC(int n, int k, vector<int> & v) { int temp, temp2; string s = ""; int lol; for (temp = 0;temp<n;temp++) { lol = v[temp]; s += char(lol + 48); } string target = s; sort(target.begin(), target.end()); //cout<<target<<"\n"; queue<pair<string, int>> q; q.push(make_pair(s, 0)); map<string, bool> visited; while (!q.empty()) { string st = q.front().first; int cnt = q.front().second; q.pop(); if (visited[st]) continue; visited[st] = true; if (st == target) { return cnt; return 0; } cnt++; for (temp = 0;temp <= n - k;temp++) { string sst = st; int troll = 0; for (temp2 = temp;temp2<temp + k;temp2++) { sst[temp2] = st[temp + k - troll - 1]; troll++; } //cout<<sst<<" "<<cnt<<"\n"; q.push(make_pair(sst, cnt)); } } return -1; } int solveWA(int n, int k, vector<int> & v) { { vector<int> a(n); int temp, temp2, temp3; for (temp = 0;temp<n;temp++) { a[temp] = v[temp]; } vector<vector<int>> adj(n); for (temp = 0;temp<n;temp++) { int cnt = 1; for (temp2 = 0;temp2<n;temp2++) { if ((temp2 >= temp) && (temp2<temp + k) && (temp + k - cnt<n)) { adj[temp2].push_back(temp + k - cnt); cnt++; } else { adj[temp2].push_back(temp2); } } } /*for(temp=0;temp<n;temp++) { printf("%d contains : ",temp); for(temp2=0;temp2<adj[temp].size();temp2++) { cout<<adj[temp][temp2]<<" "; } cout<<"\n"; }*/ int cnt = 0; for (temp = 0;temp<n;temp++) { vector<int> source(n); vector<bool> visited(n); for (temp2 = temp;temp2<n;temp2++) { if (a[temp2] == temp + 1) break; } if (temp2 == temp) { continue; } int start = temp2; for (temp2 = 0;temp2<n;temp2++) { source[temp2] = -1; visited[temp2] = false; } int pos = start; queue<int> q; q.push(pos); while (!q.empty()) { pos = q.front(); q.pop(); visited[pos] = true; if (pos == temp) break; for (temp2 = 0;temp2<adj[pos].size();temp2++) { int thenode = adj[pos][temp2]; bool cokor = true; for (int tmp = temp;tmp<n;tmp++) { int check = adj[tmp][temp2]; if (check<temp) cokor = false; } if ((!visited[thenode]) && (cokor)) { source[thenode] = pos; q.push(thenode); } } } if (source[temp] == -1) { return -1; } vector<int> ans; pos = temp; while (source[pos] != -1) { ans.push_back(pos); pos = source[pos]; } pos = start; cnt += ans.size(); for (temp2 = ans.size() - 1;temp2 >= 0;temp2--) { for (temp3 = 0;temp3<adj[pos].size();temp3++) { int thenode = adj[pos][temp3]; if (thenode == ans[temp2]) { break; } } int kursor = temp3; vector<int> b(n); for (temp3 = 0;temp3<n;temp3++) b[temp3] = a[temp3]; for (temp3 = 0;temp3<n;temp3++) { a[temp3] = b[adj[temp3][kursor]]; } pos = ans[temp2]; } //for(temp3=0;temp3<n;temp3++) cout<<a[temp3]<<" "; cout<<"\n"; } return cnt; } }
Standard input is empty
n=6 k=4 1 2 3 5 6 4 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 2 3 6 4 5 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 2 4 3 6 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 1 2 4 5 3 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 2 4 6 5 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 2 5 3 4 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 2 5 4 6 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 2 5 6 3 4 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 2 6 3 5 4 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 2 6 4 3 5 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 3 2 4 6 5 acceptedSolution=10 wrongSolution=-1 n=6 k=4 1 3 2 5 4 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 3 4 2 5 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 3 4 6 2 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 1 3 5 2 6 4 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 3 5 4 2 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 3 5 6 4 2 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 3 6 2 4 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 1 3 6 4 5 2 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 3 6 5 2 4 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 4 2 3 5 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 4 2 5 6 3 acceptedSolution=7 wrongSolution=-1 n=6 k=4 1 4 2 6 3 5 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 4 3 5 2 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 4 3 6 5 2 acceptedSolution=6 wrongSolution=-1 n=6 k=4 1 4 5 2 3 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 4 5 3 6 2 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 4 6 2 5 3 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 4 6 3 2 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 1 4 6 5 3 2 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 5 2 3 6 4 acceptedSolution=7 wrongSolution=-1 n=6 k=4 1 5 2 4 3 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 5 2 6 4 3 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 5 3 2 4 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 5 3 4 6 2 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 5 3 6 2 4 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 5 4 2 6 3 acceptedSolution=7 wrongSolution=-1 n=6 k=4 1 5 4 6 3 2 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 5 6 3 4 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 1 5 6 4 2 3 acceptedSolution=7 wrongSolution=-1 n=6 k=4 1 6 2 4 5 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 6 2 5 3 4 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 6 3 2 5 4 acceptedSolution=6 wrongSolution=-1 n=6 k=4 1 6 3 4 2 5 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 6 3 5 4 2 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 6 4 2 3 5 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 6 4 3 5 2 acceptedSolution=9 wrongSolution=-1 n=6 k=4 1 6 4 5 2 3 acceptedSolution=7 wrongSolution=-1 n=6 k=4 1 6 5 2 4 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 1 6 5 3 2 4 acceptedSolution=8 wrongSolution=-1 n=6 k=4 2 1 3 5 4 6 acceptedSolution=10 wrongSolution=-1 n=6 k=4 2 1 3 6 5 4 acceptedSolution=5 wrongSolution=-1 n=6 k=4 2 1 4 3 5 6 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 1 4 5 6 3 acceptedSolution=4 wrongSolution=-1 n=6 k=4 2 1 4 6 3 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 1 5 3 6 4 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 1 5 4 3 6 acceptedSolution=3 wrongSolution=-1 n=6 k=4 2 1 5 6 4 3 acceptedSolution=6 wrongSolution=-1 n=6 k=4 2 1 6 3 4 5 acceptedSolution=4 wrongSolution=-1 n=6 k=4 2 1 6 4 5 3 acceptedSolution=9 wrongSolution=-1 n=6 k=4 2 3 1 4 5 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 2 3 1 6 4 5 acceptedSolution=8 wrongSolution=-1 n=6 k=4 2 3 4 5 1 6 acceptedSolution=4 wrongSolution=-1 n=6 k=4 2 3 5 1 4 6 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 3 5 4 6 1 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 3 6 1 5 4 acceptedSolution=5 wrongSolution=-1 n=6 k=4 2 3 6 4 1 5 acceptedSolution=6 wrongSolution=-1 n=6 k=4 2 3 6 5 4 1 acceptedSolution=8 wrongSolution=-1 n=6 k=4 2 4 1 3 6 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 4 1 5 3 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 2 4 1 6 5 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 2 4 3 1 5 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 2 4 3 5 6 1 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 4 3 6 1 5 acceptedSolution=5 wrongSolution=-1 n=6 k=4 2 4 5 1 6 3 acceptedSolution=6 wrongSolution=-1 n=6 k=4 2 4 5 3 1 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 2 4 5 6 3 1 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 4 6 1 3 5 acceptedSolution=9 wrongSolution=-1 n=6 k=4 2 4 6 3 5 1 acceptedSolution=9 wrongSolution=-1 n=6 k=4 2 4 6 5 1 3 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 5 1 3 4 6 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 5 1 4 6 3 acceptedSolution=9 wrongSolution=-1 n=6 k=4 2 5 1 6 3 4 acceptedSolution=6 wrongSolution=-1 n=6 k=4 2 5 3 1 6 4 acceptedSolution=9 wrongSolution=-1 n=6 k=4 2 5 3 4 1 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 2 5 3 6 4 1 acceptedSolution=10 wrongSolution=-1 n=6 k=4 2 5 4 1 3 6 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 5 4 3 6 1 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 5 4 6 1 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 2 5 6 1 4 3 acceptedSolution=9 wrongSolution=-1 n=6 k=4 2 5 6 3 1 4 acceptedSolution=6 wrongSolution=-1 n=6 k=4 2 5 6 4 3 1 acceptedSolution=6 wrongSolution=-1 n=6 k=4 2 6 1 3 5 4 acceptedSolution=9 wrongSolution=-1 n=6 k=4 2 6 1 5 4 3 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 6 3 1 4 5 acceptedSolution=6 wrongSolution=-1 n=6 k=4 2 6 3 4 5 1 acceptedSolution=8 wrongSolution=-1 n=6 k=4 2 6 3 5 1 4 acceptedSolution=7 wrongSolution=-1 n=6 k=4 2 6 4 1 5 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 2 6 4 5 3 1 acceptedSolution=8 wrongSolution=-1 n=6 k=4 2 6 5 4 1 3 acceptedSolution=5 wrongSolution=-1 n=6 k=4 3 1 2 4 5 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 3 1 2 5 6 4 acceptedSolution=8 wrongSolution=-1 n=6 k=4 3 1 4 2 6 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 3 1 4 6 5 2 acceptedSolution=9 wrongSolution=-1 n=6 k=4 3 1 5 2 4 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 3 1 5 4 6 2 acceptedSolution=5 wrongSolution=-1 n=6 k=4 3 1 5 6 2 4 acceptedSolution=6 wrongSolution=-1 n=6 k=4 3 1 6 2 5 4 acceptedSolution=8 wrongSolution=-1 n=6 k=4 3 1 6 4 2 5 acceptedSolution=9 wrongSolution=-1 n=6 k=4 3 1 6 5 4 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 3 2 1 4 6 5 acceptedSolution=5 wrongSolution=-1 n=6 k=4 3 2 1 6 5 4 acceptedSolution=6 wrongSolution=-1 n=6 k=4 3 2 4 1 5 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 3 2 4 5 6 1 acceptedSolution=5 wrongSolution=-1 n=6 k=4 3 2 4 6 1 5 acceptedSolution=9 wrongSolution=-1 n=6 k=4 3 2 5 1 6 4 acceptedSolution=8 wrongSolution=-1 n=6 k=4 3 2 5 6 4 1 acceptedSolution=6 wrongSolution=-1 n=6 k=4 3 2 6 5 1 4 acceptedSolution=7 wrongSolution=-1 n=6 k=4 3 4 1 2 5 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 3 4 1 5 6 2 acceptedSolution=5 wrongSolution=-1 n=6 k=4 3 4 2 1 6 5 acceptedSolution=6 wrongSolution=-1 n=6 k=4 3 4 2 5 1 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 3 4 2 6 5 1 acceptedSolution=6 wrongSolution=-1 n=6 k=4 3 4 5 6 1 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 3 4 6 1 5 2 acceptedSolution=10 wrongSolution=-1 n=6 k=4 3 4 6 5 2 1 acceptedSolution=7 wrongSolution=-1 n=6 k=4 3 5 1 2 6 4 acceptedSolution=6 wrongSolution=-1 n=6 k=4 3 5 1 4 2 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 3 5 1 6 4 2 acceptedSolution=9 wrongSolution=-1 n=6 k=4 3 5 2 1 4 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 3 5 2 4 6 1 acceptedSolution=10 wrongSolution=-1 n=6 k=4 3 5 2 6 1 4 acceptedSolution=9 wrongSolution=-1 n=6 k=4 3 5 4 1 6 2 acceptedSolution=8 wrongSolution=-1 n=6 k=4 3 5 4 2 1 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 3 5 4 6 2 1 acceptedSolution=5 wrongSolution=-1 n=6 k=4 3 5 6 1 2 4 acceptedSolution=7 wrongSolution=-1 n=6 k=4 3 5 6 2 4 1 acceptedSolution=7 wrongSolution=-1 n=6 k=4 3 5 6 4 1 2 acceptedSolution=8 wrongSolution=-1 n=6 k=4 3 6 1 2 4 5 acceptedSolution=5 wrongSolution=-1 n=6 k=4 3 6 1 4 5 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 3 6 1 5 2 4 acceptedSolution=9 wrongSolution=-1 n=6 k=4 3 6 2 1 5 4 acceptedSolution=7 wrongSolution=-1 n=6 k=4 3 6 2 4 1 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 3 6 2 5 4 1 acceptedSolution=6 wrongSolution=-1 n=6 k=4 3 6 4 1 2 5 acceptedSolution=6 wrongSolution=-1 n=6 k=4 3 6 4 2 5 1 acceptedSolution=10 wrongSolution=-1 n=6 k=4 3 6 4 5 1 2 acceptedSolution=6 wrongSolution=-1 n=6 k=4 3 6 5 1 4 2 acceptedSolution=6 wrongSolution=-1 n=6 k=4 3 6 5 2 1 4 acceptedSolution=7 wrongSolution=-1 n=6 k=4 3 6 5 4 2 1 acceptedSolution=4 wrongSolution=-1 n=6 k=4 4 1 2 3 6 5 acceptedSolution=4 wrongSolution=-1 n=6 k=4 4 1 2 5 3 6 acceptedSolution=7 wrongSolution=-1 n=6 k=4 4 1 2 6 5 3 acceptedSolution=5 wrongSolution=-1 n=6 k=4 4 1 3 5 6 2 acceptedSolution=6 wrongSolution=-1 n=6 k=4 4 1 3 6 2 5 acceptedSolution=9 wrongSolution=-1 n=6 k=4 4 1 5 2 6 3 acceptedSolution=9 wrongSolution=-1 n=6 k=4 4 1 5 3 2 6 acceptedSolution=7 wrongSolution=-1 n=6 k=4 4 1 6 2 3 5 acceptedSolution=6 wrongSolution=-1 n=6 k=4 4 1 6 3 5 2 acceptedSolution=8 wrongSolution=-1 n=6 k=4 4 1 6 5 2 3 acceptedSolution=9 wrongSolution=-1 n=6 k=4 4 2 1 3 5 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 4 2 1 5 6 3 acceptedSolution=5 wrongSolution=-1 n=6 k=4 4 2 1 6 3 5 acceptedSolution=8 wrongSolution=-1 n=6 k=4 4 2 3 1 6 5 acceptedSolution=9 wrongSolution=-1 n=6 k=4 4 2 3 5 1 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 4 2 3 6 5 1 acceptedSolution=4 wrongSolution=-1 n=6 k=4 4 2 5 1 3 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 4 2 5 3 6 1 acceptedSolution=9 wrongSolution=-1 n=6 k=4 4 2 5 6 1 3 acceptedSolution=10 wrongSolution=-1 n=6 k=4 4 2 6 1 5 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 4 2 6 3 1 5 acceptedSolution=8 wrongSolution=-1 n=6 k=4 4 2 6 5 3 1 acceptedSolution=8 wrongSolution=-1 n=6 k=4 4 3 1 2 6 5 acceptedSolution=6 wrongSolution=-1 n=6 k=4 4 3 1 5 2 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 4 3 2 6 1 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 4 3 5 1 6 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 4 3 5 2 1 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 4 3 5 6 2 1 acceptedSolution=7 wrongSolution=-1 n=6 k=4 4 3 6 1 2 5 acceptedSolution=9 wrongSolution=-1 n=6 k=4 4 3 6 2 5 1 acceptedSolution=8 wrongSolution=-1 n=6 k=4 4 5 1 3 6 2 acceptedSolution=6 wrongSolution=-1 n=6 k=4 4 5 1 6 2 3 acceptedSolution=7 wrongSolution=-1 n=6 k=4 4 5 2 1 6 3 acceptedSolution=9 wrongSolution=-1 n=6 k=4 4 5 2 6 3 1 acceptedSolution=7 wrongSolution=-1 n=6 k=4 4 5 3 1 2 6 acceptedSolution=7 wrongSolution=-1 n=6 k=4 4 5 3 2 6 1 acceptedSolution=6 wrongSolution=-1 n=6 k=4 4 5 3 6 1 2 acceptedSolution=8 wrongSolution=-1 n=6 k=4 4 5 6 2 1 3 acceptedSolution=6 wrongSolution=-1 n=6 k=4 4 6 1 2 5 3 acceptedSolution=10 wrongSolution=-1 n=6 k=4 4 6 1 3 2 5 acceptedSolution=8 wrongSolution=-1 n=6 k=4 4 6 1 5 3 2 acceptedSolution=6 wrongSolution=-1 n=6 k=4 4 6 2 1 3 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 4 6 2 3 5 1 acceptedSolution=5 wrongSolution=-1 n=6 k=4 4 6 2 5 1 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 4 6 3 1 5 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 4 6 3 2 1 5 acceptedSolution=5 wrongSolution=-1 n=6 k=4 4 6 3 5 2 1 acceptedSolution=10 wrongSolution=-1 n=6 k=4 4 6 5 1 2 3 acceptedSolution=6 wrongSolution=-1 n=6 k=4 4 6 5 2 3 1 acceptedSolution=7 wrongSolution=-1 n=6 k=4 4 6 5 3 1 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 1 2 3 4 6 acceptedSolution=4 wrongSolution=-1 n=6 k=4 5 1 2 4 6 3 acceptedSolution=6 wrongSolution=-1 n=6 k=4 5 1 2 6 3 4 acceptedSolution=5 wrongSolution=-1 n=6 k=4 5 1 3 2 6 4 acceptedSolution=5 wrongSolution=-1 n=6 k=4 5 1 3 4 2 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 5 1 3 6 4 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 1 4 2 3 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 5 1 4 6 2 3 acceptedSolution=6 wrongSolution=-1 n=6 k=4 5 1 6 3 2 4 acceptedSolution=8 wrongSolution=-1 n=6 k=4 5 1 6 4 3 2 acceptedSolution=5 wrongSolution=-1 n=6 k=4 5 2 1 3 6 4 acceptedSolution=9 wrongSolution=-1 n=6 k=4 5 2 1 4 3 6 acceptedSolution=6 wrongSolution=-1 n=6 k=4 5 2 1 6 4 3 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 2 3 1 4 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 5 2 3 4 6 1 acceptedSolution=8 wrongSolution=-1 n=6 k=4 5 2 3 6 1 4 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 2 4 1 6 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 5 2 4 3 1 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 5 2 4 6 3 1 acceptedSolution=10 wrongSolution=-1 n=6 k=4 5 2 6 1 3 4 acceptedSolution=10 wrongSolution=-1 n=6 k=4 5 2 6 3 4 1 acceptedSolution=5 wrongSolution=-1 n=6 k=4 5 2 6 4 1 3 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 3 1 2 4 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 5 3 1 4 6 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 3 1 6 2 4 acceptedSolution=9 wrongSolution=-1 n=6 k=4 5 3 2 1 6 4 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 3 2 4 1 6 acceptedSolution=9 wrongSolution=-1 n=6 k=4 5 3 2 6 4 1 acceptedSolution=6 wrongSolution=-1 n=6 k=4 5 3 4 1 2 6 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 3 4 2 6 1 acceptedSolution=8 wrongSolution=-1 n=6 k=4 5 3 4 6 1 2 acceptedSolution=6 wrongSolution=-1 n=6 k=4 5 3 6 1 4 2 acceptedSolution=8 wrongSolution=-1 n=6 k=4 5 3 6 2 1 4 acceptedSolution=6 wrongSolution=-1 n=6 k=4 5 3 6 4 2 1 acceptedSolution=10 wrongSolution=-1 n=6 k=4 5 4 1 3 2 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 5 4 1 6 3 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 4 2 1 3 6 acceptedSolution=8 wrongSolution=-1 n=6 k=4 5 4 2 3 6 1 acceptedSolution=6 wrongSolution=-1 n=6 k=4 5 4 3 2 1 6 acceptedSolution=5 wrongSolution=-1 n=6 k=4 5 4 6 1 2 3 acceptedSolution=6 wrongSolution=-1 n=6 k=4 5 4 6 2 3 1 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 4 6 3 1 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 6 1 2 3 4 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 6 1 4 2 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 5 6 2 3 1 4 acceptedSolution=6 wrongSolution=-1 n=6 k=4 5 6 3 1 2 4 acceptedSolution=8 wrongSolution=-1 n=6 k=4 5 6 3 2 4 1 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 6 4 1 3 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 6 4 2 1 3 acceptedSolution=7 wrongSolution=-1 n=6 k=4 5 6 4 3 2 1 acceptedSolution=8 wrongSolution=-1 n=6 k=4 6 1 2 4 3 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 6 1 2 5 4 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 6 1 3 2 4 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 6 1 3 4 5 2 acceptedSolution=8 wrongSolution=-1 n=6 k=4 6 1 3 5 2 4 acceptedSolution=10 wrongSolution=-1 n=6 k=4 6 1 4 2 5 3 acceptedSolution=9 wrongSolution=-1 n=6 k=4 6 1 4 3 2 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 6 1 4 5 3 2 acceptedSolution=6 wrongSolution=-1 n=6 k=4 6 1 5 2 3 4 acceptedSolution=7 wrongSolution=-1 n=6 k=4 6 1 5 3 4 2 acceptedSolution=8 wrongSolution=-1 n=6 k=4 6 2 1 3 4 5 acceptedSolution=5 wrongSolution=-1 n=6 k=4 6 2 1 5 3 4 acceptedSolution=6 wrongSolution=-1 n=6 k=4 6 2 3 4 1 5 acceptedSolution=8 wrongSolution=-1 n=6 k=4 6 2 4 1 3 5 acceptedSolution=9 wrongSolution=-1 n=6 k=4 6 2 4 3 5 1 acceptedSolution=7 wrongSolution=-1 n=6 k=4 6 2 5 1 4 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 6 2 5 3 1 4 acceptedSolution=10 wrongSolution=-1 n=6 k=4 6 2 5 4 3 1 acceptedSolution=6 wrongSolution=-1 n=6 k=4 6 3 1 2 5 4 acceptedSolution=6 wrongSolution=-1 n=6 k=4 6 3 1 4 2 5 acceptedSolution=10 wrongSolution=-1 n=6 k=4 6 3 1 5 4 2 acceptedSolution=6 wrongSolution=-1 n=6 k=4 6 3 2 1 4 5 acceptedSolution=8 wrongSolution=-1 n=6 k=4 6 3 2 4 5 1 acceptedSolution=5 wrongSolution=-1 n=6 k=4 6 3 2 5 1 4 acceptedSolution=6 wrongSolution=-1 n=6 k=4 6 3 4 1 5 2 acceptedSolution=5 wrongSolution=-1 n=6 k=4 6 3 4 2 1 5 acceptedSolution=6 wrongSolution=-1 n=6 k=4 6 3 4 5 2 1 acceptedSolution=5 wrongSolution=-1 n=6 k=4 6 3 5 1 2 4 acceptedSolution=7 wrongSolution=-1 n=6 k=4 6 3 5 2 4 1 acceptedSolution=11 wrongSolution=-1 n=6 k=4 6 3 5 4 1 2 acceptedSolution=7 wrongSolution=-1 n=6 k=4 6 4 1 2 3 5 acceptedSolution=7 wrongSolution=-1 n=6 k=4 6 4 1 3 5 2 acceptedSolution=10 wrongSolution=-1 n=6 k=4 6 4 1 5 2 3 acceptedSolution=7 wrongSolution=-1 n=6 k=4 6 4 2 1 5 3 acceptedSolution=8 wrongSolution=-1 n=6 k=4 6 4 2 3 1 5 acceptedSolution=8 wrongSolution=-1 n=6 k=4 6 4 2 5 3 1 acceptedSolution=11 wrongSolution=-1 n=6 k=4 6 4 3 1 2 5 acceptedSolution=6 wrongSolution=-1 n=6 k=4