INCREASE YOUR SKILLS SOLUTIONS CFS2001 CodeFusion 20.9
Kshitij has as of late began taking care of issues on codechef. As he is genuine critical thinking lover, he needs ceaseless development in number of issues understood every day. He began with an issues on first day.
He tackles d issues more than earlier day. Be that as it may, after each k days , he builds d by inc .
Would you be able to think about the number of inquiries he will illuminate on nth day ?
First line contains T, number of testcases. At that point the testcases follow.
Each testcase contains of a solitary line of input,five numbers a,d,k,n,inc.
For each testcase, yield in a solitary line number of inquiries illuminated on nth day.
1 4 3 8 2
The quantity of inquiries understood in initial 8 days is :
1 5 9 15 21 27 35 43 .
On first day he tackled 1 issue . Here d is 4 for initial 3 days. At that point following 3 days d increments by 2 (that is 6).