Question: You should complete the function and ensure it produces the correct output against all test cases possible within the constraints highlighted. The runtime of the

You should complete the function and ensure it produces the correct output against all test cases possible within the constraints highlighted. The runtime of the program is important so it is best to use an algorithm in the code which will not timeout You should complete the function and ensure it produces the correctoutput against all test cases possible within the constraints highlighted. The runtime

Power Leveling Problem Submissions Leaderboard Discussions fin In a certain Role Playing Game (RPG) character development is measured in discrete levels. A new character starts out, with zero experience poitns, at level o, and moves up in levels by earning sufficient experience points to be promoted. Characters gain experience points by embarking upon and completing quests and engaging in various activities. Assessment for a promotion is done at a base camp in the game, so characters must return to that base camp in order to see whether the amount of experience points that they have accumulated since their last visit are sufficient to grant them a promotion. On a single visit, a character is promoted by as many levels as their accumulated experience points warrant. Contest ends in 6 days Submissions: 17 Max Score: 25 Difficulty: Medium Rate This Challenge: More At Level 0, a character requires a experience points to attain Level 1. For each Level afterwards, the amount of experience required to promote a character to level 6+1 is always b more than it was at the previous level. (So, for example, it requires a+b experience points to be promoted from Level 1 to 2, and a + 2b experience points to be promoted from Level 2 to Level 3.) We are told that a character with experience points has just left the base camp and obtained all the promotions that it was entitled to up to that point, and then it makes a sequence of e excursions, with each excursion returning to the base camp to be promoted as far as possible, before embarking upon the next one. Given the sequence of points earned on each excursion: P1,...,Pe, we are asked to determine the highest level that the character would have attained after each excursion. Input Format Two lines of space separated integers: Line 1: a b x 6 Line 2: p_l ... p_e Constraints 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!