Last active
November 19, 2018 16:07
-
-
Save dipta10/aae2a8e8d1743911f1075ab9f9568165 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Created by Dipta Das on 8/11/18. | |
| // Problem link: http://codeforces.com/contest/1016/problem/A | |
| // Solution link: https://gist.github.com/dipta10/aae2a8e8d1743911f1075ab9f9568165/ | |
| #include <stdio.h> | |
| #include <iostream> | |
| using namespace std; | |
| typedef long long ll; | |
| typedef unsigned long long llu; | |
| int main () | |
| { | |
| // freopen("input", "r", stdin); | |
| ll n, m, x, current_line = 0, ans = 0, new_value_of_x; | |
| scanf("%lld %lld", &n, &m); | |
| for (int i = 1; i <= n; ++i) { | |
| scanf("%lld", &x); | |
| new_value_of_x = x + current_line; | |
| ans = new_value_of_x / m; | |
| current_line = new_value_of_x % m; | |
| printf("%lld", ans); | |
| if (i != n) printf(" "); | |
| } | |
| puts(""); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment