In 09.03.2019 there will be COCI exam in this link: http://hsin.hr/coci/ You can study for the old COCI's here: https://oj.uz/problems/source/122 Also this site has an online judge. The contest will begin at:09.03.2019 14:00 GMT/UTC and it will take three hours.
UPD1: Last 4 hours...
Thank you for announcement.
Np.
Auto comment: topic has been updated by Ahmet.K37 (previous revision, new revision, compare).
Last 3 days.
Auto comment: topic has been updated by Ahmet.K37 (previous revision, new revision, compare).
Let me give Sličice's solution. You will do dp for this question.You will keep two things in recursive.(Index and how many bonus you have)
Then you use for in recursive for how many times you use bonus for this index . Then you will take max.
This is the code: https://paste.ubuntu.com/p/twNKyCZBjS/