Submit | All submissions | Best solutions | Back to list |
AP3 - AP - Complete The Series v2 |
After solving "AP - Complete The Series (easy)" very fast, Lucifer decided to make it little more interesting.
He said
He will be give you the 3rd term, 4th last term and the sum of the AP series. You need print length of the series and the series.
Input
First line will contain a number indicating the number of test cases.
Each of the following t lines will have 3 number '3term' ,'4Lastterm' and 'sum'
3termĀ - is the 3rd term in the series and
4LasttermĀ - is the 4th last term in the series and
sum - is the sum of the series.
Output
For each input of the test case, you need to print 2 lines.
first line should have 1 value - number of terms in the series.
second line of the output should print the series numbers separated by single space.
Example
Input: 1
3 7 55
Output:
10
1 2 3 4 5 6 7 8 9 10
NOTE
In all the test cases all the series elements are positive integers.
The series will have at least 7 elements.
Number of test cases <=100.
All the numbers will fit in 64 bits (long long in C)
Added by: | Devil D |
Date: | 2012-03-13 |
Time limit: | 0.100s |
Source limit: | 10000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Own |
hide comments
|
|||||||||||||
2013-05-30 09:47:02 W.A.P to
whats test case 8??? cost m 7 wa??? still no ac... help.. |
|||||||||||||
2013-05-29 16:19:16 NARUTO (y)
9374317 my ans satisfy all the test cases still got wa anybody help me. |
|||||||||||||
2013-05-25 18:51:25 Gaurav Parida
getting wrong ans..please check...soln id 9346637 |
|||||||||||||
2013-05-20 14:06:32 kayfunk
wow.... great problem,learned a new thing and njoyed solving it...:) |
|||||||||||||
2013-05-18 07:28:43 Parshant garg
9289975 pls check my code.. getting WA |
|||||||||||||
2013-05-14 18:57:32 NodaR M JarraR
@KIRA u r deviding on zero ... this type of runtimeError appears when u div on 0...... Last edit: 2013-05-14 18:57:53 |
|||||||||||||
2013-05-05 20:13:51 KIRA
please could someone tell me why I'm getting runtime error i did't even use the sqrt of c++ my id is:9208181 Last edit: 2013-05-05 20:35:15 |
|||||||||||||
2013-03-18 07:03:30 Himanshu
@Devil D please tell me why my code is giving WA at 8th case Last edit: 2016-01-01 01:26:53 |
|||||||||||||
2013-03-13 16:01:52 king
Can any one tell me why <snip> is giving me a WA? Last edit: 2022-08-15 20:50:05 |
|||||||||||||
2013-02-27 17:38:37 checks
Please check my submission ID 8795795. Any tricky test case???? Last edit: 2013-02-27 17:44:56 |