#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double sum, eps, prev,next,dif;
int i;
eps=1e-10;
prev=1; next=-1/3.0;
i=2; sum=1;
dif=abs(next-prev);
while (dif>eps)
{
sum=sum+next;
prev=next;
next=prev*(-1)/((2*i+1)*i);
i=i+1;
dif=abs(prev-next);
}
cout << "sum="<< sum << "\n" << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmludCBtYWluKCkgCnsKIGRvdWJsZSBzdW0sIGVwcywgcHJldixuZXh0LGRpZjsKIGludCBpOwogZXBzPTFlLTEwOwogcHJldj0xOyBuZXh0PS0xLzMuMDsKIGk9Mjsgc3VtPTE7CiBkaWY9YWJzKG5leHQtcHJldik7CiB3aGlsZSAoZGlmPmVwcykKIHsKICAgICBzdW09c3VtK25leHQ7CiAgICAgcHJldj1uZXh0OwogICAgIG5leHQ9cHJldiooLTEpLygoMippKzEpKmkpOwogICAgIGk9aSsxOwogICAgIGRpZj1hYnMocHJldi1uZXh0KTsKIH0KIGNvdXQgPDwgInN1bT0iPDwgc3VtIDw8ICJcbiIgPDwgZW5kbDsKIHJldHVybiAwOwp9