Submit | All submissions | Best solutions | Back to list |
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
Input consists of t (number of test cases), then t line follows, each containing an integer N (1 <= N <= 10,000).
Output
A single line containing the sum upto Nth integer (rounded upto 5 digits)
Example
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 !!!
1
2
3
4
5
Output: 0.33333
0.42857
0.46154
0.47619
0.48387
Added by: | Better late than never !!! |
Date: | 2012-06-20 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | RamjiLal Sir |
hide comments
|
||||||||||
2013-08-09 15:41:18 Mostafa 36a2
I told you @Mitch :) I'm afraid of 34-byte code :D Thank God |
||||||||||
2013-08-07 06:44:59 Mostafa 36a2
@Ouditchya Sinha Thanks Man ,wish you do better :) I'm stuck now in SQDIFF ,it's nice but 42 byte is a bit tough there :p |
||||||||||
2013-08-06 18:35:39 Ouditchya Sinha
Oh! I wish I could cut down the last couple bytes & make it 35B. @ Mostafa 36a2 (Al3ayesh) : Congratulations Again Man! You are on fire. :) |
||||||||||
2013-08-01 10:57:12 Mostafa 36a2
OK,sorry for this ,i'm just afraid of 34-byte code :D the 35 one is on :) also i'm sure you can do it :) Enjoy Last edit: 2013-08-01 11:01:17 |
||||||||||
2013-08-01 10:24:29 Mitch Schwartz
@Mostafa: I also prefer you to resubmit the 35-byte solution, but of course it's your choice. (Unless you have a reason for disqualifying other than what you mentioned, e.g. relying on broken test data.) Last edit: 2013-08-02 02:35:13 |
||||||||||
2013-08-01 09:03:22 Mostafa 36a2
Actually , I only want the points :p so my 36-byte will be enough for now :) good job @ওয়াসী (Wasi) ;) (Edit): I've disqualified it , I don't want to be alone in the rank list :p any way, there is a 35-byte if some buddy reach it i'll resubmit my code . Last edit: 2013-08-01 09:33:41 |
||||||||||
2013-08-01 08:05:05 ওয়াসী (Wasi)
oh man! after trying hard when i managed a 36B solution,now the best score is 35B! thank you Mostafa. Edit: Strange, 35 B solution vanished! Mostafa please keep your 35B solution buddy. Its a motivation for me. I will try harder to reach it No problem at all :) Last edit: 2013-08-01 09:10:37 |
||||||||||
2013-08-01 06:05:53 Mostafa 36a2
@Mitch :D following your steps Boss ;) |
||||||||||
2013-08-01 05:59:24 Mitch Schwartz
@Mostafa: Congrats! :) Intrigued... |
||||||||||
2013-08-01 02:22:49 Mostafa 36a2
Thank GOD :) |