SUMUP - Sum the Series
Nilendu is a brilliant student of Mathematics and always scores A+ in it. His professor RamjiLal is quite impressed seeing his mathematical skills and asks him to sum the following series:
1/3 + 2/21 + 3/91 + 4/273 + .....
But the fact is Nilendu is quite lazy to do his assignment. He has to watch a film and many other activities to do. So he asks you for your help. Will you be able to solve it ??
Input consists of t (number of test cases), then t line follows, each containing an integer N (1 <= N <= 10,000).
A single line containing the sum upto Nth integer (rounded upto 5 digits)
Input: 5Edit: The score is your source length. The smaller your code is, the more point you will get. All the solutions have been rejudged !!!
190 with kotlin :)
128 in C++ hehe XD
135 in c
210 in C. It helps if you filter \n and \t from the code (except for the beginning \n and the one printing).
244 in c !
41 in Perl. I'm still trying to improve my code :)
@ Chinmaya Kumar Patanaik:Bro your code does not presize in case of
76 in ruby.. Well I need some more golfing practice I guess. :/
I got internal error. What that's mean?
481 C++ :) fast I