Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

Comments

I came up with the pre computation technique as it can be func[1] = 1; func(n) = func(n-1) + i*(i-1) + i*i

but the problem is the size of any data structures can't exceed 10^7-10^8 and the TLE is also a problem . if anyone got it fix it ..