I have put a question for a long time. Today, a is actually a formula. The only thing I think is that the placeholder for long in Windows is % i64d, however, it seems that the system uses Linux. For this reason, wR checked
Change to % LLD and then AC.
Solution:
For square blocks, it is better to look for the law. For example, the square with a side length of 4 is: 1 + 4 + 9 + 25 = 39. that is, the sum of the squares of the preceding edges. The three-dimensional four-dimensional values correspond to the cubic and the fourth power.
For rectangular cubes with different edges and lengths, the formula is required:
It can be found that in a graph, the side length with a side length of 1 has n optional positions on each of the largest sides. For example, the side length is 2 (that is, when n = 2 is input ), each maximum edge has n (n = 2) and N-1 (n-1 = 1) the optional position of a small side with a side length of 2, and so on... so the number of all possible edges in the rectangle is {n + (n-1) +... + 2 + 1} = N * (1 + N)/2, select either of the two possibilities
You can create a rectangle. And then subtract the number of rectangles. The number of edges may be equal ~
CodeAs follows:
# Include <iostream> # include <cstdlib> # include <cstring> # include <cstdio> # include <cmath> using namespace STD; int main () {# ifdef test freopen ("in.txt", "r", stdin); # endif int num; long int S2, R2, S3, R3, S4, R4; while (scanf ("% d", & num )! = EOF) {S2 = R2 = S3 = R3 = S4 = r4 = 0; For (INT I = 1; I <= num; I ++) {S2 + = I * I; S3 + = I * I; S4 + = I * I ;} long long int M = num * (Num + 1)/2; r2 = m * m-S2; R3 = m * m-S3; r4 = m * m-S4; printf ("% LLD \ n", S2, R2, S3, R3, s4, R4);} return 0 ;}