Wael is playing a game called Balls and Boxes. There are N boxes in a row, each box i
has a strength S[i].
It is given that Wael can initially throw a ball into any box he wants. When a ball gets
inside some box i, two things will happen:
First, this ball will now jump into the box (i + S[i])
Second, the strength of the box i will get decreased by 1. If the strength of box i is
equal to 1, it won't be changed.
Wael wants to make the strength S[i] equal to 1 for all (1 <=i<= N). Your task is to find
the minimum number of balls that he needs to throw manually. Since the answer can be
large return the final answer modulo 10^9+7.
Input Format
The first line contains an integer, N, denoting the number of boxes.
The next N lines contains an integer, S[], denoting the strength of i-th box.
Answers
Answered by
0
Answer:
On 28 June 1914, Archduke Franz Ferdinand, the heir to the Austro-Hungarian throne, and his wife were assassinated by a Serbian-backed terrorist. During the crisis that followed, Europe's leaders made a series of political, diplomatic and military decisions that would turn a localised conflict in south-east Europe into a global war.
Austria-Hungary, with German encouragement, declared war on Serbia on 28 July. Russia's support of Serbia brought France into the conflict. Germany declared war on Russia on 1 August and France on 3 August. Germany's violation of Belgian neutrality and British fears of German domination in Europe brought Britain and its empire into the war on 4 August.
please mark as brainlist
Similar questions