Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::array<int, 7> arr = {};
- if (count == 1) {
- arr[n]++;
- } else {
- int rem = n - 1 * (count - 1);
- while(rem > 6){
- int t = rem / 6;
- count-= t;
- arr[6]+= t;
- rem = n - (count - 1) - (arr[6] * 6);
- }
- arr[1] = count - 1;
- arr[rem]++;
- }
- for (int i = 1; i < 7; ++i) {
- cout << arr[i];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement