Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void read_and_write()
- {
- int k, m, d,s=1, books=0;
- cin >> k >> m >> d;
- int kdays = d;
- if (d < 6)
- books = k + m-s;
- else
- books = m-s;
- while (books >= 0)
- {
- kdays++;
- s++;
- if (kdays%8 < 6)
- books = k + books-s;
- else
- books = books - s;
- }
- cout << kdays - d<< endl;
- }
- int main()
- {
- read_and_write();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment