#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pb push_back
#define f first
#define s second
using namespace std;
void solve(){
ll n,k;cin>>n>>k;
ll a;
for(int i=1;i<=n;i++)cin>>a;
ll y=__gcd(n,k);
ll x=k/y;
ll m=a/x;
cout<<x<<"\n";
for(int i=0;i<n;i+=y){
cout<<m<<" ";
for(int j=0;j<k;j++){
cout<<(i+j)%n+1<<' ';
}
cout<<"\n";
}
}
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);
int test=1;//cin>>test;
while(test--){
solve();
cout<<"\n";
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Not all heaps are empty in the end |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Not all heaps are empty in the end |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Not all heaps are empty in the end |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
236 ms |
14680 KB |
Not all heaps are empty in the end |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Not all heaps are empty in the end |
2 |
Halted |
0 ms |
0 KB |
- |