This post is all about the solution of the E. Game of the Year Educational Codeforces Round 141 (Rated for Div. 2) Problem Solution.

E. Game of the Year Educational Codeforces Round 141 (Rated for Div. 2) Problem Solution

Codeforces



Problem Statement :

Monocarp and Polycarp are engaged in computer gaming. This game has n bosses for the player to defeat, numbered from 1 to n.

They will fight each boss as follows:

Monocarp attempts k times to kill the boss; Polycarp attempts k times to kill the boss; Monocarp attempts k times to kill the boss; Polycarp attempts k times to kill the boss;...
On his ai-th attempt, Monocarp kills the i-th boss. On his bi-th attempt, Polycarp kills the i-th boss. They move on to the (i+1)-st boss after one of them kills the i-th boss. Both of their attempt counters were reset. The game ends when one of them kills the n-th boss.

Find all k values from 1 to n that are such.


Format of Input :

The first line contains a single integer t (1t2000) indicating the number of test cases.
Evey test case is made up of two lines. The first line has a single integer n (2n50). The second line has n integers a1,a2,...,an (1a12an100).


Format of the Output :

Print one integer indicating the number of accessible arrays. Because the answer could be quite large, print its remainder modulo 998244353.


New Upcoming OnePlus 11 Specifications

New Upcoming OnePlus 11 Specifications, Click Here

Also Check this out:-

A. Make it Beautiful Educational Codeforces Round 141 (Rated for Div. 2) Problem Solution, Click Here
B. Matrix of Differences Educational Codeforces Round 141 (Rated for Div. 2) Problem Solution, Click Here
C. Yet Another Tournament Educational Codeforces Round 141 (Rated for Div. 2) Problem Solution, Click Here
D. Different Arrays Educational Codeforces Round 141 (Rated for Div. 2) Problem Solution, Click Here
E. Game of the Year Educational Codeforces Round 141 (Rated for Div. 2) Problem Solution, Click Here
Solution of the Problem: Click Here