#P1727. 计算π

计算π

Description

As the Mid-Autumn Festival arrives, the clattering sounds of bo bing (博饼) are unceasing. Aiyuchou, excited to play bo bing at school, ends up bringing home only "Yi Xiu" and "Er Ju". Furious, Aiyuchou calls Yueluo Wuti: "Hey, help me compute the digits of pi after the decimal point up to n(n10000)n(n \le 10000) places, quickly..." and hangs up, not knowing Yueluo Wuti was about to go to class. Yueluo Wuti then turns to you, asking you to write a program to compute the digits of pi after the decimal point up to nn places.

Input Format

One line containing an integer nn.

Output Format

The output contains multiple lines.

On the first line, print the string 3.\verb!3.!.

Starting from the second line, output the fractional part of pi. Insert a space after every 1010 digits, and insert a newline after every 5050 digits.

100
3.
1415926535 8979323846 2643383279 5028841971 6939937510
5820974944 5923078164 0628620899 8628034825 3421170679

Hint

For 30%30\% of the testdata, n103n\leq 10^3.

For 100%100\% of the testdata, n104n\leq 10^4.

Time limit: test points 161\sim 6: 11 second; test point 77: 33 seconds; test point 88: 88 seconds; test points 9109\sim 10: 1212 seconds.

Translated by ChatGPT 5