Ad
  • Custom User Avatar

    You can work for up to k consecutive days,

    Up to k days or exactly k days?

  • Custom User Avatar

    Why

    Work for days 1 to 3: 50 + 60 + 70 = 180
    Take a break on day 4
    Work for days 5 to 7: 80 + 90 + 100 = 270
    Last day: 20
    Total earnings = 180 + 270 + 20 = 470

    and not

    Work for days 1 to 3: 50 + 60 + 70 = 180  
    Take a break on day 4  
    Work for days 5 to 7: 80 + 90 + 100 = 270  
    Take a break on day 8 (last day)          <-------
    Total earnings = 180 + 270 = 450          <-------