AP2  AP  Complete The Series (Easy)
Arithmatic and geometric Progressions are 2 of the well known progressions in maths.
Arithmatic progression(AP) is a set in which the difference between 2 numbers in constant. for e.g., 1, 3, 5, 7, 9 .... In this series the difference between 2 numbers is 2.
The task here is very simple indeed.
You will be given the 3rd term , 3rd last term and the sum of the series. You need print length of the series & 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' ,'3Lastterm' and 'sum'
3termĀ  is the 3rd term in of the series and
3LasttermĀ  is the 3rd term in of 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  the number of terms in the series.
2nd line of the output should print the series numbers separated by single space.
Example
Input: 1 3 8 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)
hide comments
Kishlay Raj:
20150101 12:11:03
strict timing i wud say 

sathya_dev:
20141217 19:39:18
Same solution got TLE in JAVA. Got AC in C++ 

Abhishek Deora:
20141208 16:03:50
dont print \n in the end ... i got many wrong answers bcoz of dat . 

PRAFFUL MEHROTRA:
20141202 11:51:25
AC in first!! 

Akshay Madan:
20141103 17:13:07
this problem is not for java 

shobhit kumar:
20141027 15:08:48
easy one AC in first :) 

Anup AK:
20141026 21:48:50
used long long int and get AC..


Amit Jaiswal:
20141004 13:27:56
for case where n=5


Shankar Chaudhary:
20141002 08:53:08
its wrking properly in my compiler bt why its showing wrong answer in it even its wrking in ideone.com 

ViKku:
20140926 19:38:22
yes got AC in First

Added by:  Devil D 
Date:  20120313 
Time limit:  0.100s 
Source limit:  1500B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  Own 