//Yukicoder //Q71 そろばん //二次元可変配列 //vector > mass; //vector > memo; //#include "stdafx.h" #include #include #include //list #include //tree #include //連想配列 #include //hash #include //hash #include #include using namespace std; typedef unsigned long long LL; #define START (0) #define RIGHT (1) #define UP (2) #define LEFT (3) #define DOWN (4) vector > memo; vector a; vector q; vector flag; #define DATA_MAX (1000000) int main() { LL N; LL n_up, n_down; LL total_down, total_up, all_total; LL max = 0; cin >> N; n_up = 0; n_down = N; while(1) { total_down = 1 * n_down; total_up = (n_down + 1) * n_up; all_total = total_down + total_up; if (max < all_total) max = all_total; n_up++; n_down--; if (n_up > N) break; } cout << max << endl; //getchar(); return 0; }