So I had this question in a programming contest about calculating Leibniz formula in the least amount of characters
With the input format to the code as: The first line contains an integer T (<=100). T testcases follow. Each testcase has a single line with a positive integer n (< 10^7). and the output with each result on a new line
Now I came up with these two alternates:
latest at 58 chars(thanks to melpomene):
With 62 and 61 characters respectively, where as the best answer had only 55 characters. Now that the contest is over and I cant see the other solution I cant stop obsessing about how to reduce the characters further.
I am hoping someone here can show me the light.