Submission #472253

#TimeUsernameProblemLanguageResultExecution timeMemory
472253MamdouhNNadan (COCI18_nadan)C++14
15 / 50
1 ms204 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define endl "\n" main() { int n,k; cin>>k>>n; k-=(n*(n+1))/2; int extra=k%n; int addtoall=(k-(k%n))/n; for(int i=0;i<n;i++) { int x = (i+1)+addtoall; if(i==n-1)x+=extra; cout<<x<<endl; } }

Compilation message (stderr)

nadan.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...