#include // #include using namespace std; using namespace numbers; int main(){ cin.tie(0)->sync_with_stdio(0); cin.exceptions(ios::badbit | ios::failbit); vector> left(301), right(301); for(auto x = 0; x <= 300; ++ x){ for(auto y = x; y <= 300; ++ y){ for(auto z = y; z <= 300; ++ z){ left[z].push_back(x * x * x + y * y * y); right[x].push_back(y * y * y + z * z * z); } } } for(auto x = 0; x <= 300; ++ x){ ranges::sort(left[x]); ranges::sort(right[x]); } int obj; cin >> obj; int res = 0; for(auto c = 0; c <= 300; ++ c){ for(auto d = c; d <= 300; ++ d){ for(auto cl = 0, dr = (int)right[d].size(); cl < (int)left[c].size(); ){ int cr = cl; while(cr < (int)left[c].size() && left[c][cl] == left[c][cr]){ ++ cr; } while(dr > 0 && right[d][dr - 1] > left[c][cl]){ -- dr; } int dl = dr; while(dl > 0 && right[d][dl - 1] == left[c][cl]){ -- dl; } res += (cr - cl) * (dr - dl); cl = cr; dr = dl; } } } cout << res << "\n"; return 0; } /* */ //////////////////////////////////////////////////////////////////////////////////////// // // // Coded by Aeren // // // ////////////////////////////////////////////////////////////////////////////////////////