Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. twonum = input().split()
  2. socks = int(twonum[0])
  3. newsocks = int(twonum[1])
  4. days = 0
  5.  
  6. while socks > 0:
  7. socks -= 1
  8. if newsocks > 1:
  9. newsocks -= 1
  10. elif newsocks == 1:
  11. socks += 1
  12. newsocks = int(twonum[1])
  13. days += 1
  14.  
  15. print(days)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement