INCREASE YOUR SKILLS SOLUTIONS CFS2001

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 ? 
 
Info: 
 
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. 
 
Yield: 
 
For each testcase, yield in a solitary line number of inquiries illuminated on nth day. 
 
Limitations 
 
1≤T≤15 
 
1≤a≤99 
 
1≤d≤100 
 
1≤n≤10000 
 
1≤k≤n 
 
0≤inc≤99 
 
Test Input: 
 
 
1 4 3 8 2 
 
Test Output: 
 
43 
 
Clarification: 
 
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).
 
Related :

Leave a Comment

close
error: Content is protected !!