#include <bits/stdc++.h>
using namespace std;
int main()
{
cin.tie(0)->sync_with_stdio(0);
int n, K; cin >> n >> K;
vector<long long> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
if (a[0] * n % K != 0)
{
cout << -1 << '\n';
return 0;
}
vector<vector<int>> ans;
for (int i = 0; i < n * K; i += K)
{
ans.emplace_back();
for (int j = i; j < i + K; j++)
ans.back().emplace_back(j % n);
}
cout << ans.size() << '\n';
for (auto &vec : ans)
{
cout << a[0] * n / K << ' ';
for (int j = 0; j < K; j++)
cout << vec[j] + 1 << " \n"[j == K - 1];
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Taken too much stones from the heap |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Taken too much stones from the heap |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Taken too much stones from the heap |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
369 ms |
95996 KB |
Taken too much stones from the heap |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Taken too much stones from the heap |
2 |
Halted |
0 ms |
0 KB |
- |