This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define sz(v) (int)(v).size()
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
ll n, k;
cin >> n >> k;
vector <ll> a(n+1);
for(int i = 1; i <= n; i++){
cin >> a[i];
}
if(n % k != 0){
cout << -1;
return 0;
}
cout << n/k << '\n';
for(int i = 1; i <= n; i += k){
cout << a[1] << " ";
for(int j = i; j < i+k; j++){
cout << j << ' ';
}
cout << '\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |