Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int n;
- int shekel[3];
- int count[3];
- cin >> n;
- for(int i = 0; i < 3; i++) {
- cin >> shekel[i];
- }
- for(int i = 2; i >= 0; i--) {
- count[i] = n / shekel[i];
- n -= shekel[i] * count[i];
- }
- for(int i = 0; i < 3; i++) {
- cout << count[i] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment