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-04-06 09:54:51 Prashant Gupta
@devil:plzz help
submission 6754789 ID
again & again wrong answer :(
2012-04-06 09:54:51 DivineAtheist
plz check my solution id 6756679.......getting WA....cant find the mistake....plzzz help......:(..:(
2012-04-06 09:54:51 Prashant Gupta
<snip>
hope now WA should not come
but still coming
can u tell just one such case :(
plzzz help!!

Last edit: 2022-08-15 20:52:50
2012-04-06 09:54:51 Prashant Gupta
@Paweł Mroziński:
i m also getting WA
though getting correct answer for
2
728190161165704306 728190161165682931 6553711450491210504
1018311893057538647 1018311893057538623 7128183251402770361

plzzz help!!


------
u r getting wrong answer for 10% of the cases


Last edit: 2012-03-30 08:33:28
2012-04-06 09:54:51 aman garg
@devil can you please have a look at my solution my solution id:6749777 .got tired of trying.

-------
you are printings 0's for length of the series.. which is wrong

Last edit: 2012-03-30 08:34:20
2012-04-06 09:54:51 Prashant Gupta
what's wrong plzz chk TLE...6749646
2012-04-06 09:54:51 legrand
@Ankit
the output for 5 1 25 with my AC code
is the same as your's.


--------test cases are designed to output only positive values..

Last edit: 2012-03-28 03:55:05
2012-04-06 09:54:51 Gopal Rander
@devil.. Plz tell what is wrong with my code 6725124.. Tired of trying.. :(
2012-04-06 09:54:51 Ankit Paharia
anyone plzz tell the output for
5 1 25....
those who got AC !!!
2012-04-06 09:54:51 Pawe³ Mroziñski
AC!
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.