Guest User

week14- C. Score Distribution 2, Author Solution

a guest
Nov 26th, 2016
1,429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. int N,p[200001];
  3. int main(){
  4.     int x,y;
  5.     scanf("%d%d",&x,&y);
  6.     N=x;
  7.     if(y*2+1>N)puts("Impossible");
  8.     else{
  9.         printf("%d\n",N);
  10.         for(int i=1;i<=(N+1)/2;i++)printf("%d ",y);
  11.         for(int i=(N+1)/2+1;i<=N;i++)printf("%d%c",y+1," \n"[i==N]);
  12.     }
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment