Advertisement
Guest User

Untitled

a guest
May 24th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. def solve_dumb(k,m,d):
  2.     count = 0
  3.     books_today = 1
  4.     holiday_count = 0
  5.     while True:
  6.         m -= books_today
  7.         books_today += 1
  8.         if (d%7) == 0 or (d%7) == 6:
  9.             pass
  10.             holiday_count += 1
  11.         else:
  12.             m += k
  13.  
  14.         if m < 0:
  15.             break
  16.         else:
  17.             d += 1
  18.             count += 1
  19.  
  20.         # print(books_today-1, m, d)
  21.  
  22.     # print('holi', holiday_count)
  23.     return count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement