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
|
|||||||||||||
2012-06-21 20:03:31 Rohit
can you please tell me a single case where my soln fails..??? id=7191204 Last edit: 2012-06-21 20:04:11 |
|||||||||||||
2012-06-13 04:37:42 MR. BEAN
forum helped me.... learned a new thing and got AC :D Last edit: 2012-06-13 04:38:51 |
|||||||||||||
2012-05-31 09:11:28 Pranshul Agarwal
plz chk my soln id 7066595...dont know why i m getting WA [EDIT] got AC... Precision needs to be handled with care... A ques of right datatype for right variable.. Last edit: 2012-07-01 14:21:18 |
|||||||||||||
2012-05-31 06:17:36 darkhorse
@DevilD plz check my solutions 7066002,7066001 i had tried evrythng but nothng is working.. |
|||||||||||||
2012-05-18 14:05:58 !!AV!!
@devil: can you please tell where my input is giving wrong answer? i am getting it write.. id:7006542 Last edit: 2012-05-18 14:06:16 |
|||||||||||||
2012-05-12 18:35:59 boygenius
Can you please check my solution (id = 6981899) and tell whats wrong with it. |
|||||||||||||
2012-04-06 09:54:51 DivineAtheist
finally accepted..:) |
|||||||||||||
2012-04-06 09:54:51 Ankit Paharia
@legrand: tht test case is not valid.... only positive test cases r designed.... juss chk for the precision errors !!! |
|||||||||||||
2012-04-06 09:54:51 ! include(L.ppt)
wow.... great problem, the real challenege is how to handle precision, see forum u can learn a new function, njoyed solving it...:) |
|||||||||||||
2012-04-06 09:54:51 sanctity
@devil can you please have a look at my solution my solution id:6761825 |