why this kolaverri spoj on September 14, 2017 in C++, Programming with No comments Sajib's Blog Why this kolaveri di spoj: #include <cstdio> using namespace std; int main(){ int T,n; scanf("%d",&T); while(T--){ scanf("%d",&n); int ans = 0; for(int i = 2;i <= n;++i) ans = (ans + n + 1 - i) % i; printf("%d\n",ans + 1); } return 0; } Share: Email ThisBlogThis!Share to XShare to Facebook
0 comments:
Post a Comment