problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p02606
C++
Runtime Error
#include <bits/stdc++.h> /* * coder :: ATUL_PANDEY_2608 * >>> INDIA <<< */ using namespace std; // #define part .. #define pb(a) push_back(a) #define all(a) a.begin(), a.end() #define mod 1000000007 #define maxx 200006 #define ll long long #define quick ios_base::sync_with_stdio(NULL), cin.tie(0); #define listll vector<long long> #define listi vector<int> #define pii pair<int, int> #define pll pair<long long, long long> #define minheap priority_queue<long long, vector<long long>, greater<long long>> #define rep(i, a, b) for (int i = a; i < b; i++) ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } // end of #define // define globals ... // write function from here ... int Main() { int a, b, d; cin >> a >> b >> d; int ans = 0; ans -= a / d; ans += b / d; if (a % d == 0) ans++; cout << ans; } int main() { quick; // #ifndef ONLINE_JUDGE // freopen ("input.txt", "r", stdin); // freopen ("outt.txt", "w", stdout); // #endif Main(); return 0; }
#include <bits/stdc++.h> /* * coder :: ATUL_PANDEY_2608 * >>> INDIA <<< */ using namespace std; // #define part .. #define pb(a) push_back(a) #define all(a) a.begin(), a.end() #define mod 1000000007 #define maxx 200006 #define ll long long #define quick ios_base::sync_with_stdio(NULL), cin.tie(0); #define listll vector<long long> #define listi vector<int> #define pii pair<int, int> #define pll pair<long long, long long> #define minheap priority_queue<long long, vector<long long>, greater<long long>> #define rep(i, a, b) for (int i = a; i < b; i++) ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } // end of #define // define globals ... // write function from here ... int Main() { int a, b, d; cin >> a >> b >> d; int ans = 0; ans -= a / d; ans += b / d; if (a % d == 0) ans++; cout << ans; return 0; } int main() { quick; // #ifndef ONLINE_JUDGE // freopen ("input.txt", "r", stdin); // freopen ("outt.txt", "w", stdout); // #endif Main(); return 0; }
insert
41
41
41
43
0
p02607
C++
Runtime Error
#include <iostream> using namespace std; int main() { int i, n; cin >> n; int a[i], c = 0; for (i = 0; i < n; i++) cin >> a[i]; for (i = 0; i < n; i++) { if (i % 2 == 0 && a[i] % 2 != 0) c++; } cout << c << endl; }
#include <iostream> using namespace std; int main() { int i, n; cin >> n; int a[n], c = 0; for (i = 0; i < n; i++) cin >> a[i]; for (i = 0; i < n; i++) { if (i % 2 == 0 && a[i] % 2 != 0) c++; } cout << c << endl; }
replace
5
6
5
6
-11
p02607
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, n = 0; cin >> N; vector<int> a(N); for (int i = 0; i < N; i++) { cin >> a.at(i); } for (int i = 1; i <= N; i++) { if (i % 2 != 0 && a.at(i) % 2 != 0) n++; } cout << n; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int N, n = 0; cin >> N; vector<int> a(N); for (int i = 0; i < N; i++) { cin >> a.at(i); } for (int i = 1; i <= N; i++) { if (i % 2 != 0 && a.at(i - 1) % 2 != 0) n++; } cout << n; return 0; }
replace
11
12
11
12
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)
p02607
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define LL long long #define mod 998244353 int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); LL N; cin >> N; LL x; LL count = 0; x = 1; while (x <= N) { LL y; cin >> y; if (x % 2 and y % 2) count++; x++; } cout << count; }
#include <bits/stdc++.h> using namespace std; #define LL long long #define mod 998244353 int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); LL N; cin >> N; LL x; LL count = 0; x = 1; while (x <= N) { LL y; cin >> y; if (x % 2 and y % 2) count++; x++; } cout << count; }
delete
7
9
7
7
TLE
p02607
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> a(N); for (int i = 0; i < N; i++) { cin >> a.at(i); } int count = 0; int M; if (N % 2 == 0) { M == N / 2; } else if (!(N % 2 == 0)) { M == N / 2 + 1; } if (N % 2 == 0) { for (int i = 0; i <= N / 2; i++) { if (!(a.at(2 * i) % 2 == 0)) { count++; } } } else if (!(N % 2 == 0)) { for (int i = 0; i <= (N - 1) / 2; i++) { if (!(a.at(i * 2) % 2 == 0)) { count++; } } } cout << count << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> a(N); for (int i = 0; i < N; i++) { cin >> a.at(i); } int count = 0; int M; if (N % 2 == 0) { M == N / 2; } else if (!(N % 2 == 0)) { M == N / 2 + 1; } if (N % 2 == 0) { for (int i = 0; i < N / 2; i++) { if (!(a.at(2 * i) % 2 == 0)) { count++; } } } else if (!(N % 2 == 0)) { for (int i = 0; i <= (N - 1) / 2; i++) { if (!(a.at(i * 2) % 2 == 0)) { count++; } } } cout << count << endl; }
replace
19
20
19
20
0
p02607
C++
Runtime Error
#include <bits/stdc++.h> #include <cstdio> #include <map> #include <math.h> #include <queue> #include <set> using namespace std; using ll = long long; int main() { int N; cin >> N; vector<int> a(N); int count = 0; for (int i = 1; i < N + 1; i++) { cin >> a.at(i); if (i % 2 == 1 && a.at(i) % 2 == 1) count++; } cout << count << endl; return 0; }
#include <bits/stdc++.h> #include <cstdio> #include <map> #include <math.h> #include <queue> #include <set> using namespace std; using ll = long long; int main() { int N; cin >> N; vector<int> a(N + 1); int count = 0; for (int i = 1; i < N + 1; i++) { cin >> a.at(i); if (i % 2 == 1 && a.at(i) % 2 == 1) count++; } cout << count << endl; return 0; }
replace
12
13
12
13
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)
p02607
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> vec(n); for (int i = 0; i < n; i++) { cin >> vec.at(i); } int ans = 0; for (int i = 1; i <= n; i++) { if ((i % 2 == 1) && (vec.at(i) % 2 == 1)) ans++; } cout << ans; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> vec(n); for (int i = 0; i < n; i++) { cin >> vec.at(i); } int ans = 0; for (int i = 0; i < n; i++) { if (((i + 1) % 2 == 1) && (vec.at(i) % 2 == 1)) ans++; } cout << ans; }
replace
13
15
13
15
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)
p02607
Python
Runtime Error
n = int(input()) a = list(map(int, input().split())) res = 0 for i in range(1, n + 1, 2): if a[i] % 2 != 0: res += 1 print(res)
n = int(input()) a = list(map(int, input().split())) res = 0 for i in range(0, n, 2): if a[i] % 2 != 0: res += 1 print(res)
replace
3
4
3
4
IndexError: list index out of range
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02607/Python/s671759343.py", line 5, in <module> if a[i] % 2 != 0: IndexError: list index out of range
p02607
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, c; c = 0; cin >> n; vector<int> vec(n); for (int i = 0; i < n; i++) { cin >> vec.at(i); } for (int i = 0; i < n; i + 2) { if (vec.at(i) % 2 == 1) { c++; } } cout << c << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, c; c = 0; cin >> n; vector<int> vec(n); for (int i = 0; i < n; i++) { cin >> vec.at(i); } for (int i = 0; i < n; i++) { if (i % 2 == 1) { continue; } if (vec.at(i) % 2 == 1) { c++; } } cout << c << endl; }
replace
11
12
11
15
TLE
p02607
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, cnt = 0; cin >> N; vector<int> N_a(N); for (int i = 0; i < N; i++) { cin >> N_a.at(i); } for (int i = 0; N; i++) { if ((i + 1) % 2 == 1 && N_a.at(i) % 2 == 0) { cnt++; } } cout << cnt << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, cnt = 0; cin >> N; vector<int> N_a(N); for (int i = 0; i < N; i++) { cin >> N_a.at(i); } for (int i = 0; i < N; i++) { if ((i + 1) % 2 == 1 && N_a.at(i) % 2 == 1) { cnt++; } } cout << cnt << endl; }
replace
10
12
10
12
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 6) >= this->size() (which is 5)
p02607
C++
Runtime Error
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for (auto &x : a) { cin >> x; } int t = n; if (t % 2 == 1) { t--; } int ans = 0; for (int i = 0; i <= t; i += 2) { if (a.at(i) % 2 == 1) { ans++; } } cout << ans << endl; }
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for (auto &x : a) { cin >> x; } int t = n - 1; int ans = 0; for (int i = 0; i <= t; i += 2) { if (a.at(i) % 2 == 1) { ans++; } } cout << ans << endl; }
replace
13
17
13
14
0
p02607
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N = 0; int count = 0; cin >> N; vector<int> data(N); for (int i = 0; i < N; i++) { cin >> data.at(i); } for (int i = 0; i < data.size(); i++) { if (data.at(2 * i) % 2 == 0) count++; } cout << count << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int N = 0; int count = 0; cin >> N; vector<int> data(N); for (int i = 0; i < N; i++) { cin >> data.at(i); } for (int i = 0; i < data.size(); i += 2) { if (data.at(i) % 2 != 0) count++; } cout << count << endl; return 0; }
replace
11
13
11
13
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 6) >= this->size() (which is 5)
p02607
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vi; #define INF (1e9) int main() { int N; cin >> N; vi a(N); ll ans = 0; for (ll i = 1; i <= N; i++) { cin >> a[i]; if (a[i] % 2 == 1 && i % 2 == 1) ans++; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vi; #define INF (1e9) int main() { int N; cin >> N; vi a(N + 1); ll ans = 0; for (ll i = 1; i <= N; i++) { cin >> a[i]; if (a[i] % 2 == 1 && i % 2 == 1) ans++; } cout << ans << endl; }
replace
10
11
10
11
-6
Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
p02607
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { int N, ans; cin >> N; ans = 0; vector<int> a(N); for (int i = 0; i < N; i++) { cin >> a.at(N); } if (N % 2 == 0) { for (int j = 0; j < N / 2; j++) { if (a.at(2 * j) % 2 == 1) { ans = ans + 1; } } } else { for (int k = 0; k < (N + 1) / 2; k++) { if (a.at(2 * k) % 2 == 1) { ans = ans + 1; } } } cout << ans << endl; }
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #include <vector> using namespace std; int main() { int N, ans; cin >> N; ans = 0; vector<int> a(N); for (int i = 0; i < N; i++) { cin >> a.at(i); } if (N % 2 == 0) { for (int j = 0; j < N / 2; j++) { if (a.at(2 * j) % 2 == 1) { ans = ans + 1; } } } else { for (int k = 0; k < (N + 1) / 2; k++) { if (a.at(2 * k) % 2 == 1) { ans = ans + 1; } } } cout << ans << endl; }
replace
12
13
12
13
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 5) >= this->size() (which is 5)
p02607
Python
Runtime Error
N = int(input()) li = [] for i in input().split(): li.append(int(i)) a = 1 count = 0 for i in li: if a % 2 == 1 and li % 2 == 1: count += 1 a += 1 print(count)
N = int(input()) li = [] for i in input().split(): li.append(int(i)) a = 1 count = 0 for i in li: if a % 2 == 1 and i % 2 == 1: count += 1 a += 1 print(count)
replace
8
9
8
9
TypeError: unsupported operand type(s) for %: 'list' and 'int'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02607/Python/s128008997.py", line 9, in <module> if a % 2 == 1 and li % 2 == 1: TypeError: unsupported operand type(s) for %: 'list' and 'int'
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define DEBUG 0 int main() { int N; cin >> N; vector<int> counter_n(N + 1, 0); for (int num = 1; num < N + 1; num++) { for (int i = 1; i < (int)sqrt(num) * 2; i++) { for (int j = i; j < (int)sqrt(num) * 2; j++) { for (int k = j; k < (int)sqrt(num) * 2; k++) { if (i * i + j * j + k * k == 2 * num) { #if DEBUG cout << i << j << k << num << endl; #endif int x2 = i + j - k; int y2 = i - j + k; int z2 = -i + j + k; if ((x2 > 0) && !(x2 & 1) && (y2 > 0) && !(y2 & 1) && (z2 > 0) && !(z2 & 1)) { if ((x2 == y2) && (y2 == z2)) { counter_n.at(num)++; } else if ((x2 != y2) && (x2 != z2) && (y2 != z2)) { counter_n.at(num) += 6; } else { counter_n.at(num) += 3; } } } } } } } for (int i = 1; i < N + 1; i++) { cout << counter_n.at(i) << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; #define DEBUG 0 int main() { int N; cin >> N; vector<int> counter_n(N + 1, 0); for (int num = 1; num < N + 1; num++) { for (int i = 1; i < (int)(sqrt(num) * 1.4); i++) { for (int j = i; j < (int)(sqrt(num) * 1.4); j++) { for (int k = j; k < (int)(sqrt(num) * 1.4); k++) { if (i * i + j * j + k * k == 2 * num) { #if DEBUG cout << i << j << k << num << endl; #endif int x2 = i + j - k; int y2 = i - j + k; int z2 = -i + j + k; if ((x2 > 0) && !(x2 & 1) && (y2 > 0) && !(y2 & 1) && (z2 > 0) && !(z2 & 1)) { if ((x2 == y2) && (y2 == z2)) { counter_n.at(num)++; } else if ((x2 != y2) && (x2 != z2) && (y2 != z2)) { counter_n.at(num) += 6; } else { counter_n.at(num) += 3; } } } } } } } for (int i = 1; i < N + 1; i++) { cout << counter_n.at(i) << endl; } return 0; }
replace
15
18
15
18
TLE
p02608
C++
Runtime Error
#pragma GCC optimze("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization("unroll-loops") // inbuilt function in c++ // abs(-2)=2 , __gcd(2,3)=1 , swap(a,b) , // string/array s = "aba"; sort(s.begin(), s.end()); do { cout << s << '\n'; // } while(next_permutation(s.begin(), s.end())); for all permutation of s. // priority_queue stores the values in descending order q.front() returns // maximum element. ".size() works for priority_queue." #include <bits/stdc++.h> #define int long long int #define double long double #define get(a, n) \ for (int i = 0; i < n; i++) { \ cin >> a[i]; \ } #define maxm(a) \ int maxi = LLONG_MIN; \ int index; \ for (int i = 0; i < n; i++) { \ if (maxi < a[i]) { \ maxi = a[i]; \ index = i; \ } \ } #define minm(a) \ int mini = LLONG_MAX; \ int index; \ for (int i = 0; i < n; i++) { \ if (mini > a[i]) { \ mini = a[i]; \ index = i; \ } \ } #define db(x) cout << "[" << x << "]" << endl; #define endl "\n" #define PI acos(-1) #define half(a) a % 2 ? (a / 2 + 1) : a / 2 #define array \ int a[n]; \ for (int i = 0; i < n; i++) { \ cin >> a[i]; \ } #define pb push_back #define all(a) a.begin(), a.end() #define mod 1000000007 using namespace std; int por(int x, int y, int p) { int res = 1; x = x % p; while (y > 0) { if (y & 1) res = (res * x) % p; y = y >> 1; x = (x * x) % p; } return res; } int modInverse(int n, int p) { return por(n, p - 2, p); } int nCrModPFermat(int n, int r, int p) { if (r == 0) return 1; int fac[n + 1]; fac[0] = 1; for (int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % p; return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p; } template <typename T> void printvec(vector<T> &vec) { for (int i = 0; i < vec.size(); i++) cout << vec[i] << " "; cout << endl; } bool cmp(const pair<int, int> &a, const pair<int, int> &b) { return (a.second < b.second); } vector<int> p; int fprime = 0; void seiveprime(int n) { fprime = 123; bool pr[n + 1]; memset(pr, true, sizeof(pr)); for (int p = 2; p * p <= n; p++) { if (pr[p] == true) { for (int i = p * p; i <= n; i += p) pr[i] = false; } } for (int p0 = 2; p0 <= n; p0++) if (pr[p0]) p.pb(p0); } void show(int *a) { int size = (*(&a + 1) - a) - 1; for (int i = 0; i < size; i++) { cout << a[i] << " "; } cout << endl; } int binary_search(int *a, int n, int e) { int f, l, m; f = 0; l = n - 1; while (f <= l) { // returns index of that value. m = (f + l) / 2; if (e == a[m]) return (m); else if (e > a[m]) f = m + 1; else l = m - 1; } return -1; } vector<int> pf; void primefactors(int n) { while (n % 2 == 0) pf.push_back(2), n = n / 2; for (int i = 3; i <= sqrt(n); i = i + 2) { while (n % i == 0) { pf.push_back(i); n = n / i; } } if (n > 2) pf.push_back(n); // dont forgot to clear pf vector. } // vector<int,greater<int>>fac; vector<int> fac; void factors(int n) { for (int i = 1; i <= sqrt(n); i++) { if (n % i == 0) { if (n / i == i) fac.push_back(i); else fac.push_back(i), fac.push_back(n / i); } } // dont forgot to clear fac vector. } void solve() { int n; cin >> n; int f[10001]; int k = sqrt(n - 2); for (int i = 0; i <= 10000; i++) { f[i] = 0; } int y = 0; for (int i = 1; i <= k; i++) { for (int j = 1; j <= k; j++) { for (int w = 1; w <= k; w++) { y = i * i + j * j + w * w + i * j + j * w + w * i; f[y]++; } } } for (int i = 1; i <= n; i++) { cout << f[i] << endl; } } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout << fixed << setprecision(15); int t = 1; // cin>>t; // seiveprime(1000); while (t--) { solve(); } }
#pragma GCC optimze("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization("unroll-loops") // inbuilt function in c++ // abs(-2)=2 , __gcd(2,3)=1 , swap(a,b) , // string/array s = "aba"; sort(s.begin(), s.end()); do { cout << s << '\n'; // } while(next_permutation(s.begin(), s.end())); for all permutation of s. // priority_queue stores the values in descending order q.front() returns // maximum element. ".size() works for priority_queue." #include <bits/stdc++.h> #define int long long int #define double long double #define get(a, n) \ for (int i = 0; i < n; i++) { \ cin >> a[i]; \ } #define maxm(a) \ int maxi = LLONG_MIN; \ int index; \ for (int i = 0; i < n; i++) { \ if (maxi < a[i]) { \ maxi = a[i]; \ index = i; \ } \ } #define minm(a) \ int mini = LLONG_MAX; \ int index; \ for (int i = 0; i < n; i++) { \ if (mini > a[i]) { \ mini = a[i]; \ index = i; \ } \ } #define db(x) cout << "[" << x << "]" << endl; #define endl "\n" #define PI acos(-1) #define half(a) a % 2 ? (a / 2 + 1) : a / 2 #define array \ int a[n]; \ for (int i = 0; i < n; i++) { \ cin >> a[i]; \ } #define pb push_back #define all(a) a.begin(), a.end() #define mod 1000000007 using namespace std; int por(int x, int y, int p) { int res = 1; x = x % p; while (y > 0) { if (y & 1) res = (res * x) % p; y = y >> 1; x = (x * x) % p; } return res; } int modInverse(int n, int p) { return por(n, p - 2, p); } int nCrModPFermat(int n, int r, int p) { if (r == 0) return 1; int fac[n + 1]; fac[0] = 1; for (int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % p; return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p; } template <typename T> void printvec(vector<T> &vec) { for (int i = 0; i < vec.size(); i++) cout << vec[i] << " "; cout << endl; } bool cmp(const pair<int, int> &a, const pair<int, int> &b) { return (a.second < b.second); } vector<int> p; int fprime = 0; void seiveprime(int n) { fprime = 123; bool pr[n + 1]; memset(pr, true, sizeof(pr)); for (int p = 2; p * p <= n; p++) { if (pr[p] == true) { for (int i = p * p; i <= n; i += p) pr[i] = false; } } for (int p0 = 2; p0 <= n; p0++) if (pr[p0]) p.pb(p0); } void show(int *a) { int size = (*(&a + 1) - a) - 1; for (int i = 0; i < size; i++) { cout << a[i] << " "; } cout << endl; } int binary_search(int *a, int n, int e) { int f, l, m; f = 0; l = n - 1; while (f <= l) { // returns index of that value. m = (f + l) / 2; if (e == a[m]) return (m); else if (e > a[m]) f = m + 1; else l = m - 1; } return -1; } vector<int> pf; void primefactors(int n) { while (n % 2 == 0) pf.push_back(2), n = n / 2; for (int i = 3; i <= sqrt(n); i = i + 2) { while (n % i == 0) { pf.push_back(i); n = n / i; } } if (n > 2) pf.push_back(n); // dont forgot to clear pf vector. } // vector<int,greater<int>>fac; vector<int> fac; void factors(int n) { for (int i = 1; i <= sqrt(n); i++) { if (n % i == 0) { if (n / i == i) fac.push_back(i); else fac.push_back(i), fac.push_back(n / i); } } // dont forgot to clear fac vector. } void solve() { int n; cin >> n; int f[10001]; int k = sqrt(n - 2); for (int i = 0; i <= 10000; i++) { f[i] = 0; } int y = 0; for (int i = 1; i <= k; i++) { for (int j = 1; j <= k; j++) { for (int w = 1; w <= k; w++) { y = i * i + j * j + w * w + i * j + j * w + w * i; if (y < 10001) f[y]++; } } } for (int i = 1; i <= n; i++) { cout << f[i] << endl; } } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout << fixed << setprecision(15); int t = 1; // cin>>t; // seiveprime(1000); while (t--) { solve(); } }
replace
155
156
155
157
0
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> //全てのヘッダファイルをインクルード // ループ #define rep(i, n) for (int i = 0; i < (n); i++) // 普通のループ #define repr(i, n) for (int i = n; i >= 0; i--) // 逆ループ // 型名省略 typedef long long ll; // 値 static const ll MX = 100005; static const ll MX_ll = 1e18; using namespace std; // ソート #define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) // #include "./lib/generic/search.h" int main() { int n, x, y, z, ans = 0, max = 0; cin >> n; for (int i = 1; i <= n; i++) { ans = 0; max = 0; if (i <= 5) { cout << "0" << endl; continue; } x = 1; while (1) { if (x * x + x - i + 4 <= 0) { x++; } if (x * x + x - i + 4 > 0) { max = x - 1; break; } } for (x = 1; x <= max; x++) { for (y = 1; y <= max; y++) { for (z = 1; z <= max; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) ans++; } } } cout << ans << endl; } return 0; }
#include <bits/stdc++.h> //全てのヘッダファイルをインクルード // ループ #define rep(i, n) for (int i = 0; i < (n); i++) // 普通のループ #define repr(i, n) for (int i = n; i >= 0; i--) // 逆ループ // 型名省略 typedef long long ll; // 値 static const ll MX = 100005; static const ll MX_ll = 1e18; using namespace std; // ソート #define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) // #include "./lib/generic/search.h" int main() { int n, x, y, z, ans = 0, max = 0; cin >> n; for (int i = 1; i <= n; i++) { ans = 0; max = 0; if (i <= 5) { cout << "0" << endl; continue; } x = 1; while (1) { if (x * x + x - i + 4 <= 0) { x++; } if (x * x + x - i + 4 > 0) { max = x - 1; break; } } for (x = 1; x <= max; x++) { for (y = x; y <= max; y++) { for (z = y; z <= max; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) { if (x == y && y == z) ans++; else if (x == y && y != z) ans += 3; else if (x != y && y == z) ans += 3; else if (x == z && y != z) ans += 3; else ans += 6; } } } } cout << ans << endl; } return 0; }
replace
40
44
40
54
TLE
p02608
C++
Runtime Error
#ifdef LOCAL #define _GLIBCXX_DEBUG #define __clock__ #else #pragma GCC optimize("Ofast") #endif #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using VI = vector<ll>; using VV = vector<VI>; using VS = vector<string>; using PII = pair<ll, ll>; // tourist set template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <typename A, typename B, typename C, typename D> string to_string(tuple<A, B, C, D> p); string to_string(const string &s) { return '"' + s + '"'; } string to_string(const char *s) { return to_string((string)s); } string to_string(bool b) { return (b ? "true" : "false"); } string to_string(vector<bool> v) { bool first = true; string res = "{"; for (int i = 0; i < static_cast<int>(v.size()); i++) { if (!first) { res += ", "; } first = false; res += to_string(v[i]); } res += "}"; return res; } template <size_t N> string to_string(bitset<N> v) { string res = ""; for (size_t i = 0; i < N; i++) { res += static_cast<char>('0' + v[i]); } return res; } template <typename A> string to_string(A v) { bool first = true; string res = "{"; for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); } res += "}"; return res; } template <typename A, typename B> string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; } template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p) { return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")"; } template <typename A, typename B, typename C, typename D> string to_string(tuple<A, B, C, D> p) { return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")"; } void debug_out() { cerr << '\n'; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); } #ifdef LOCAL #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #else #define debug(...) 42 #endif // tourist set end template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define FOR(i, a, b) for (ll i = (a); i < (b); ++i) #define rep(i, b) FOR(i, 0, b) #define ALL(v) (v).begin(), (v).end() #define p(s) cout << (s) << '\n' #define p2(s, t) cout << (s) << " " << (t) << '\n' #define br() p("") #define pn(s) cout << (#s) << " " << (s) << '\n' #define SZ(x) ((int)(x).size()) #define SORT(A) sort(ALL(A)) #define RSORT(A) sort(ALL(A), greater<ll>()) #define MP make_pair #define p_yes() p("Yes") #define p_no() p("No") ll SUM(VI &V) { return accumulate(ALL(V), 0LL); } ll MIN(VI &V) { return *min_element(ALL(V)); } ll MAX(VI &V) { return *max_element(ALL(V)); } void print_vector(VI &V) { ll n = V.size(); rep(i, n) { if (i) cout << ' '; cout << V[i]; } cout << endl; } ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); } ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; } // long double using ld = long double; #define EPS (1e-14) #define equals(a, b) (fabs((a) - (b)) < EPS) void no() { p_no(); exit(0); } void yes() { p_yes(); exit(0); } const ll mod = 1e9 + 7; const ll inf = 1e18; const double PI = acos(-1); // snuke's mint // auto mod int // https://youtu.be/L8grWxBlIZ4?t=9858 // https://youtu.be/ERZuLAxZffQ?t=4807 : optimize // https://youtu.be/8uowVvQ_-Mo?t=1329 : division // const int mod = 1000000007; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint &operator-=(const mint a) { if ((x += mod - a.x) >= mod) x -= mod; return *this; } mint &operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { mint res(*this); return res += a; } mint operator-(const mint a) const { mint res(*this); return res -= a; } mint operator*(const mint a) const { mint res(*this); return res *= a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t >> 1); a *= a; if (t & 1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod - 2); } mint &operator/=(const mint a) { return (*this) *= a.inv(); } mint operator/(const mint a) const { mint res(*this); return res /= a; } }; // for codeforces void solve() { ll a; cin >> a; } int main() { cin.tie(0); ios::sync_with_stdio(false); // input ll N; cin >> N; VI Ans(1010); FOR(x, 1, 210) { FOR(y, 1, 210) { FOR(z, 1, 210) { ll v = x * x + y * y + z * z + x * y + y * z + z * x; if (v > N) continue; Ans[v]++; } } } FOR(i, 1, N + 1) { p(Ans[i]); } return 0; }
#ifdef LOCAL #define _GLIBCXX_DEBUG #define __clock__ #else #pragma GCC optimize("Ofast") #endif #include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using VI = vector<ll>; using VV = vector<VI>; using VS = vector<string>; using PII = pair<ll, ll>; // tourist set template <typename A, typename B> string to_string(pair<A, B> p); template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p); template <typename A, typename B, typename C, typename D> string to_string(tuple<A, B, C, D> p); string to_string(const string &s) { return '"' + s + '"'; } string to_string(const char *s) { return to_string((string)s); } string to_string(bool b) { return (b ? "true" : "false"); } string to_string(vector<bool> v) { bool first = true; string res = "{"; for (int i = 0; i < static_cast<int>(v.size()); i++) { if (!first) { res += ", "; } first = false; res += to_string(v[i]); } res += "}"; return res; } template <size_t N> string to_string(bitset<N> v) { string res = ""; for (size_t i = 0; i < N; i++) { res += static_cast<char>('0' + v[i]); } return res; } template <typename A> string to_string(A v) { bool first = true; string res = "{"; for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); } res += "}"; return res; } template <typename A, typename B> string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; } template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p) { return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")"; } template <typename A, typename B, typename C, typename D> string to_string(tuple<A, B, C, D> p) { return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")"; } void debug_out() { cerr << '\n'; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << to_string(H); debug_out(T...); } #ifdef LOCAL #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #else #define debug(...) 42 #endif // tourist set end template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define FOR(i, a, b) for (ll i = (a); i < (b); ++i) #define rep(i, b) FOR(i, 0, b) #define ALL(v) (v).begin(), (v).end() #define p(s) cout << (s) << '\n' #define p2(s, t) cout << (s) << " " << (t) << '\n' #define br() p("") #define pn(s) cout << (#s) << " " << (s) << '\n' #define SZ(x) ((int)(x).size()) #define SORT(A) sort(ALL(A)) #define RSORT(A) sort(ALL(A), greater<ll>()) #define MP make_pair #define p_yes() p("Yes") #define p_no() p("No") ll SUM(VI &V) { return accumulate(ALL(V), 0LL); } ll MIN(VI &V) { return *min_element(ALL(V)); } ll MAX(VI &V) { return *max_element(ALL(V)); } void print_vector(VI &V) { ll n = V.size(); rep(i, n) { if (i) cout << ' '; cout << V[i]; } cout << endl; } ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); } ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; } // long double using ld = long double; #define EPS (1e-14) #define equals(a, b) (fabs((a) - (b)) < EPS) void no() { p_no(); exit(0); } void yes() { p_yes(); exit(0); } const ll mod = 1e9 + 7; const ll inf = 1e18; const double PI = acos(-1); // snuke's mint // auto mod int // https://youtu.be/L8grWxBlIZ4?t=9858 // https://youtu.be/ERZuLAxZffQ?t=4807 : optimize // https://youtu.be/8uowVvQ_-Mo?t=1329 : division // const int mod = 1000000007; struct mint { ll x; // typedef long long ll; mint(ll x = 0) : x((x % mod + mod) % mod) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint &operator-=(const mint a) { if ((x += mod - a.x) >= mod) x -= mod; return *this; } mint &operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { mint res(*this); return res += a; } mint operator-(const mint a) const { mint res(*this); return res -= a; } mint operator*(const mint a) const { mint res(*this); return res *= a; } mint pow(ll t) const { if (!t) return 1; mint a = pow(t >> 1); a *= a; if (t & 1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod - 2); } mint &operator/=(const mint a) { return (*this) *= a.inv(); } mint operator/(const mint a) const { mint res(*this); return res /= a; } }; // for codeforces void solve() { ll a; cin >> a; } int main() { cin.tie(0); ios::sync_with_stdio(false); // input ll N; cin >> N; VI Ans(10010); FOR(x, 1, 210) { FOR(y, 1, 210) { FOR(z, 1, 210) { ll v = x * x + y * y + z * z + x * y + y * z + z * x; if (v > N) continue; Ans[v]++; } } } FOR(i, 1, N + 1) { p(Ans[i]); } return 0; }
replace
238
239
238
239
0
p02608
C++
Time Limit Exceeded
#pragma region Macros #include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < (n); i++) #define REPS(i, n) for (int i = 0; i <= (n); i++) #define FOR(i, a, b) for (int i = a; i < (b); i++) #define FORS(i, a, b) for (int i = a; i <= (b); i++) // for container x #define ALL(v) (v).begin(), (v).end() #define RALL(v) (v).rbegin(), (v).rend() #define SIZE(v) ((ll)(v).size()) #define MAX(v) *max_element(ALL(v)) #define MIN(v) *min_element(ALL(v)) #define UNIQUE(v) v.erase(unique(ALL(v)), v.end()) #define LB(v, x) distance((v).begin(), lower_bound(ALL(v), (x))) #define UB(v, x) distance((v).begin(), upper_bound(ALL(v), (x))) struct cww { cww() { ios::sync_with_stdio(false); cin.tie(0); } } star; #pragma endregion int main() { int N; cin >> N; FORS(n, 1, N) { int ans = 0; for (int x = 1; x * x < n; x++) { for (int y = 1; y * y <= (n - x * x); y++) { // if (x*x+y*y+z*z+x*y+y*z+z*x==n) ans++; for (int z = 1; z * z <= (n - x * x - y * y - x * y); z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == n) ans++; } } } cout << ans << "\n"; } return 0; }
#pragma region Macros #include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < (n); i++) #define REPS(i, n) for (int i = 0; i <= (n); i++) #define FOR(i, a, b) for (int i = a; i < (b); i++) #define FORS(i, a, b) for (int i = a; i <= (b); i++) // for container x #define ALL(v) (v).begin(), (v).end() #define RALL(v) (v).rbegin(), (v).rend() #define SIZE(v) ((ll)(v).size()) #define MAX(v) *max_element(ALL(v)) #define MIN(v) *min_element(ALL(v)) #define UNIQUE(v) v.erase(unique(ALL(v)), v.end()) #define LB(v, x) distance((v).begin(), lower_bound(ALL(v), (x))) #define UB(v, x) distance((v).begin(), upper_bound(ALL(v), (x))) struct cww { cww() { ios::sync_with_stdio(false); cin.tie(0); } } star; #pragma endregion int main() { int N; cin >> N; FORS(n, 1, N) { int ans = 0; for (int x = 1; x * x < n; x++) { for (int y = 1; y <= x; y++) { for (int z = 1; z <= y; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == n) { if (x == y && y == z && x == z) ans++; else if ((x == y && y != z) || (x == z && x != y) || (y == z && z != x)) ans += 3; else ans += 6; } } } } cout << ans << "\n"; } return 0; }
replace
34
39
34
45
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int Triplets(int x, int y, int z) { return x * x + y * y + z * z + x * y + y * z + z * x; } int main() { int N, x = 1, y = 1, z = 1; cin >> N; vector<int> ans(10001); for (z = 1; z < y + 1; z++) { for (y = z; y < x + 1; y++) { for (x = y; x < sqrt(N - 1) + 1; x++) { if (x == y && y == z) { ++ans.at(Triplets(x, y, z)); } else if (x != y && y != z && z != x) { ans.at((Triplets(x, y, z))) += 6; } else { ans.at((Triplets(x, y, z))) += 3; } } } } for (int i = 1; i <= N; i++) { cout << ans.at(i) << endl; } }
#include <bits/stdc++.h> using namespace std; int Triplets(int x, int y, int z) { return x * x + y * y + z * z + x * y + y * z + z * x; } int main() { int N, x = 1, y = 1, z = 1; cin >> N; vector<int> ans(100000); for (z = 1; z < y + 1; z++) { for (y = z; y < x + 1; y++) { for (x = y; x < sqrt(N - 1) + 1; x++) { if (x == y && y == z) { ++ans.at(Triplets(x, y, z)); } else if (x != y && y != z && z != x) { ans.at((Triplets(x, y, z))) += 6; } else { ans.at((Triplets(x, y, z))) += 3; } } } } for (int i = 1; i <= N; i++) { cout << ans.at(i) << endl; } }
replace
10
11
10
11
0
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; ++i) { int cnt = 0; int N = i; for (int x = 1; x <= n; ++x) { for (int y = 1; y <= n; ++y) { for (int z = 1; z <= n; ++z) { int cal = x * x + y * y + z * z + x * y + y * z + z * x; if (cal < N) continue; if (cal == N) ++cnt; break; } } } cout << cnt << '\n'; } }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; ++i) { int cnt = 0; int N = i; for (int x = 1; x * x <= n; ++x) { for (int y = 1; y * y <= n; ++y) { for (int z = 1; z * z <= n; ++z) { int cal = x * x + y * y + z * z + x * y + y * z + z * x; if (cal < N) continue; if (cal == N) ++cnt; break; } } } cout << cnt << '\n'; } }
replace
8
11
8
11
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define mp make_pair #define pb push_back #define eb emplace_back #define pii pair<ll, ll> #define vpii vector<pair<ll, ll>> #define F first #define S second #define ld long double #define built __builtin_popcountll #define mst(a, i) memset(a, i, sizeof(a)) #define all(x) x.begin(), x.end() #define itit(it, a) for (auto it = (a).begin(); it != (a).end(); it++) #define rep(i, a, b) for (ll i = a; i < b; i++) #define repr(i, a, b) for (ll i = a; i > b; i--) #define reprr(i, a, b) for (ll i = a; i >= b; i--) #define pi 3.14159265358979323846264338327950288419716939937510582097494459230 ll max3(ll x, ll y, ll z) { return max(max(x, y), z); } ll min3(ll x, ll y, ll z) { return min(min(x, y), z); } const ll N = 1e5 + 10, M = 2e5 + 10, M2 = 1e6 + 10, mod = 1e9 + 7, inf = 1e17 + 10; const int INF = 1e9 + 7; void add(int &a, int b) { a += b; if (a >= mod) { a -= mod; } } int X[] = {0, 1, 0, -1}; int Y[] = {-1, 0, 1, 0}; // assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) // is(65-90) and 32 for space ll power(ll x, ll n) { ll result = 1; while (n > 0) { if (n % 2 == 1) result = (result * x) % mod; x = ((x % mod) * (x % mod)) % mod; n = n / 2; } return result; } int f[10005]; int32_t main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { int x = i * i + j * j + k * k + i * j + j * k + k * i; f[x]++; } } } for (int i = 1; i <= n; i++) cout << f[i] << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define mp make_pair #define pb push_back #define eb emplace_back #define pii pair<ll, ll> #define vpii vector<pair<ll, ll>> #define F first #define S second #define ld long double #define built __builtin_popcountll #define mst(a, i) memset(a, i, sizeof(a)) #define all(x) x.begin(), x.end() #define itit(it, a) for (auto it = (a).begin(); it != (a).end(); it++) #define rep(i, a, b) for (ll i = a; i < b; i++) #define repr(i, a, b) for (ll i = a; i > b; i--) #define reprr(i, a, b) for (ll i = a; i >= b; i--) #define pi 3.14159265358979323846264338327950288419716939937510582097494459230 ll max3(ll x, ll y, ll z) { return max(max(x, y), z); } ll min3(ll x, ll y, ll z) { return min(min(x, y), z); } const ll N = 1e5 + 10, M = 2e5 + 10, M2 = 1e6 + 10, mod = 1e9 + 7, inf = 1e17 + 10; const int INF = 1e9 + 7; void add(int &a, int b) { a += b; if (a >= mod) { a -= mod; } } int X[] = {0, 1, 0, -1}; int Y[] = {-1, 0, 1, 0}; // assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) // is(65-90) and 32 for space ll power(ll x, ll n) { ll result = 1; while (n > 0) { if (n % 2 == 1) result = (result * x) % mod; x = ((x % mod) * (x % mod)) % mod; n = n / 2; } return result; } int f[10005]; int32_t main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 1; i <= 100; i++) { for (int j = 1; j <= 100; j++) { for (int k = 1; k <= 100; k++) { int x = i * i + j * j + k * k + i * j + j * k + k * i; if (x <= n) f[x]++; } } } for (int i = 1; i <= n; i++) cout << f[i] << "\n"; return 0; }
replace
61
62
61
63
-11
p02608
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; using ll = long long int; #define rep(i, a, b) for (int i = a; i < b; i++) #define rrep(i, a, b) for (int i = a; i >= b; i--) #define fore(i, a) for (auto &i : a) #define all(x) (x).begin(), (x).end() #define pi 3.14159265358979323846 template <class T> bool ch1000000(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } const int MAX = 42; int main() { ll N; cin >> N; vector<ll> a(20000, 0); for (ll i = 1; i <= 100; i++) { for (ll j = 1; j <= 100; j++) { for (ll k = 1; k <= 100; k++) { ll f = i * i + j * j + k * k + i * j + j * k + k * i; a[f]++; } } } for (ll i = 1; i <= N; i++) { cout << a[i] << endl; } // cout << setprecision(8) << ans << endl; // For double }
#include "bits/stdc++.h" using namespace std; using ll = long long int; #define rep(i, a, b) for (int i = a; i < b; i++) #define rrep(i, a, b) for (int i = a; i >= b; i--) #define fore(i, a) for (auto &i : a) #define all(x) (x).begin(), (x).end() #define pi 3.14159265358979323846 template <class T> bool ch1000000(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } const int MAX = 42; int main() { ll N; cin >> N; vector<ll> a(60000, 0); for (ll i = 1; i <= 100; i++) { for (ll j = 1; j <= 100; j++) { for (ll k = 1; k <= 100; k++) { ll f = i * i + j * j + k * k + i * j + j * k + k * i; a[f]++; } } } for (ll i = 1; i <= N; i++) { cout << a[i] << endl; } // cout << setprecision(8) << ans << endl; // For double }
replace
32
33
32
33
-11
p02608
C++
Time Limit Exceeded
#pragma GCC optimize("Ofast") #include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <string.h> #include <vector> const long long INFL = 1e17 + 7; const long long INFI = 1e9 + 7; const long long MOD = 1e9 + 7; const double EPS = 1e-8; const double PI = acos(-1); using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<int> count(n + 1, 0); for (int i = 1; i <= n; i++) { for (int x = 1; x * x <= n; x++) { for (int y = x; y * y <= n; y++) { for (int z = y; z * z <= n; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) { if (x == y && y == z) { count[i]++; break; } else if (x != y && y != z) { count[i] += 6; break; } else { count[i] += 3; break; } } } } } } for (int i = 1; i <= n; i++) { cout << count[i] << endl; } return 0; }
#pragma GCC optimize("Ofast") #include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <string.h> #include <vector> const long long INFL = 1e17 + 7; const long long INFI = 1e9 + 7; const long long MOD = 1e9 + 7; const double EPS = 1e-8; const double PI = acos(-1); using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<int> count(n + 1, 0); for (int i = 1; i <= n; i++) { for (int x = 1; x * x <= i; x++) { for (int y = x; y * y <= i; y++) { for (int z = y; z * z <= i; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) { if (x == y && y == z) { count[i]++; break; } else if (x != y && y != z) { count[i] += 6; break; } else { count[i] += 3; break; } } } } } } for (int i = 1; i <= n; i++) { cout << count[i] << endl; } return 0; }
replace
27
30
27
30
TLE
p02608
C++
Time Limit Exceeded
// It gets easier day by day, but the hard part is to........ // "I am here." ~ All Might! #pragma optimise GCC(-O2) #include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define ld long double #define pii pair<ll, ll> #define ve(x) vector<x> #define f(a, b, c) for (ll a = b; a < c; a++) #define foto(x, v) for (auto x : v) #define read(t) \ ll t; \ cin >> t; #define reads(t) \ string t; \ cin >> t; #define readarr(arr, n) \ ll arr[n]; \ f(i, 0, n) cin >> arr[i]; #define ln endl #define Endl endl #define dbg(x) cout << #x << " = " << x << ln; #define dbg2(x, y) cout << #x << " = " << x << " & " << #y << " = " << y << ln; #define dbgarr(v, s, e) \ cout << #v << " = "; \ f(i, s, e) cout << v[i] << ", "; \ cout << ln; #define addEdge(tr, k) \ f(i, 0, k) { \ ll x, y; \ cin >> x >> y, tr[x].push_back(y), tr[y].push_back(x); \ } #define all(v) v.begin(), v.end() mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count()); int rng(int lim) { uniform_int_distribution<int> uid(0, lim - 1); return uid(rang); } // GLOBAL //VARS ll INF = LLONG_MAX; const ll M = 1000000007, M2 = 998244353, M3 = 2013265921; // USEFUL //FUNCTIONS ll powm(ll, ll, ll); ll modI(ll, ll); //------------------------------------------------------DSU // vector<int> parent, rank; // void make_set(int v) { parent[v] = v; rank[v] = 0;} // int find_set(int v) { if (v == parent[v]) return v; return parent[v] = // find_set(parent[v]);} void union_sets(int a, int b) { a = find_set(a); b = // find_set(b); if (a != b) { if (rank[a] < rank[b]) swap(a, b); parent[b] = a; // if (rank[a] == rank[b]) rank[a]++; }} //------------------------------------------------------LCA ** l=ceil(log2(n)) //dfs_lca(root,root) // ll dp[200005][21] ; ve(ll) tin(200005), tout(200005); ll tim = 0 , l; // void dfs_lca(int n , int par ){ tin[n] = ++tim; dp[n][0] = par; f(i,1,l+1) // dp[n][i] = dp[dp[n][i-1]][i-1]; // foto(x,tr[n]) if(x==par) continue; else dfs_lca(x , n); tout[n] = // ++tim; } // bool is_ancestor(ll u , ll v) { return tin[u]<=tin[v] && tout[u]>=tout[v] ;} // ll lca(ll u , ll v){ if(is_ancestor(u,v)) return u ; if(is_ancestor(v,u)) // return v; // for(int j = l ; j>=0 ; j--) if(!is_ancestor(dp[u][j] , v)) u = dp[u][j]; // return dp[u][0];} struct FenwickTree { vector<int> bit; int n; FenwickTree(int n) { this->n = n; bit.assign(n, 0); } int sum(int r) { int ret = 0; for (; r >= 0; r = (r & (r + 1)) - 1) ret += bit[r]; return ret; } int sum(int l, int r) { return sum(r) - sum(l - 1); } void add(int idx, int delta) { for (; idx < n; idx = idx | (idx + 1)) bit[idx] += delta; } }; //-------------------------------------------------NTT modulo m primroot //x=(m,0)-------------------- // ll PrimRoot(ll p, ll x); // finds primitive root of prime p greater than x(If it // doesnt exist, returns 0) void fft(ve(ll) & a, ll n, bool invert, ll m, ll x); void PolyMult(ve(ll) & a, ve(ll) & b, ve(ll) & v, ll m, ll x); // MAIN int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); read(n) f(i, 1, n + 1) { ll e = 2 * i; ll foo = 0; f(x, 1, sqrt(e + 5) + 1) f(y, 1, sqrt(e + 5) + 1) { ll eta = e - (x + y) * (x + y); eta -= x * x; eta -= y * y; // eta = z*z +2*z*(x+y) f(z, 1, sqrt(eta + 5) + 1) { if (eta == (2 * z * z + 2 * z * (x + y))) foo++; } } cout << foo << endl; } } // --------------- Oooo I wont let you go -------------- // lcs(i , j) = (s[i]==t[j]) ? lcs(i-1,j-1) + 1 : max(lcs(i-1,j),lcs(i,j-1)) ; // FUNCTIONS //DECLARATIONS ll powm(ll a, ll b, ll c = M) { ll res = 1; while (b) { if (b & 1) res = (res * a) % c; a = (a * a) % c; b >>= 1; } return res; } ll modI(ll a, ll m = M) { ll m0 = m, y = 0, x = 1; if (m == 1) return 0; while (a > 1) { ll q = a / m; ll t = m; m = a % m; a = t; t = y; y = x - q * y; x = t; } if (x < 0) x += m0; return x; } ll PrimRoot(ll p, ll x) // finds primitive root of prime p greater than x(If it // doesnt exist, returns 0) { ve(ll) v; ll t = p - 1; for (int i = 2; i * i <= t; i++) if (t % i == 0) { v.push_back((p - 1) / i); while (t % i == 0) t /= i; } if (t > 1) v.push_back((p - 1) / t); f(i, x + 1, p) { ll flag = 0; foto(x, v) if (powm(i, x, p) == 1) { flag = 1; break; } if (flag == 0) return i; } return 0; } void fft(ve(ll) & a, ll n, bool invert, ll m, ll x) { ll lg_n = __builtin_ctzll(n); for (ll i = 0, y = 0; i < n; i++) { f(j, 0, lg_n) if ((1LL << j) & i) y |= (1LL << (lg_n - j - 1)); if (y > i) swap(a[i], a[y]); } if (invert) x = modI(x, m); for (ll s = 2; s <= n; s <<= 1) { ll y = powm(x, (n / s), m); f(j, 0, (n / s)) { ll r = 1; f(i, 0, s / 2) { ll u = a[i + j * s], v = (r * a[i + j * s + (s / 2)]) % m; a[i + j * s] = (u + v) % m; a[i + j * s + (s / 2)] = (u - v + m) % m; r = r * y % m; } } } if (invert) { ll invn = modI(n, m); f(i, 0, n) a[i] = (a[i] * invn) % m; } return; } void PolyMult(ve(ll) & a, ve(ll) & b, ve(ll) & v, ll m, ll x) // pass x = 1 for xor conv { ll n = 1; while (n < ((ll)a.size()) + ((ll)b.size())) n <<= 1; ve(ll) fa(a.begin(), a.end()); fa.resize(n, 0); ve(ll) fb(b.begin(), b.end()); fb.resize(n, 0); ll y = powm(x, (m - 1) / n, m); fft(fa, n, false, m, y); fft(fb, n, false, m, y); v.resize(n, 0); f(i, 0, n) v[i] = ((fa[i] * fb[i]) % m); fft(v, n, true, m, y); return; }
// It gets easier day by day, but the hard part is to........ // "I am here." ~ All Might! #pragma optimise GCC(-O2) #include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define ld long double #define pii pair<ll, ll> #define ve(x) vector<x> #define f(a, b, c) for (ll a = b; a < c; a++) #define foto(x, v) for (auto x : v) #define read(t) \ ll t; \ cin >> t; #define reads(t) \ string t; \ cin >> t; #define readarr(arr, n) \ ll arr[n]; \ f(i, 0, n) cin >> arr[i]; #define ln endl #define Endl endl #define dbg(x) cout << #x << " = " << x << ln; #define dbg2(x, y) cout << #x << " = " << x << " & " << #y << " = " << y << ln; #define dbgarr(v, s, e) \ cout << #v << " = "; \ f(i, s, e) cout << v[i] << ", "; \ cout << ln; #define addEdge(tr, k) \ f(i, 0, k) { \ ll x, y; \ cin >> x >> y, tr[x].push_back(y), tr[y].push_back(x); \ } #define all(v) v.begin(), v.end() mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count()); int rng(int lim) { uniform_int_distribution<int> uid(0, lim - 1); return uid(rang); } // GLOBAL //VARS ll INF = LLONG_MAX; const ll M = 1000000007, M2 = 998244353, M3 = 2013265921; // USEFUL //FUNCTIONS ll powm(ll, ll, ll); ll modI(ll, ll); //------------------------------------------------------DSU // vector<int> parent, rank; // void make_set(int v) { parent[v] = v; rank[v] = 0;} // int find_set(int v) { if (v == parent[v]) return v; return parent[v] = // find_set(parent[v]);} void union_sets(int a, int b) { a = find_set(a); b = // find_set(b); if (a != b) { if (rank[a] < rank[b]) swap(a, b); parent[b] = a; // if (rank[a] == rank[b]) rank[a]++; }} //------------------------------------------------------LCA ** l=ceil(log2(n)) //dfs_lca(root,root) // ll dp[200005][21] ; ve(ll) tin(200005), tout(200005); ll tim = 0 , l; // void dfs_lca(int n , int par ){ tin[n] = ++tim; dp[n][0] = par; f(i,1,l+1) // dp[n][i] = dp[dp[n][i-1]][i-1]; // foto(x,tr[n]) if(x==par) continue; else dfs_lca(x , n); tout[n] = // ++tim; } // bool is_ancestor(ll u , ll v) { return tin[u]<=tin[v] && tout[u]>=tout[v] ;} // ll lca(ll u , ll v){ if(is_ancestor(u,v)) return u ; if(is_ancestor(v,u)) // return v; // for(int j = l ; j>=0 ; j--) if(!is_ancestor(dp[u][j] , v)) u = dp[u][j]; // return dp[u][0];} struct FenwickTree { vector<int> bit; int n; FenwickTree(int n) { this->n = n; bit.assign(n, 0); } int sum(int r) { int ret = 0; for (; r >= 0; r = (r & (r + 1)) - 1) ret += bit[r]; return ret; } int sum(int l, int r) { return sum(r) - sum(l - 1); } void add(int idx, int delta) { for (; idx < n; idx = idx | (idx + 1)) bit[idx] += delta; } }; //-------------------------------------------------NTT modulo m primroot //x=(m,0)-------------------- // ll PrimRoot(ll p, ll x); // finds primitive root of prime p greater than x(If it // doesnt exist, returns 0) void fft(ve(ll) & a, ll n, bool invert, ll m, ll x); void PolyMult(ve(ll) & a, ve(ll) & b, ve(ll) & v, ll m, ll x); // MAIN int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); read(n) f(i, 1, n + 1) { ll e = 2 * i; ll foo = 0; f(s1, 1, sqrt(e + 5) + 1) f(s2, 1, sqrt(e + 5) + 1) { ll eta = e - s1 * s1 - s2 * s2; ll boo = sqrt(eta); if (boo * boo != eta) continue; ll deed = s1 + s2 + boo; if (deed % 2) continue; deed >>= 1; if (deed - s1 >= 1 and deed - s2 >= 1 and deed - boo >= 1) foo++; } cout << foo << endl; } } // --------------- Oooo I wont let you go -------------- // lcs(i , j) = (s[i]==t[j]) ? lcs(i-1,j-1) + 1 : max(lcs(i-1,j),lcs(i,j-1)) ; // FUNCTIONS //DECLARATIONS ll powm(ll a, ll b, ll c = M) { ll res = 1; while (b) { if (b & 1) res = (res * a) % c; a = (a * a) % c; b >>= 1; } return res; } ll modI(ll a, ll m = M) { ll m0 = m, y = 0, x = 1; if (m == 1) return 0; while (a > 1) { ll q = a / m; ll t = m; m = a % m; a = t; t = y; y = x - q * y; x = t; } if (x < 0) x += m0; return x; } ll PrimRoot(ll p, ll x) // finds primitive root of prime p greater than x(If it // doesnt exist, returns 0) { ve(ll) v; ll t = p - 1; for (int i = 2; i * i <= t; i++) if (t % i == 0) { v.push_back((p - 1) / i); while (t % i == 0) t /= i; } if (t > 1) v.push_back((p - 1) / t); f(i, x + 1, p) { ll flag = 0; foto(x, v) if (powm(i, x, p) == 1) { flag = 1; break; } if (flag == 0) return i; } return 0; } void fft(ve(ll) & a, ll n, bool invert, ll m, ll x) { ll lg_n = __builtin_ctzll(n); for (ll i = 0, y = 0; i < n; i++) { f(j, 0, lg_n) if ((1LL << j) & i) y |= (1LL << (lg_n - j - 1)); if (y > i) swap(a[i], a[y]); } if (invert) x = modI(x, m); for (ll s = 2; s <= n; s <<= 1) { ll y = powm(x, (n / s), m); f(j, 0, (n / s)) { ll r = 1; f(i, 0, s / 2) { ll u = a[i + j * s], v = (r * a[i + j * s + (s / 2)]) % m; a[i + j * s] = (u + v) % m; a[i + j * s + (s / 2)] = (u - v + m) % m; r = r * y % m; } } } if (invert) { ll invn = modI(n, m); f(i, 0, n) a[i] = (a[i] * invn) % m; } return; } void PolyMult(ve(ll) & a, ve(ll) & b, ve(ll) & v, ll m, ll x) // pass x = 1 for xor conv { ll n = 1; while (n < ((ll)a.size()) + ((ll)b.size())) n <<= 1; ve(ll) fa(a.begin(), a.end()); fa.resize(n, 0); ve(ll) fb(b.begin(), b.end()); fb.resize(n, 0); ll y = powm(x, (m - 1) / n, m); fft(fa, n, false, m, y); fft(fb, n, false, m, y); v.resize(n, 0); f(i, 0, n) v[i] = ((fa[i] * fb[i]) % m); fft(v, n, true, m, y); return; }
replace
110
119
110
121
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long int ll; typedef pair<int, int> P; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int ans = 0; int num = i; for (int x = 1; x * x <= num; x++) { for (int y = 1; y * y <= num - x * x; y++) { for (int z = 1; z * z <= num - x * x - y * y - x * y; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == num) ans++; } } } printf("%d\n", ans); } return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long int ll; typedef pair<int, int> P; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int ans = 0; int num = i; for (int x = 1; x * x < num; x++) { for (int y = 1; x * x + y * y + x * y < num; y++) { for (int z = 1; x * x + y * y + z * z + x * y + y * z + z * x <= num; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == num) ans++; } } } printf("%d\n", ans); } return 0; }
replace
12
15
12
16
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i, a, b) for (int i = (a); i <= (b); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; int f(int n) { int cnt = 0; for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == n) cnt++; } } } return cnt; } int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { cout << f(i) << "\n"; } return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i, a, b) for (int i = (a); i <= (b); ++i) using namespace std; typedef long long ll; typedef pair<int, int> P; int f(int n) { int cnt = 0; for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { int a = (x + y); int b = 4 * (x * x + y * y + x * y - n); double c = sqrt(a * a - b); if ((c - a) >= 2 && int(c) == c && (int(c) - a) % 2 == 0) cnt++; } } return cnt; } int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { cout << f(i) << "\n"; } return 0; }
replace
11
15
11
16
TLE
p02608
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int n, ans = 0; cin >> n; for (int i = 1; i <= n; i++) { for (int x = 1; x <= n; x++) { if (x * x + 2 * x + 3 > i) break; int xx = x * x; for (int y = x; y <= n; y++) { int xy = xx + y * (x + y); if (xy + x + y + 1 > i) break; for (int z = y; z <= n; z++) { if (i == xy + z * (x + y + z)) { // if(i == x*x+x*y+x*z+y*y+z*z+z*y) { if (x == y && y == z) ans++; else if (x != y && y != z && z != x) ans += 6; else ans += 3; } // if(i < (x+y+z)*(x+y+z)-z*y-z*x-x*y) break; } } } cout << ans << endl; ans = 0; } }
#include <iostream> using namespace std; int main() { int n, ans = 0; cin >> n; for (int i = 1; i <= n; i++) { for (int x = 1; x <= n; x++) { if (x * x + 2 * x + 3 > i) break; int xx = x * x; for (int y = x; y <= n; y++) { int xy = xx + y * (x + y); if (xy + x + y + 1 > i) break; for (int z = y; z <= n; z++) { if (i == xy + z * (x + y + z)) { // if(i == x*x+x*y+x*z+y*y+z*z+z*y) { if (x == y && y == z) ans++; else if (x != y && y != z && z != x) ans += 6; else ans += 3; } if (i < (x + y + z) * (x + y + z) - z * y - z * x - x * y) break; } } } cout << ans << endl; ans = 0; } }
replace
25
26
25
27
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FAST() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) int Check(int x, int y, int z) { return x * x + y * y + z * z + x * y + x * z + y * z; } int main() { FAST(); int i, j, k, n, x, cnt[1002] = {0}; cin >> n; for (i = 1; i < 101; i++) { for (j = 1; j < 101; j++) { for (k = 1; k < 101; k++) { x = Check(i, j, k); if (x <= n) ++cnt[x]; } } } for (i = 1; i <= n; i++) cout << cnt[i] << '\n'; return 0; }
#include <bits/stdc++.h> using namespace std; #define FAST() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) int Check(int x, int y, int z) { return x * x + y * y + z * z + x * y + x * z + y * z; } int main() { FAST(); int i, j, k, n, x, cnt[10002] = {0}; cin >> n; for (i = 1; i < 101; i++) { for (j = 1; j < 101; j++) { for (k = 1; k < 101; k++) { x = Check(i, j, k); if (x <= n) ++cnt[x]; } } } for (i = 1; i <= n; i++) cout << cnt[i] << '\n'; return 0; }
replace
15
16
15
16
0
p02608
C++
Time Limit Exceeded
#include <algorithm> #include <cctype> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <stack> #include <string> #include <unordered_map> using namespace std; typedef long long ll; const ll INF = 1000000007; const ll mod = 998244353; int main() { ll n; cin >> n; for (ll N = 1; N <= n; N++) { ll ans = 0; for (ll x = 1; x * x <= N; x++) { for (ll y = 1; y * y + x * x <= N; y++) { for (ll z = 1; x * x + y * y + z * z <= N; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == N) { ans++; } } } } cout << ans << "\n"; } cout << endl; return 0; }
#include <algorithm> #include <cctype> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <stack> #include <string> #include <unordered_map> using namespace std; typedef long long ll; const ll INF = 1000000007; const ll mod = 998244353; int main() { ll n; cin >> n; for (ll N = 1; N <= n; N++) { ll ans = 0; for (ll x = 1; x * x <= N; x++) { for (ll y = 1; y * y + x * x + x * y <= N; y++) { for (ll z = 1; x * x + y * y + z * z + x * y + y * z + z * x <= N; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == N) { ans++; } } } } cout << ans << "\n"; } cout << endl; return 0; }
replace
24
26
24
27
TLE
p02608
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; using ll = long long; using Pii = pair<int, int>; using Pll = pair<ll, ll>; #define rep(i, begin, n) for (int i = begin; i < n; i++) #define repe(i, begin, n) for (int i = begin; i <= n; i++) #define repr(i, begin, n) for (int i = begin; i > begin - n; i--) #define repre(i, begin, end) for (int i = begin; i >= end; i--) template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } const int inf = 1000000007; const int MOD = 1000000007; const long long INF = 1000000000000000007; // ------------------------------------------------------- ll N; ll ans[10101]; int main() { // cin >> N; for (ll i = 1; i * i <= N; ++i) { for (ll j = 1; j * j <= N; ++j) { for (ll k = 1; k * k <= N; ++k) { ll sum = i * i + j * j + k * k + i * j + j * k + k * i; ++ans[sum]; } } } repe(i, 1, N) { cout << ans[i] << "\n"; } }
#include "bits/stdc++.h" using namespace std; using ll = long long; using Pii = pair<int, int>; using Pll = pair<ll, ll>; #define rep(i, begin, n) for (int i = begin; i < n; i++) #define repe(i, begin, n) for (int i = begin; i <= n; i++) #define repr(i, begin, n) for (int i = begin; i > begin - n; i--) #define repre(i, begin, end) for (int i = begin; i >= end; i--) template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } const int inf = 1000000007; const int MOD = 1000000007; const long long INF = 1000000000000000007; // ------------------------------------------------------- ll N; ll ans[10101]; int main() { // cin >> N; for (ll i = 1; i * i <= N; ++i) { for (ll j = 1; j * j <= N; ++j) { for (ll k = 1; k * k <= N; ++k) { ll sum = i * i + j * j + k * k + i * j + j * k + k * i; if (sum > N) continue; ++ans[sum]; } } } repe(i, 1, N) { cout << ans[i] << "\n"; } }
insert
42
42
42
44
0
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[10010] = {0}; for (int x = 1; x < 100; x++) { for (int y = 1; y < 100; y++) { for (int z = 1; z < 100; z++) { a[x * x + y * y + z * z + x * y + y * z + z * x]++; } } } for (int i = 1; i <= n; i++) { cout << a[i] << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[100000]; for (int i = 1; i < 100000; i++) a[i] == 0; for (int x = 1; x < 100; x++) { for (int y = 1; y < 100; y++) { for (int z = 1; z < 100; z++) { a[x * x + y * y + z * z + x * y + y * z + z * x]++; } } } for (int i = 1; i <= n; i++) { cout << a[i] << endl; } }
replace
6
7
6
9
-11
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define pb push_back #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, n, s) for (int i = (s); i < (n); i++) #define rrep(i, n) for (int i = (n - 1); i >= 0; i--) #define rreps(i, n, s) for (int i = s; i >= n; i--) template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; } using ll = long long; using namespace std; constexpr long long MAX = 5100000; constexpr long long INF = 1LL << 60; constexpr int MOD = 1000000007; int main() { cin.tie(0); ios::sync_with_stdio(false); ll N; cin >> N; reps(n, N + 1, 1) { ll r = sqrt(2 * n); int cnt = 0; reps(x, r + 1, 1) { reps(y, r + 1 - x, 1) { for (int z = 1; z < r + 1 - x && z < r + 1 - y; z++) { int S = (x + y) * (x + y) + (z + y) * (z + y) + (x + z) * (x + z); if (S == 2 * n) { cnt++; } } } } cout << cnt << endl; } return 0; }
#include <bits/stdc++.h> #define pb push_back #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, n, s) for (int i = (s); i < (n); i++) #define rrep(i, n) for (int i = (n - 1); i >= 0; i--) #define rreps(i, n, s) for (int i = s; i >= n; i--) template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; } using ll = long long; using namespace std; constexpr long long MAX = 5100000; constexpr long long INF = 1LL << 60; constexpr int MOD = 1000000007; int main() { cin.tie(0); ios::sync_with_stdio(false); ll N; cin >> N; reps(n, N + 1, 1) { ll r = sqrt(2 * n); int cnt = 0; reps(x, r + 1, 1) { reps(y, r + 1 - x, 1) { ll b = x + y; ll c = x * x + y * y + x * y - n; ll d = b * b - 4 * c; if (d > 0 && ceil(sqrt(d)) == floor(sqrt(d)) && (-b + sqrt(d)) >= 1) { cnt++; } } } cout << cnt << endl; } return 0; }
replace
38
43
38
44
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repI(i, d, n) for (int i = (d); i < (n); ++i) #define reps1(i, n) for (int i = 1; i < (n); ++i) using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } using ll = long long; using P = pair<int, int>; using Pl = pair<ll, ll>; using M = map<int, int>; using Ml = map<ll, ll>; ll const INF = 1ll << 61; double pi = 3.141592653589793238; int main() { ll n; cin >> n; reps1(i, n + 1) { ll ans = 0; reps1(x, i) { reps1(y, i) { ll judge = (x + y) * (x + y) - 4 * (x * x + y * y + x * y - i); // cout << i << " " << x << " " << y << " " << judge << endl; if (ll(sqrt(judge)) * ll(sqrt(judge)) != judge) continue; // cout << "a"; if (-(x + y) * (x + y) + judge <= 0) continue; // cout << "b"; // cout << -(x+y)*(x+y) + judge << endl; if ((-(x + y) * (x + y) + judge) % 2 != 0) continue; // cout << "c" << endl; ans++; } } cout << ans << endl; } return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repI(i, d, n) for (int i = (d); i < (n); ++i) #define reps1(i, n) for (int i = 1; i < (n); ++i) using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } using ll = long long; using P = pair<int, int>; using Pl = pair<ll, ll>; using M = map<int, int>; using Ml = map<ll, ll>; ll const INF = 1ll << 61; double pi = 3.141592653589793238; int main() { ll n; cin >> n; reps1(i, n + 1) { ll ans = 0; reps1(x, ll(sqrt(i))) { reps1(y, ll(sqrt(i))) { ll judge = (x + y) * (x + y) - 4 * (x * x + y * y + x * y - i); // cout << i << " " << x << " " << y << " " << judge << endl; if (ll(sqrt(judge)) * ll(sqrt(judge)) != judge) continue; // cout << "a"; if (-(x + y) * (x + y) + judge <= 0) continue; // cout << "b"; // cout << -(x+y)*(x+y) + judge << endl; if ((-(x + y) * (x + y) + judge) % 2 != 0) continue; // cout << "c" << endl; ans++; } } cout << ans << endl; } return 0; }
replace
34
36
34
36
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repI(i, d, n) for (int i = (d); i < (n); ++i) #define reps1(i, n) for (int i = 1; i < (n); ++i) using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } using ll = long long; using P = pair<int, int>; using Pl = pair<ll, ll>; using M = map<int, int>; using Ml = map<ll, ll>; ll const INF = 1ll << 61; double pi = 3.141592653589793238; int main() { ll n; cin >> n; vector<ll> ans(n); reps1(x, ll(sqrt(n))) { reps1(y, ll(sqrt(n))) { reps1(z, ll(sqrt(n))) { ans[x * x + y * y + z * z + x * y + y * z + z * x]++; } } } reps1(i, n + 1) cout << ans[i] << endl; /* reps1(i, n+1) { ll ans = 0; reps1(x, ll(sqrt(i))) { reps1(y, ll(sqrt(i))) { ll judge = (x+y)*(x+y) - 4 * (x*x + y*y + x*y - i); // cout << i << " " << x << " " << y << " " << judge << endl; if (ll(sqrt(judge)) * ll(sqrt(judge)) != judge) continue; // cout << "a"; if (-(x+y)*(x+y) + judge <= 0) continue; // cout << "b"; // cout << -(x+y)*(x+y) + judge << endl; if ((-(x+y)*(x+y) + judge) % 2 != 0) continue; // cout << "c" << endl; ans++; } } cout << ans << endl; } */ return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repI(i, d, n) for (int i = (d); i < (n); ++i) #define reps1(i, n) for (int i = 1; i < (n); ++i) using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } using ll = long long; using P = pair<int, int>; using Pl = pair<ll, ll>; using M = map<int, int>; using Ml = map<ll, ll>; ll const INF = 1ll << 61; double pi = 3.141592653589793238; int main() { ll n; cin >> n; vector<ll> ans(n); reps1(x, ll(sqrt(n))) { reps1(y, ll(sqrt(n))) { reps1(z, ll(sqrt(n))) { ll tmp = x * x + y * y + z * z + x * y + y * z + z * x; if (tmp > n) continue; ans[tmp]++; } } } reps1(i, n + 1) cout << ans[i] << endl; /* reps1(i, n+1) { ll ans = 0; reps1(x, ll(sqrt(i))) { reps1(y, ll(sqrt(i))) { ll judge = (x+y)*(x+y) - 4 * (x*x + y*y + x*y - i); // cout << i << " " << x << " " << y << " " << judge << endl; if (ll(sqrt(judge)) * ll(sqrt(judge)) != judge) continue; // cout << "a"; if (-(x+y)*(x+y) + judge <= 0) continue; // cout << "b"; // cout << -(x+y)*(x+y) + judge << endl; if ((-(x+y)*(x+y) + judge) % 2 != 0) continue; // cout << "c" << endl; ans++; } } cout << ans << endl; } */ return 0; }
replace
37
38
37
41
0
p02608
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) #define RREP(i, n) for (int i = (n); i >= 0; --i) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define RFOR(i, a, b) for (int i = (a); i >= (b); --i) #define ALL(v) (v).begin(), (v).end() #define RALL(a) (a).rbegin(), (a).rend() #define uint8_t unsigned char #define uint16_t unsigned short #define uint32_t unsigned int #define uint64_t unsigned long long #define int8_t signed char #define int16_t signed short #define int32_t signed int #define int64_t signed long long using namespace std; // #define PI 3.14159265358979323846 // cout << fixed << setprecision(20); int main(int argc, char const *argv[]) { int N = 0; int f[10001] = {}; cin >> N; for (int x = 1; x <= sqrt(N); x++) { for (int y = 1; y <= sqrt(N); y++) { for (int z = 1; z <= sqrt(N); z++) { f[x * x + y * y + z * z + x * y + y * z + z * x] += 1; } } } for (int i = 1; i <= N; i++) { cout << f[i] << endl; } return 0; }
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) #define RREP(i, n) for (int i = (n); i >= 0; --i) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define RFOR(i, a, b) for (int i = (a); i >= (b); --i) #define ALL(v) (v).begin(), (v).end() #define RALL(a) (a).rbegin(), (a).rend() #define uint8_t unsigned char #define uint16_t unsigned short #define uint32_t unsigned int #define uint64_t unsigned long long #define int8_t signed char #define int16_t signed short #define int32_t signed int #define int64_t signed long long using namespace std; // #define PI 3.14159265358979323846 // cout << fixed << setprecision(20); int main(int argc, char const *argv[]) { int N = 0; int f[10001] = {}; cin >> N; for (int x = 1; x <= sqrt(N); x++) { for (int y = 1; y <= sqrt(N); y++) { for (int z = 1; z <= sqrt(N); z++) { int a = x * x + y * y + z * z + x * y + y * z + z * x; if (a <= N) { f[x * x + y * y + z * z + x * y + y * z + z * x] += 1; } } } } for (int i = 1; i <= N; i++) { cout << f[i] << endl; } return 0; }
replace
31
32
31
35
0
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long int #define ld long double #define vii vector<ll> #define pb push_back #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); using namespace std; const int MOD = 1e9 + 7, N = 1e4 + 3; int main() { fast; ll n, k = 6; cin >> n; for (int i = 1; i <= 5; ++i) { cout << "0\n"; if (i == n) break; } for (int i = 6; i <= n; ++i) { ll ans = 0; for (int j = 1; j <= sqrt(i); ++j) { for (int k = 1; k <= sqrt(i); ++k) { for (int l = 1; l <= sqrt(i); ++l) { int a = (l * l) + (k * k) + (j * j) + (l * k) + (l * j) + (k * j); if (a == i) ++ans; } } } cout << ans << "\n"; } cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n"; return 0; }
#include <bits/stdc++.h> #define ll long long int #define ld long double #define vii vector<ll> #define pb push_back #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); using namespace std; const int MOD = 1e9 + 7, N = 1e4 + 3; int main() { fast; ll n, k = 6; cin >> n; for (int i = 1; i <= 5; ++i) { cout << "0\n"; if (i == n) break; } for (int i = 6; i <= n; ++i) { ll ans = 0; for (int j = 1; j <= sqrt(i); ++j) { for (int k = 1; k <= sqrt(i); ++k) { for (int l = 1; l <= sqrt(i); ++l) { int a = (l * l) + (k * k) + (j * j) + (l * k) + (l * j) + (k * j); if (a == i) ++ans; if (a > i) break; } } } cout << ans << "\n"; } cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n"; return 0; }
insert
29
29
29
31
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <math.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using ll = long long; using vec = vector<int>; using vec2 = vector<vector<int>>; ll inf = pow(2, 62); // x2 + y2 + z2 + xy+yz+zx = x2 + x(y + z) + zy + y2+z2 //(x + y)2 + (y + z)2 + (y + z)2 = 2n int main() { ll n; cin >> n; for (int p = 1; p <= n; p++) { ll count = 0; for (int i = 1; i <= n; i++) { for (int j = i; j <= n; j++) { for (int k = j; k <= n; k++) { if (i * i + j * j + k * k + i * j + j * k + k * i == p) { if (i == j && j == k) { count++; } else if ((i == j && j != k) || (j == k && k != i) || (k == i && i != j)) { count += 3; } else { count += 6; } } } } } cout << count << endl; } }
#include <bits/stdc++.h> #include <math.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using ll = long long; using vec = vector<int>; using vec2 = vector<vector<int>>; ll inf = pow(2, 62); // x2 + y2 + z2 + xy+yz+zx = x2 + x(y + z) + zy + y2+z2 //(x + y)2 + (y + z)2 + (y + z)2 = 2n int main() { ll n; cin >> n; for (int p = 1; p <= n; p++) { ll count = 0; for (int i = 1; i * i <= n; i++) { for (int j = i; j * j + i * i <= n; j++) { for (int k = j; k * k + i * i + j * j <= n; k++) { if (i * i + j * j + k * k + i * j + j * k + k * i == p) { if (i == j && j == k) { count++; } else if ((i == j && j != k) || (j == k && k != i) || (k == i && i != j)) { count += 3; } else { count += 6; } } } } } cout << count << endl; } }
replace
16
19
16
19
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define REP(i, x, n) for (int i = x; i < (int)n; i++) #define rep(i, n) REP(i, 0, n) #define sp(p) cout << setprecision(16) << fixed << p << endl; #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define SORT(a) sort(all(a)) #define RSORT(a) sort(rall(a)) #define UNIQ(a) unique(all(a)) #define UNIQNUM(a) UNIQ(a) - a.begin() #define UNIQIT(a) a.erase(UNIQ(a), a.end()); #define VOUT(v, i) \ rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? "\n" : " "); #define vout(v) VOUT(v, z); #define vdbg(v, i) \ cout << #v << ": "; \ for (int i = 0; i < (int)v.size(); i++) { \ cout << v[i] << " "; \ } \ cout << "\n"; #define vmin(v) *min_element(all(v)) #define vmax(v) *max_element(all(v)) #define vsum(v) accumulate(all(v), 0LL) #define MOUT(m, r, c) \ rep(i, r) { \ rep(j, c) { cout << m[i][j] << " "; } \ cout << endl; \ } #define mout(m) MOUT(m, m.size(), m[0].size()) #define debg(a) cout << #a << ": " << a << endl; #define show(a) \ for (cont & y : a) { \ for (cont & x : y) { \ cout << x << " "; \ } \ cout << endl; \ } #define digit(a) to_string(a).length(); template <class T> inline int out(const T &t) { print(t); putchar('\n'); return 0; } // template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));} // template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;} bool is_palindrome(string s) { return s == string(s.rbegin(), s.rend()); } typedef long long ll; typedef long double ld; typedef pair<ll, ll> P; typedef vector<ll> V; typedef vector<vector<ll>> VV; // const long long MOD=1000000007; const long long INF = 1e18; #define EPS (1e-7) #define PI (acos(-1)) template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } int main() { long long N; scanf("%lld", &N); for (long long i = 1; i <= N; i++) { ll cnt = 0; for (long long x = 1; x <= 100; x++) { if (x * x > i) break; for (long long y = 1; y <= 100; y++) { if (x * x + y * y + x * y > i) break; for (long long z = 1; z <= 100; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) cnt++; } } } cout << cnt << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; #define REP(i, x, n) for (int i = x; i < (int)n; i++) #define rep(i, n) REP(i, 0, n) #define sp(p) cout << setprecision(16) << fixed << p << endl; #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define SORT(a) sort(all(a)) #define RSORT(a) sort(rall(a)) #define UNIQ(a) unique(all(a)) #define UNIQNUM(a) UNIQ(a) - a.begin() #define UNIQIT(a) a.erase(UNIQ(a), a.end()); #define VOUT(v, i) \ rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? "\n" : " "); #define vout(v) VOUT(v, z); #define vdbg(v, i) \ cout << #v << ": "; \ for (int i = 0; i < (int)v.size(); i++) { \ cout << v[i] << " "; \ } \ cout << "\n"; #define vmin(v) *min_element(all(v)) #define vmax(v) *max_element(all(v)) #define vsum(v) accumulate(all(v), 0LL) #define MOUT(m, r, c) \ rep(i, r) { \ rep(j, c) { cout << m[i][j] << " "; } \ cout << endl; \ } #define mout(m) MOUT(m, m.size(), m[0].size()) #define debg(a) cout << #a << ": " << a << endl; #define show(a) \ for (cont & y : a) { \ for (cont & x : y) { \ cout << x << " "; \ } \ cout << endl; \ } #define digit(a) to_string(a).length(); template <class T> inline int out(const T &t) { print(t); putchar('\n'); return 0; } // template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));} // template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;} bool is_palindrome(string s) { return s == string(s.rbegin(), s.rend()); } typedef long long ll; typedef long double ld; typedef pair<ll, ll> P; typedef vector<ll> V; typedef vector<vector<ll>> VV; // const long long MOD=1000000007; const long long INF = 1e18; #define EPS (1e-7) #define PI (acos(-1)) template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } int main() { long long N; scanf("%lld", &N); for (long long i = 1; i <= N; i++) { ll cnt = 0; for (long long x = 1; x <= 100; x++) { if (x * x > i) break; for (long long y = 1; y <= 100; y++) { if (x * x + y * y + x * y > i) break; for (long long z = 1; z <= 100; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x > i) break; if (x * x + y * y + z * z + x * y + y * z + z * x == i) cnt++; } } } cout << cnt << endl; } return 0; }
insert
83
83
83
85
TLE
p02608
C++
Time Limit Exceeded
// Alisher_2211 #include <bits/stdc++.h> #define long long long #define all(vc) vc.begin(), vc.end() #define allr(vc) vc.rbegin(), vc.rend() #define pb push_back #define fi first #define se second #define pi pair<long, long> #define lcm(a, b) (a * b) / __gcd(a, b) using namespace std; void read() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); } long f(long n) { return n * (n - 1) / 2; } void solve() { long n; cin >> n; for (int i = 1; i <= n; ++i) { if (i < 6) { cout << 0 << '\n'; continue; } // if( i != 7 ) continue; long ans = 0; for (int x = 1; x <= i / 6 + 1; ++x) { for (int y = 1; y <= i / 6 + 1; ++y) { // if( y != 2 ) continue; long q = (x * x) + (y * y) + (x * y); long w = -(i - q); long e = x + y; long d = (e * e) - (4 * w); long o1 = (-e + sqrt(d)) / 2; long o2 = (-e - sqrt(d)) / 2; if (o1 > 0) { if (q + (o1 * o1) + (e * o1) == i) ans++; // cout << ans << ' ' << x << ' ' << y << ' ' << o1 << '\n'; } else if (o2 > 0) { if (q + (o2 * o2) + (e * o2) == i) ans++; // cout << ans << ' ' << x << ' ' << y << ' ' << o2 << '\n'; } // return; } } cout << ans << '\n'; } } int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long T = 1; // cin >> T; while (T--) { solve(); cout << '\n'; } cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"; }
// Alisher_2211 #include <bits/stdc++.h> #define long long long #define all(vc) vc.begin(), vc.end() #define allr(vc) vc.rbegin(), vc.rend() #define pb push_back #define fi first #define se second #define pi pair<long, long> #define lcm(a, b) (a * b) / __gcd(a, b) using namespace std; void read() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); } long f(long n) { return n * (n - 1) / 2; } void solve() { long n; cin >> n; for (int i = 1; i <= n; ++i) { if (i < 6) { cout << 0 << '\n'; continue; } // if( i != 7 ) continue; long ans = 0; for (int x = 1; x < sqrt(i); ++x) { for (int y = 1; y < sqrt(i); ++y) { // if( y != 2 ) continue; long q = (x * x) + (y * y) + (x * y); long w = -(i - q); long e = x + y; long d = (e * e) - (4 * w); long o1 = (-e + sqrt(d)) / 2; long o2 = (-e - sqrt(d)) / 2; if (o1 > 0) { if (q + (o1 * o1) + (e * o1) == i) ans++; // cout << ans << ' ' << x << ' ' << y << ' ' << o1 << '\n'; } else if (o2 > 0) { if (q + (o2 * o2) + (e * o2) == i) ans++; // cout << ans << ' ' << x << ' ' << y << ' ' << o2 << '\n'; } // return; } } cout << ans << '\n'; } } int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long T = 1; // cin >> T; while (T--) { solve(); cout << '\n'; } cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"; }
replace
26
28
26
28
TLE
p02608
C++
Runtime Error
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { long long n; std::cin >> n; vector<long long> answers(n + 1, 0); for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { long long val = pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x; answers[val] += 1; } } } for (int i = 1; i <= n; i++) { std::cout << answers[i] << '\n'; } return 0; }
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { long long n; std::cin >> n; vector<long long> answers(n + 1, 0); for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { long long val = pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x; if (n < val) continue; answers[val] += 1; } } } for (int i = 1; i <= n; i++) { std::cout << answers[i] << '\n'; } return 0; }
insert
17
17
17
19
-11
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int a[50005] = {0}; int main() { ios ::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 1; i <= sqrt(n); i++) { for (int j = 1; j <= sqrt(n); j++) { for (int k = 1; k <= sqrt(n); k++) { int x = i * i + j * j + k * k + i * j + i * k + j * k; a[x]++; } } } for (int i = 1; i <= n; i++) { cout << a[i] << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int a[60005] = {0}; int main() { ios ::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 1; i <= sqrt(n); i++) { for (int j = 1; j <= sqrt(n); j++) { for (int k = 1; k <= sqrt(n); k++) { int x = i * i + j * j + k * k + i * j + i * k + j * k; a[x]++; } } } for (int i = 1; i <= n; i++) { cout << a[i] << endl; } return 0; }
replace
3
4
3
4
0
p02608
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <unordered_set> #include <valarray> #include <vector> #include <utility> #include <deque> #include <queue> using namespace std; long long a[10001]; int main() { long long n; cin >> n; long long x, y, z; long long counter; set<long long> numbers; for (int i = 1; i <= n; i++) { numbers.insert(i); } for (x = 1; x <= n; x++) { counter = 0; for (y = 1; y <= 98; y++) { for (z = 1; z <= 98; z++) { long long c = (x * x) + (y * y) + (z * z) + (x * y) + (z * x) + (z * y); auto it = numbers.find(c); if (it != numbers.end()) { a[c]++; } } } } for (int i = 1; i <= n; i++) { cout << a[i] << endl; } return 0; }
#include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <set> #include <string> #include <unordered_set> #include <valarray> #include <vector> #include <utility> #include <deque> #include <queue> using namespace std; long long a[10001]; int main() { long long n; cin >> n; long long x, y, z; long long counter; set<long long> numbers; for (int i = 1; i <= n; i++) { numbers.insert(i); } for (x = 1; x <= 98; x++) { for (y = 1; y <= 98; y++) { for (z = 1; z <= 98; z++) { long long c = (x * x) + (y * y) + (z * z) + (x * y) + (z * x) + (z * y); auto it = numbers.find(c); if (it != numbers.end()) { a[c]++; } } } } for (int i = 1; i <= n; i++) { cout << a[i] << endl; } return 0; }
replace
29
31
29
31
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) #define _GLIBCXX_DEBUG int n, ans; int max_n(double t) { if (t < 5) return t; t = sqrt(t); return t; } int main() { cin >> n; rep2(i, 1, n + 1) { double mn = max_n(i); ans = 0; rep2(x, 1, mn) rep2(y, 1, mn) rep2(z, 1, mn) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) ans++; } cout << ans << endl; } }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) #define _GLIBCXX_DEBUG int n, ans; int max_n(double t) { if (t < 5) return t; t = sqrt(t); return t; } int main() { cin >> n; rep2(i, 1, n + 1) { double mn = max_n(i); ans = 0; rep2(x, 1, mn) rep2(y, x, mn) rep2(z, y, mn) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) { if (x != y && y != z) ans += 6; else if (x == y && y == z) ans += 1; else ans += 3; } } cout << ans << endl; } }
replace
20
23
20
29
TLE
p02608
C++
Runtime Error
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> ans(N + 1); int n = sqrt(N); for (int x = 1; x < n; x++) { for (int y = 1; y < n; y++) { for (int z = 1; z < n; z++) { int a = (x + y + z) * (x + y + z) - (x * y + y * z + z * x); ans[a]++; } } } for (int i = 1; i <= N; i++) { cout << ans[i] << endl; } }
#include <cmath> #include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> ans(N + 1); int n = sqrt(N); for (int x = 1; x < n; x++) { for (int y = 1; y < n; y++) { for (int z = 1; z < n; z++) { int a = (x + y + z) * (x + y + z) - (x * y + y * z + z * x); if (a >= 1 && a <= N) ans[a]++; } } } for (int i = 1; i <= N; i++) { cout << ans[i] << endl; } }
replace
14
15
14
16
0
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define REP1(i, n) for (int i = 1, i##_len = (n); i < i##_len; ++i) #define ll long long static const int MAX = 10000; static const ll INFTY = 1e12; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } const ll MRINF = 5000000000000000; int main() { ll N; cin >> N; vector<ll> ans(N + 10); REP1(x, 101) { REP1(y, 101) { REP1(z, 101) { ans[x * x + y * y + z * z + x * y + y * z + z * x]++; } } } REP(i, N) { cout << ans[i + 1] << endl; } } /* _ooOoo_ o8888888o 88" . "88 (| -_- |) O\ = /O ____/`---'\____ .' \\| |// `. / \\||| : |||// \ / _||||| -:- |||||- \ | | \\\ - /// | | | \_| ''\---/'' | | \ .-\__ `-` ___/-. / ___`. .' /--.--\ `. . __ ."" '< `.___\_<|>_/___.' >'"". | | : `- \`.;`\ _ /`;.`/ - ` : | | \ \ `-. \_ __\ /__ _/ .-` / / ======`-.____`-.___\_____/___.-`____.-'====== `=---=' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pass System Test! */
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define REP1(i, n) for (int i = 1, i##_len = (n); i < i##_len; ++i) #define ll long long static const int MAX = 10000; static const ll INFTY = 1e12; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } const ll MRINF = 5000000000000000; int main() { ll N; cin >> N; vector<ll> ans(100000000); REP1(x, 101) { REP1(y, 101) { REP1(z, 101) { ans[x * x + y * y + z * z + x * y + y * z + z * x]++; } } } REP(i, N) { cout << ans[i + 1] << endl; } } /* _ooOoo_ o8888888o 88" . "88 (| -_- |) O\ = /O ____/`---'\____ .' \\| |// `. / \\||| : |||// \ / _||||| -:- |||||- \ | | \\\ - /// | | | \_| ''\---/'' | | \ .-\__ `-` ___/-. / ___`. .' /--.--\ `. . __ ."" '< `.___\_<|>_/___.' >'"". | | : `- \`.;`\ _ /`;.`/ - ` : | | \ \ `-. \_ __\ /__ _/ .-` / / ======`-.____`-.___\_____/___.-`____.-'====== `=---=' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pass System Test! */
replace
30
31
30
31
-11
p02608
C++
Runtime Error
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { int n; scanf("%d", &n); int flag[10001] = {0}; for (int x = 1; x < 100; x++) { for (int y = 1; y < 100; y++) { for (int z = 1; z < 100; z++) { int s = x * x + y * y + z * z + z * x + x * y + z * y; flag[s]++; } } } for (int i = 1; i <= n; i++) cout << flag[i] << endl; return 0; }
#include <cmath> #include <cstdio> #include <iostream> using namespace std; int main() { int n; scanf("%d", &n); int flag[10001] = {0}; for (int x = 1; x < 100; x++) { for (int y = 1; y < 100; y++) { for (int z = 1; z < 100; z++) { int s = x * x + y * y + z * z + z * x + x * y + z * y; if (s <= 10000) flag[s]++; } } } for (int i = 1; i <= n; i++) cout << flag[i] << endl; return 0; }
replace
14
15
14
16
-11
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> cnt(n + 1, 0); for (int x = 1; x * x <= n; x++) { for (int y = 1; y * y <= n; y++) { for (int z = 1; z * z <= n; z++) { int res = x * x + y * y + z * z + x * y + y * z + z * x; cnt[res]++; } } } for (int i = 1; i <= n; i++) cout << cnt[i] << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> cnt(n + 1, 0); for (int x = 1; x * x <= n; x++) { for (int y = 1; y * y <= n; y++) { for (int z = 1; z * z <= n; z++) { int res = x * x + y * y + z * z + x * y + y * z + z * x; if (res > n) break; cnt[res]++; } } } for (int i = 1; i <= n; i++) cout << cnt[i] << endl; return 0; }
insert
11
11
11
13
0
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; /* s.find_by_order(k) ---> returns iterator to the element at index(from 0) k s.order_of_key(val) ---> number of elements that are strictly smaller than the given value */ typedef long long int ll; typedef unsigned long long ull; typedef long double ld; typedef vector<int> vi; typedef vector<long long int> vl; typedef vector<vector<int>> vvi; typedef vector<vector<long long int>> vvl; typedef pair<int, int> pii; typedef pair<long long int, long long int> pll; typedef vector<pair<int, int>> vii; typedef vector<pair<long long int, long long int>> vll; #define fastIO() \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define test() \ long long int tc; \ cin >> tc; \ cin.ignore(); \ while (tc--) #define ff first #define ss second #define pb push_back #define pf push_front #define mp make_pair #define MOD 1000000007 #define SMOD 998244353 #define HASH 18014398241046527 #define pq priority_queue #define all(x) x.begin(), x.end() #define SP(x) setprecision(x) #define sp " " #define inp(a) \ ll a; \ cin >> a; \ cin.ignore() #define inps(a, b) \ ll a, b; \ cin >> a >> b; \ cin.ignore() #define out(a) cout << SP(20) << a << '\n' #define outs(a, b) cout << SP(20) << a << " " << b << '\n' #define ins insert #define er erase #define lb lower_bound #define ub upper_bound #define printclock \ cerr << "Time : " << 1000 * (ld)clock() / (ld)CLOCKS_PER_SEC << "ms\n"; #define inpa(a, n) \ ll a[n]; \ for (int i = 0; i < n; i++) { \ cin >> a[i]; \ } #define inpv(a, n) \ vl a; \ for (int i = 0; i < n; i++) { \ inp(x); \ a.pb(x); \ } #define outa(a, n) \ for (int i = 0; i < n; i++) { \ cout << a[i] << " "; \ } \ cout << '\n'; #define outv(v) \ for (auto i : v) { \ cout << i << " "; \ } \ cout << '\n'; set<char> vow = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'}; ll xpow(ll n, ll m) { if (m == 0) { return 1; } else { ll x = xpow(n, m / 2); if (m & 1) { return x * x * n; } else { return x * x; } } } ll xmod(ll a, ll m) { return (((a % m) + m) % m); } ll xmodpow(ll n, ll m, ll y) { if (m == 0) { return 1; } else { ll x = xmodpow(n, m / 2, y); if (m & 1) { return xmod((xmod((xmod(x, y) * xmod(x, y)), y) * xmod(n, y)), y); } else { return xmod((xmod(x, y) * xmod(x, y)), y); } } } template <typename T> ll SIZEOF(T a) { return (ll)a.size(); } ll xlcm(ll a, ll b) { return (a / __gcd(a, b)) * b; } ll dx[] = {1, 0, -1, 0}; ll dy[] = {0, 1, 0, -1}; const int N = 100005; void SOLVE() { ll n; cin >> n; for (ll i = 1; i <= n; i++) { ll ans = 0; ll cap = sqrt(i); for (ll x = 1; x <= cap; x++) { for (ll y = 1; y <= cap; y++) { for (ll z = 1; z <= cap; z++) { ll val = x * x + y * y + z * z + x * y + x * z + y * z; if (val == i) { ans++; } } } } cout << ans << '\n'; } } int main() { fastIO(); // #ifndef ONLINE_JUDGE // freopen("i.txt", "r", stdin); // freopen("o.txt", "w", stdout); // #endif ll TC = 1; // cin >> TC; for (ll tc1 = 1; tc1 <= TC; tc1++) { // cout << "Case #" << tc1 << ": "; SOLVE(); } printclock; }
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; /* s.find_by_order(k) ---> returns iterator to the element at index(from 0) k s.order_of_key(val) ---> number of elements that are strictly smaller than the given value */ typedef long long int ll; typedef unsigned long long ull; typedef long double ld; typedef vector<int> vi; typedef vector<long long int> vl; typedef vector<vector<int>> vvi; typedef vector<vector<long long int>> vvl; typedef pair<int, int> pii; typedef pair<long long int, long long int> pll; typedef vector<pair<int, int>> vii; typedef vector<pair<long long int, long long int>> vll; #define fastIO() \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define test() \ long long int tc; \ cin >> tc; \ cin.ignore(); \ while (tc--) #define ff first #define ss second #define pb push_back #define pf push_front #define mp make_pair #define MOD 1000000007 #define SMOD 998244353 #define HASH 18014398241046527 #define pq priority_queue #define all(x) x.begin(), x.end() #define SP(x) setprecision(x) #define sp " " #define inp(a) \ ll a; \ cin >> a; \ cin.ignore() #define inps(a, b) \ ll a, b; \ cin >> a >> b; \ cin.ignore() #define out(a) cout << SP(20) << a << '\n' #define outs(a, b) cout << SP(20) << a << " " << b << '\n' #define ins insert #define er erase #define lb lower_bound #define ub upper_bound #define printclock \ cerr << "Time : " << 1000 * (ld)clock() / (ld)CLOCKS_PER_SEC << "ms\n"; #define inpa(a, n) \ ll a[n]; \ for (int i = 0; i < n; i++) { \ cin >> a[i]; \ } #define inpv(a, n) \ vl a; \ for (int i = 0; i < n; i++) { \ inp(x); \ a.pb(x); \ } #define outa(a, n) \ for (int i = 0; i < n; i++) { \ cout << a[i] << " "; \ } \ cout << '\n'; #define outv(v) \ for (auto i : v) { \ cout << i << " "; \ } \ cout << '\n'; set<char> vow = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'}; ll xpow(ll n, ll m) { if (m == 0) { return 1; } else { ll x = xpow(n, m / 2); if (m & 1) { return x * x * n; } else { return x * x; } } } ll xmod(ll a, ll m) { return (((a % m) + m) % m); } ll xmodpow(ll n, ll m, ll y) { if (m == 0) { return 1; } else { ll x = xmodpow(n, m / 2, y); if (m & 1) { return xmod((xmod((xmod(x, y) * xmod(x, y)), y) * xmod(n, y)), y); } else { return xmod((xmod(x, y) * xmod(x, y)), y); } } } template <typename T> ll SIZEOF(T a) { return (ll)a.size(); } ll xlcm(ll a, ll b) { return (a / __gcd(a, b)) * b; } ll dx[] = {1, 0, -1, 0}; ll dy[] = {0, 1, 0, -1}; const int N = 100005; void SOLVE() { ll n; cin >> n; for (ll i = 1; i <= n; i++) { ll ans = 0; ll cap = sqrt(i); for (ll x = 1; x <= cap; x++) { for (ll y = 1; y <= cap; y++) { ll c = x * x + y * y + x * y; ll b = x + y; c = c - i; ll a = b * b - 4 * c; if (a >= 0) { ll aa = sqrt(a); if (aa * aa == a) { ll check = -b + aa; if (check % 2 == 0) { if (check >= 1) { ans++; } } } } } } cout << ans << '\n'; } } int main() { fastIO(); // #ifndef ONLINE_JUDGE // freopen("i.txt", "r", stdin); // freopen("o.txt", "w", stdout); // #endif ll TC = 1; // cin >> TC; for (ll tc1 = 1; tc1 <= TC; tc1++) { // cout << "Case #" << tc1 << ": "; SOLVE(); } printclock; }
replace
124
128
124
137
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> // using namespace boost::multiprecision; #define speed \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #pragma GCC optimize "trapv" #define _GLIBCXX_DEBUG #define ll long long int #define ld long double #define ull unsigned long long int // ranges from (0 - twice of long long int) #define rep(i, a, n) for (ll i = a; i < n; i++) #define per(i, a, n) for (ll i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define vll vector<ll> #define MOD 1000000007LL #define llpair pair<ll, ll> #define INF 1000000000000000000ll // this is 1e18 long long #define np next_permutation #define PI acos(-1) #define DEB(x) cout << #x << " " << x << endl; #define rotate_left(vec, amt) rotate(vec.begin(), vec.begin() + amt, vec.end()); #define rotate_right(vec, amt) \ rotate(vec.begin(), vec.begin() + vec.size() - amt, vec.end()); #define all(x) x.begin(), x.end() #define sortall(x) sort(all(x)) #define clr(x) memset(x, 0, sizeof(x)) using namespace std; ll a[10004]; int main() { speed; ll n; cin >> n; rep(i, 1, 102) rep(j, 1, 102) rep(k, 1, 102) { a[i * i + j * j + k * k + j * k + k * i + j * i]++; } rep(i, 1, n + 1) { cout << a[i] << endl; } return 0; }
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> // using namespace boost::multiprecision; #define speed \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #pragma GCC optimize "trapv" #define _GLIBCXX_DEBUG #define ll long long int #define ld long double #define ull unsigned long long int // ranges from (0 - twice of long long int) #define rep(i, a, n) for (ll i = a; i < n; i++) #define per(i, a, n) for (ll i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define vll vector<ll> #define MOD 1000000007LL #define llpair pair<ll, ll> #define INF 1000000000000000000ll // this is 1e18 long long #define np next_permutation #define PI acos(-1) #define DEB(x) cout << #x << " " << x << endl; #define rotate_left(vec, amt) rotate(vec.begin(), vec.begin() + amt, vec.end()); #define rotate_right(vec, amt) \ rotate(vec.begin(), vec.begin() + vec.size() - amt, vec.end()); #define all(x) x.begin(), x.end() #define sortall(x) sort(all(x)) #define clr(x) memset(x, 0, sizeof(x)) using namespace std; ll a[10004]; int main() { speed; ll n; cin >> n; rep(i, 1, 102) rep(j, 1, 102) rep(k, 1, 102) { ll x; x = i * i + j * j + k * k + j * k + k * i + j * i; if (x < 10004) a[x]++; } rep(i, 1, n + 1) { cout << a[i] << endl; } return 0; }
replace
36
37
36
40
-11
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int64; typedef vector<int> vec; typedef vector<int64> vec64; #define db(x) cout << "> " << #x << ": " << x << "\n"; #define ss cout << " "; #define ct(x) cout << x; #define nn cout << "\n"; #define cts(x) cout << x << " "; #define ctn(x) cout << x << "\n"; #define qr queries(); void solve(); void YN(bool b) { if (b) { ctn("YES"); } else { ctn("NO"); } }; void yn(bool b) { if (b) { ctn("Yes"); } else { ctn("No"); } }; void queries() { int n; cin >> n; while (n--) solve(); } // // // // // // // // // // // // // // // // // // // // // // /* TEMPLATE - VANILLA */ // // // // // // // // // // // // // // // // // // // // // // int64 q, n; void solve() { return; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vec arr(n); for (int i = 1; i <= 110; i++) { for (int j = 1; j <= 110; j++) { for (int k = 1; k <= 110; k++) { int64 l = i * i + j * j + k * k + i * j + j * k + k * i; if (l <= 10100) { arr[l]++; } } } } for (int i = 1; i <= n; i++) { ctn(arr[i]); } return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long int64; typedef vector<int> vec; typedef vector<int64> vec64; #define db(x) cout << "> " << #x << ": " << x << "\n"; #define ss cout << " "; #define ct(x) cout << x; #define nn cout << "\n"; #define cts(x) cout << x << " "; #define ctn(x) cout << x << "\n"; #define qr queries(); void solve(); void YN(bool b) { if (b) { ctn("YES"); } else { ctn("NO"); } }; void yn(bool b) { if (b) { ctn("Yes"); } else { ctn("No"); } }; void queries() { int n; cin >> n; while (n--) solve(); } // // // // // // // // // // // // // // // // // // // // // // /* TEMPLATE - VANILLA */ // // // // // // // // // // // // // // // // // // // // // // int64 q, n; void solve() { return; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vec arr(100500); for (int i = 1; i <= 110; i++) { for (int j = 1; j <= 110; j++) { for (int k = 1; k <= 110; k++) { int64 l = i * i + j * j + k * k + i * j + j * k + k * i; if (l <= 10100) { arr[l]++; } } } } for (int i = 1; i <= n; i++) { ctn(arr[i]); } return 0; }
replace
45
46
45
46
0
p02608
C++
Runtime Error
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } using namespace std; using ll = long long; using P = pair<int, int>; using Pl = pair<long long, long long>; using veci = vector<int>; using vecl = vector<long long>; using vecveci = vector<vector<int>>; using vecvecl = vector<vector<long long>>; vecl f(10001); int main() { int N; cin >> N; for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { ll ret = x * x + y * y + z * z + x * y + y * z + x * z; if (ret <= 10001) f[ret]++; } } } for (int i = 1; i <= N; i++) cout << f[i] << endl; }
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } using namespace std; using ll = long long; using P = pair<int, int>; using Pl = pair<long long, long long>; using veci = vector<int>; using vecl = vector<long long>; using vecveci = vector<vector<int>>; using vecvecl = vector<vector<long long>>; vecl f(10001); int main() { int N; cin >> N; for (int x = 1; x <= 100; x++) { for (int y = 1; y <= 100; y++) { for (int z = 1; z <= 100; z++) { ll ret = x * x + y * y + z * z + x * y + y * z + x * z; if (ret <= 10000) f[ret]++; } } } for (int i = 1; i <= N; i++) cout << f[i] << endl; }
replace
34
35
34
35
-6
corrupted size vs. prev_size
p02608
C++
Time Limit Exceeded
#include <cmath> #include <cstdio> using namespace std; int main() { int n, cnt = 0; scanf("%d", &n); for (int i = 1; i <= n; i++) { int x, y, z; for (x = 1; x <= sqrt(i); x++) { for (y = 1; y <= sqrt(i); y++) { for (z = 1; z <= sqrt(i); z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) { cnt++; } } } } printf("%d\n", cnt); cnt = 0; } return 0; }
#include <cmath> #include <cstdio> using namespace std; int main() { int n, cnt = 0; scanf("%d", &n); for (int i = 1; i <= n; i++) { int a, b, c; for (a = -sqrt(2 * i); a <= sqrt(2 * i); a++) { for (b = -sqrt(2 * i); b <= sqrt(2 * i); b++) { if ((int)sqrt(2 * i - a * a - b * b) == sqrt(2 * i - a * a - b * b)) { c = sqrt(2 * i - a * a - b * b); if ((a - b) + c >= 2 && (b - c) + a >= 2 && (b - a) + c >= 2) { cnt++; } } } } printf("%d\n", cnt); cnt = 0; } return 0; }
replace
8
13
8
14
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (i = 1; i <= n; i++) // 2D::rep(i,j)rep(j,j)cin>>bin[i][j]; // vector<int> a(n) #define Graph vector<vector<int>> #define A1 cout << "No" << endl #define A2 cout << "Yes" << endl #define A3 cout << ans << #define AA(i) cout << i << endl; const int U = 2e5 + 5; const ll MOD = 1000000007; const int INF = 1001001001; int main() { int N; cin >> N; int i, j, k; vector<int> a(N + 1); rep(i, N) { rep(j, N) { rep(k, N) { int b = (i + j) * (i + j) + (j + k) * (j + k) + (k + i) * (k + i); if (b / 2 <= N) a[b / 2]++; } } } rep(i, N) AA(a[i]); return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (i = 1; i <= n; i++) // 2D::rep(i,j)rep(j,j)cin>>bin[i][j]; // vector<int> a(n) #define Graph vector<vector<int>> #define A1 cout << "No" << endl #define A2 cout << "Yes" << endl #define A3 cout << ans << #define AA(i) cout << i << endl; const int U = 2e5 + 5; const ll MOD = 1000000007; const int INF = 1001001001; int main() { int N; cin >> N; int i, j, k; vector<int> a(N + 1); rep(i, 150) { rep(j, 150) { rep(k, 150) { int b = (i + j) * (i + j) + (j + k) * (j + k) + (k + i) * (k + i); if (b / 2 <= N) a[b / 2]++; } } } rep(i, N) AA(a[i]); return 0; }
replace
20
23
20
23
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; typedef pair<int, int> P; struct edge { int to, id; }; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define mod 1000000007 using graph = vector<vector<ll>>; int main() { int n; cin >> n; int ans = 0; for (int i = 1; i <= n; i++) { ans = 0; for (int j = 1; j < 100; j++) { for (int k = j; k < 100; k++) { for (int l = k; l < 100; l++) { if (((j + k) * (j + k) + (k + l) * (k + l) + (j + l) * (j + l)) / 2.0 == i) { int x, y, z; int temp = j + k + l; x = temp / 2 - (k + l); y = temp / 2 - (j + l); z = temp / 2 - (k + j); if (x == y && y == z) ans++; else if (x == y && y != z) ans += 3; else if (x == z && y != z) ans += 3; else if (y == z && x != z) ans += 3; else ans += 6; } } } } cout << ans << endl; } }
#include <bits/stdc++.h> using namespace std; using ll = long long; typedef pair<int, int> P; struct edge { int to, id; }; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define mod 1000000007 using graph = vector<vector<ll>>; int main() { int n; cin >> n; int ans = 0; for (int i = 1; i <= n; i++) { ans = 0; for (int j = 1; j <= (int)sqrt(i); j++) { for (int k = j; k <= (int)sqrt(i); k++) { for (int l = k; l <= (int)sqrt(i); l++) { if (((j + k) * (j + k) + (k + l) * (k + l) + (j + l) * (j + l)) / 2.0 == i) { int x, y, z; int temp = j + k + l; x = temp / 2 - (k + l); y = temp / 2 - (j + l); z = temp / 2 - (k + j); if (x == y && y == z) ans++; else if (x == y && y != z) ans += 3; else if (x == z && y != z) ans += 3; else if (y == z && x != z) ans += 3; else ans += 6; } } } } cout << ans << endl; } }
replace
20
23
20
23
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n = 0; cin >> n; for (ll i = 1; i <= n; i++) { ll sum = 0; for (ll j = 1; j * j <= n; j++) { for (ll k = 1; k * k <= n; k++) { for (ll l = 1; l * l <= n; l++) { if (l * l + j * j + k * k + l * k + l * j + k * j == i) { sum++; } } } } cout << sum << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n = 0; cin >> n; for (ll i = 1; i <= n; i++) { ll sum = 0; for (ll j = 1; j * j <= n; j++) { for (ll k = 1; k * k <= n; k++) { if ((j + k) * (j + k) < (4 * (j * j + k * k + j * k - i))) { continue; } if (sqrt(((j + k) * (j + k)) - (4 * (j * j + k * k + j * k - i))) - (j + k) >= 1 && (sqrt(((j + k) * (j + k)) - (4 * (j * j + k * k + j * k - i))) - (j + k)) - floor(sqrt(((j + k) * (j + k)) - (4 * (j * j + k * k + j * k - i))) - (j + k)) == 0) { // cout << i << j << k << endl; // cout << sqrt( ((j + k) * (j + k)) - (4 * (j * j + k * k + j * k - // i) ) ) - (j + k) << endl; sum++; } } } cout << sum << endl; } return 0; }
replace
13
17
13
29
TLE
p02608
C++
Time Limit Exceeded
#include <cmath> #include <cstdint> #include <iostream> #include <string> #include <vector> int main(int argc, char *argv[]) { int64_t N; std::cin >> N; const int64_t maxXYZ = int64_t(std::sqrt(double(N + 1))); for (int64_t n = 1; n <= N; ++n) { int cnt = 0; for (int64_t x = 1; x <= maxXYZ; ++x) { int64_t x2 = x * x; if (x2 > n) { continue; } for (int64_t y = 1; y <= maxXYZ; ++y) { int64_t y2 = y * y; int64_t xy = x * y; if (x2 + y2 + xy > n) { break; } for (int64_t z = 1; z <= maxXYZ; ++z) { int64_t z2 = z * z; if (x2 + y2 + xy + z2 > n) { break; } if (x2 + y2 + z2 + xy + y * z + z * x == n) { ++cnt; } } } } std::cout << cnt << std::endl; } }
#include <cmath> #include <cstdint> #include <iostream> #include <string> #include <vector> int main(int argc, char *argv[]) { int64_t N; std::cin >> N; const int64_t maxXYZ = int64_t(std::sqrt(double(N + 1))); for (int64_t n = 1; n <= N; ++n) { int cnt = 0; for (int64_t x = 1; x <= maxXYZ; ++x) { int64_t x2 = x * x; if (x2 > n) { break; } for (int64_t y = 1; y <= maxXYZ; ++y) { int64_t y2 = y * y; int64_t xy = x * y; if (x2 + y2 + xy > n) { break; } for (int64_t z = 1; z <= maxXYZ; ++z) { int64_t z2 = z * z; if (x2 + y2 + xy + z2 > n) { break; } if (x2 + y2 + z2 + xy + y * z + z * x == n) { ++cnt; } } } } std::cout << cnt << std::endl; } }
replace
16
17
16
17
TLE
p02608
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <unordered_map> #include <utility> using namespace std; typedef long long int ll; #define SP(x) setprecision((int)x) #define SW(x) setw(x) // 桁数指定 #define SF(c) setfill(c) // 埋め文字指定('0') #define ALL(v) v.begin(), v.end() int main(int argc, char const *argv[]) { ll n; cin >> n; for (ll i = 1; i <= n; i++) { ll ans = 0; for (ll x = 1; x * x < i; x++) { for (ll y = 1; y * y < i; y++) { for (ll z = 1; z * z < i; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) { ans++; } } } } cout << ans << endl; } }
#include <algorithm> #include <array> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <climits> #include <cmath> #include <cstdio> #include <iomanip> #include <unordered_map> #include <utility> using namespace std; typedef long long int ll; #define SP(x) setprecision((int)x) #define SW(x) setw(x) // 桁数指定 #define SF(c) setfill(c) // 埋め文字指定('0') #define ALL(v) v.begin(), v.end() int main(int argc, char const *argv[]) { ll n; cin >> n; for (ll i = 1; i <= n; i++) { ll ans = 0; for (ll x = 1; x * x < i; x++) { for (ll y = 1; y * y + x * y + x * x < i; y++) { for (ll z = 1; x * x + y * y + z * z + x * y + y * z + z * x <= i; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) { ans++; } } } } cout << ans << endl; } }
replace
34
36
34
37
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(a) (a).begin(), (a).end() using namespace std; using ll = long long int; using vec = vector<int>; using P = pair<int, int>; const int INF = 1e9 + 7; int main() { int n; cin >> n; vec f(n + 1, 0); for (int x = 1; x * x < n; x++) { for (int y = 1; y * y < n; y++) { for (int z = 1; z * z < n; z++) { f[x * x + y * y + z * z + x * y + y * z + z * x]++; } } } for (int i = 1; i <= n; i++) { cout << f[i] << endl; } }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(a) (a).begin(), (a).end() using namespace std; using ll = long long int; using vec = vector<int>; using P = pair<int, int>; const int INF = 1e9 + 7; int main() { int n; cin >> n; vec f(n + 1, 0); for (int x = 1; x * x < n; x++) { for (int y = 1; y * y < n; y++) { for (int z = 1; z * z < n; z++) { int i = x * x + y * y + z * z + x * y + y * z + z * x; if (i <= n) f[i]++; } } } for (int i = 1; i <= n; i++) { cout << f[i] << endl; } }
replace
17
18
17
20
0
p02608
C++
Runtime Error
#include <iostream> using namespace std; int t, n; int d[10001]; int main() { cin >> n; for (int x = 1; x * x <= n; x++) for (int y = 1; y * y <= n; y++) for (int z = 1; z * z <= n; z++) { t = x * x + y * y + z * z + x * y + y * z + z * x; d[t]++; } for (int i = 1; i <= n; i++) cout << d[i] << endl; return 0; }
#include <iostream> using namespace std; int t, n; int d[10001]; int main() { cin >> n; for (int x = 1; x * x <= n; x++) for (int y = 1; y * y <= n; y++) for (int z = 1; z * z <= n; z++) { t = x * x + y * y + z * z + x * y + y * z + z * x; if (t > n) break; d[t]++; } for (int i = 1; i <= n; i++) cout << d[i] << endl; return 0; }
insert
12
12
12
14
0
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define repd(i, a, b) for (int i = a; i < int(b); i++) #define rep(i, n) repd(i, 0, n) #define VARNAME(v) #v using P = pair<int, int>; constexpr int MOD = 1000000007; // constexpr int MOD = 998244353; constexpr ll INF = 1e16; #pragma region tmp constexpr double EPS = 1e-10; constexpr double PI = 3.141592653589793238462; const string endn = "\n"; const string abc = "abcdefghijklmnopqrstuvwxyz"; const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; template <class T1, class T2> ostream &operator<<(ostream &out, const pair<T1, T2> &o) { out << "(" << o.first << ", " << o.second << ")"; return out; } template <class T> ostream &operator<<(ostream &out, const vector<T> &o) { for (auto itr = o.begin(); itr != o.end(); itr++) out << *itr << (itr + 1 != o.end() ? " " : ""); return out; } template <class T> ostream &operator<<(ostream &out, const deque<T> &o) { for (auto itr = o.begin(); itr != o.end(); itr++) out << *itr << (itr + 1 != o.end() ? " " : ""); return out; } template <class T> ostream &operator<<(ostream &out, const set<T> &o) { out << "{"; for (auto itr = o.begin(); itr != o.end(); itr++) out << *itr << (next(itr, 1) != o.end() ? "," : ""); out << "}"; return out; } template <class T> ostream &operator<<(ostream &out, const multiset<T> &o) { out << "{"; for (auto itr = o.begin(); itr != o.end(); itr++) out << *itr << (next(itr, 1) != o.end() ? "," : ""); out << "}"; return out; } template <class T, class U> ostream &operator<<(ostream &out, const map<T, U> &o) { out << "{"; for (auto itr = o.begin(); itr != o.end(); itr++) out << *itr << (next(itr, 1) != o.end() ? " " : ""); out << "}"; return out; } template <class T, class U> ostream &operator<<(ostream &out, const multimap<T, U> &o) { out << "{"; for (auto itr = o.begin(); itr != o.end(); itr++) out << *itr << (next(itr, 1) != o.end() ? " " : ""); out << "}"; return out; } template <class T> ostream &operator<<(ostream &out, queue<T> o) { while (!o.empty()) out << o.front() << (o.size() > 0 ? " " : ""), o.pop(); return out; } template <class T, class U> ostream &operator<<(ostream &out, priority_queue<T, vector<T>, U> o) { while (!o.empty()) out << o.top() << (o.size() > 0 ? " " : ""), o.pop(); return out; } template <class T> ostream &operator<<(ostream &out, stack<T> o) { while (!o.empty()) out << o.top() << (o.size() > 0 ? " " : ""), o.pop(); return out; } template <class T> inline bool chmin(T &a, T b) { if (a >= b) { a = b; return 1; } return 0; } template <class T> inline bool chmax(T &a, T b) { if (a <= b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, initializer_list<T> b) { T c = min(b); if (a > c) { a = c; return 1; } return 0; } template <class T> inline bool chmax(T &a, initializer_list<T> b) { T c = max(b); if (a < c) { a = c; return 1; } return 0; } inline int mrep(int &a, int M = MOD) { a %= M; return a = (a < 0 ? a + M : a); } inline int add(int &a, int b, int M = MOD) { return a = (mrep(a, M) + mrep(b, M)) % M; } inline int mul(int &a, int b, int M = MOD) { return a = (mrep(a, M) * mrep(b, M)) % M; } inline int add(int &a, initializer_list<int> b, int M = MOD) { return a = (mrep(a, M) + accumulate(b.begin(), b.end(), (int)0, [&M](int acc, int i) { return (acc + mrep(i, M)) % M; })) % M; } inline int mul(int &a, initializer_list<int> b, int M = MOD) { return a = (mrep(a, M) * accumulate(b.begin(), b.end(), (int)1, [&M](int acc, int i) { return (acc * mrep(i, M)) % M; })) % M; } inline int modpow(int b, int e, int M = MOD) { int ret = 1; while (e > 0) { if (e % 2) mul(ret, b, M); mul(b, b, M); e /= 2; }; return ret; } inline int modinv(int a, int M = MOD) { int b = M, u = 1, v = 0; while (b) { int t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } return mrep(u, M); } template <class T> inline void print(T a) { cout << a << endl; } template <class T> inline void print(vector<T> a, int n) { chmin(n, int(a.size())); rep(i, n) cout << a[i] << (i != n - 1 ? " " : "\n"); } template <class T, size_t SIZE> inline void print(T (&a)[SIZE], int n = SIZE) { chmin(n, int(SIZE)); rep(i, n) cout << a[i] << (i != n - 1 ? " " : "\n"); } inline string yesno(bool b) { return (b ? "Yes" : "No"); } #pragma #endregion tmp signed main() { int n; cin >> n; int a[1100]; rep(i, n + 1) a[i] = 0; repd(x, 1, 150) { repd(y, 1, 150) { repd(z, 1, 150) { int k = x * x + y * y + z * z + x * y + y * z + z * x; if (k <= n) a[k]++; } } } repd(i, 1, n + 1) { cout << a[i] << endl; } }
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define repd(i, a, b) for (int i = a; i < int(b); i++) #define rep(i, n) repd(i, 0, n) #define VARNAME(v) #v using P = pair<int, int>; constexpr int MOD = 1000000007; // constexpr int MOD = 998244353; constexpr ll INF = 1e16; #pragma region tmp constexpr double EPS = 1e-10; constexpr double PI = 3.141592653589793238462; const string endn = "\n"; const string abc = "abcdefghijklmnopqrstuvwxyz"; const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; template <class T1, class T2> ostream &operator<<(ostream &out, const pair<T1, T2> &o) { out << "(" << o.first << ", " << o.second << ")"; return out; } template <class T> ostream &operator<<(ostream &out, const vector<T> &o) { for (auto itr = o.begin(); itr != o.end(); itr++) out << *itr << (itr + 1 != o.end() ? " " : ""); return out; } template <class T> ostream &operator<<(ostream &out, const deque<T> &o) { for (auto itr = o.begin(); itr != o.end(); itr++) out << *itr << (itr + 1 != o.end() ? " " : ""); return out; } template <class T> ostream &operator<<(ostream &out, const set<T> &o) { out << "{"; for (auto itr = o.begin(); itr != o.end(); itr++) out << *itr << (next(itr, 1) != o.end() ? "," : ""); out << "}"; return out; } template <class T> ostream &operator<<(ostream &out, const multiset<T> &o) { out << "{"; for (auto itr = o.begin(); itr != o.end(); itr++) out << *itr << (next(itr, 1) != o.end() ? "," : ""); out << "}"; return out; } template <class T, class U> ostream &operator<<(ostream &out, const map<T, U> &o) { out << "{"; for (auto itr = o.begin(); itr != o.end(); itr++) out << *itr << (next(itr, 1) != o.end() ? " " : ""); out << "}"; return out; } template <class T, class U> ostream &operator<<(ostream &out, const multimap<T, U> &o) { out << "{"; for (auto itr = o.begin(); itr != o.end(); itr++) out << *itr << (next(itr, 1) != o.end() ? " " : ""); out << "}"; return out; } template <class T> ostream &operator<<(ostream &out, queue<T> o) { while (!o.empty()) out << o.front() << (o.size() > 0 ? " " : ""), o.pop(); return out; } template <class T, class U> ostream &operator<<(ostream &out, priority_queue<T, vector<T>, U> o) { while (!o.empty()) out << o.top() << (o.size() > 0 ? " " : ""), o.pop(); return out; } template <class T> ostream &operator<<(ostream &out, stack<T> o) { while (!o.empty()) out << o.top() << (o.size() > 0 ? " " : ""), o.pop(); return out; } template <class T> inline bool chmin(T &a, T b) { if (a >= b) { a = b; return 1; } return 0; } template <class T> inline bool chmax(T &a, T b) { if (a <= b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, initializer_list<T> b) { T c = min(b); if (a > c) { a = c; return 1; } return 0; } template <class T> inline bool chmax(T &a, initializer_list<T> b) { T c = max(b); if (a < c) { a = c; return 1; } return 0; } inline int mrep(int &a, int M = MOD) { a %= M; return a = (a < 0 ? a + M : a); } inline int add(int &a, int b, int M = MOD) { return a = (mrep(a, M) + mrep(b, M)) % M; } inline int mul(int &a, int b, int M = MOD) { return a = (mrep(a, M) * mrep(b, M)) % M; } inline int add(int &a, initializer_list<int> b, int M = MOD) { return a = (mrep(a, M) + accumulate(b.begin(), b.end(), (int)0, [&M](int acc, int i) { return (acc + mrep(i, M)) % M; })) % M; } inline int mul(int &a, initializer_list<int> b, int M = MOD) { return a = (mrep(a, M) * accumulate(b.begin(), b.end(), (int)1, [&M](int acc, int i) { return (acc * mrep(i, M)) % M; })) % M; } inline int modpow(int b, int e, int M = MOD) { int ret = 1; while (e > 0) { if (e % 2) mul(ret, b, M); mul(b, b, M); e /= 2; }; return ret; } inline int modinv(int a, int M = MOD) { int b = M, u = 1, v = 0; while (b) { int t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } return mrep(u, M); } template <class T> inline void print(T a) { cout << a << endl; } template <class T> inline void print(vector<T> a, int n) { chmin(n, int(a.size())); rep(i, n) cout << a[i] << (i != n - 1 ? " " : "\n"); } template <class T, size_t SIZE> inline void print(T (&a)[SIZE], int n = SIZE) { chmin(n, int(SIZE)); rep(i, n) cout << a[i] << (i != n - 1 ? " " : "\n"); } inline string yesno(bool b) { return (b ? "Yes" : "No"); } #pragma #endregion tmp signed main() { int n; cin >> n; int a[11000]; rep(i, n + 1) a[i] = 0; repd(x, 1, 150) { repd(y, 1, 150) { repd(z, 1, 150) { int k = x * x + y * y + z * z + x * y + y * z + z * x; if (k <= n) a[k]++; } } } repd(i, 1, n + 1) { cout << a[i] << endl; } }
replace
168
169
168
169
0
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, ans; cin >> n; for (int i = 1; i <= n; i++) { ans = 0; for (int x = 1; x < 100 && x * x < i; x++) { for (int y = 1; y < 100 && x * x + y * y + x * y < i; y++) { for (int z = 1; z < 100; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) ans++; } } } cout << ans << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, ans; cin >> n; for (int i = 1; i <= n; i++) { ans = 0; for (int x = 1; x < 100 && x * x < i; x++) { for (int y = 1; y <= x && x * x + y * y + x * y < i; y++) { for (int z = 1; z <= y; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) { if (x == y && y == z) ans++; else if (x == y || y == z || x == z) ans += 3; else ans += 6; } } } } cout << ans << endl; } return 0; }
replace
9
13
9
19
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int Ull; typedef pair<int, int> PII; template <typename T> inline T read() { char c = getchar(); T x = 0, f = 1; while (!isdigit(c)) { if (c == '-') f = -1; c = getchar(); } while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar(); return x * f; } template <typename T> inline void write(T x) { if (x < 0) x = (~x) + 1, putchar('-'); if (x / 10) write(x / 10); putchar(x % 10 | 48); } const int INF = 0x3f3f3f3f; const int N = 1e5 + 10; ll f(int x) { ll ans = 0; for (int i = 1; i <= 110; i++) { for (int j = 1; j <= 110; j++) { for (int s = 1; s <= 110; s++) { if (i * i + j * j + s * s + i * j + i * s + j * s == x) ans++; if (s * s > x) break; } if (j * j > x) break; } if (i * i > x) break; } return ans; } int main() { // ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); int n = read<int>(); for (int i = 1; i <= n; i++) { cout << f(i) << endl; } }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int Ull; typedef pair<int, int> PII; template <typename T> inline T read() { char c = getchar(); T x = 0, f = 1; while (!isdigit(c)) { if (c == '-') f = -1; c = getchar(); } while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar(); return x * f; } template <typename T> inline void write(T x) { if (x < 0) x = (~x) + 1, putchar('-'); if (x / 10) write(x / 10); putchar(x % 10 | 48); } const int INF = 0x3f3f3f3f; const int N = 1e5 + 10; ll f(int x) { ll ans = 0; for (int i = 1; i <= 110; i++) { for (int j = i; j <= 110; j++) { for (int s = j; s <= 110; s++) { if (i * i + j * j + s * s + i * j + i * s + j * s == x) { if (i == j && j == s) ans += 1; else if (i == j || j == s) ans += 3; else ans += 6; } if (s * s > x) break; } if (j * j > x) break; } if (i * i > x) break; } return ans; } int main() { // ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); int n = read<int>(); for (int i = 1; i <= n; i++) { cout << f(i) << endl; } }
replace
29
33
29
39
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; #define int long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define all(x) (x).begin(), (x).end() #define YES() printf("YES\n") #define NO() printf("NO\n") #define isYES(x) printf("%s\n", (x) ? "YES" : "NO") #define Yes() printf("Yes\n") #define No() printf("No\n") #define isYes(x) printf("%s\n", (x) ? "Yes" : "No") #define isIn(x, y, h, w) (x >= 0 && x < h && y >= 0 && y < w) #define debug(var) cout << "[" << #var << "] " << var << endl const int INF = pow(10, 9) + 1; const double EPS = 1e-9; const int MOD = 998244353; signed main() { int N; cin >> N; FOR(n, 1, N + 1) { int ans = 0; FOR(x, 1, floor(sqrt(N + 1))) { FOR(y, 1, floor(sqrt(N + 1))) { FOR(z, 1, floor(sqrt(N + 1))) { if (x * x + y * y + z * z + x * y + y * z + z * x == n) ans++; } } } cout << ans << endl; } }
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; #define int long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define all(x) (x).begin(), (x).end() #define YES() printf("YES\n") #define NO() printf("NO\n") #define isYES(x) printf("%s\n", (x) ? "YES" : "NO") #define Yes() printf("Yes\n") #define No() printf("No\n") #define isYes(x) printf("%s\n", (x) ? "Yes" : "No") #define isIn(x, y, h, w) (x >= 0 && x < h && y >= 0 && y < w) #define debug(var) cout << "[" << #var << "] " << var << endl const int INF = pow(10, 9) + 1; const double EPS = 1e-9; const int MOD = 998244353; signed main() { int N; cin >> N; int a[10000] = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 1, 6, 0, 3, 0, 0, 0, 0, 0, 3, 3, 6, 0, 0, 3, 0, 0, 0, 0, 3, 3, 6, 0, 6, 0, 0, 0, 3, 0, 0, 1, 6, 0, 6, 6, 0, 0, 6, 0, 0, 0, 0, 3, 3, 3, 6, 0, 6, 3, 6, 0, 0, 0, 6, 0, 0, 0, 3, 3, 9, 0, 6, 3, 6, 0, 3, 6, 0, 0, 0, 0, 6, 1, 6, 0, 6, 6, 0, 3, 12, 0, 6, 0, 0, 3, 6, 0, 0, 0, 3, 3, 12, 0, 6, 3, 6, 0, 3, 6, 9, 0, 6, 0, 0, 0, 3, 6, 3, 3, 6, 0, 6, 3, 12, 0, 3, 6, 6, 0, 6, 0, 6, 3, 6, 0, 0, 1, 6, 3, 12, 6, 0, 0, 12, 0, 6, 0, 6, 6, 12, 0, 0, 6, 0, 0, 6, 0, 12, 3, 6, 0, 6, 3, 9, 6, 3, 6, 6, 0, 6, 0, 6, 0, 15, 6, 0, 0, 6, 0, 3, 3, 12, 0, 12, 6, 6, 0, 3, 6, 6, 3, 12, 0, 6, 0, 9, 6, 0, 0, 6, 3, 12, 1, 6, 6, 6, 6, 0, 0, 18, 0, 12, 0, 3, 6, 12, 0, 0, 6, 3, 6, 12, 0, 12, 0, 0, 0, 9, 3, 9, 6, 12, 3, 12, 0, 3, 6, 6, 0, 12, 0, 12, 0, 9, 9, 0, 0, 6, 3, 6, 3, 12, 6, 9, 3, 6, 0, 12, 3, 6, 3, 9, 6, 12, 6, 6, 0, 6, 0, 9, 6, 6, 0, 12, 3, 6, 0, 9, 6, 6, 1, 6, 0, 21, 12, 6, 0, 12, 0, 12, 0, 0, 6, 15, 6, 0, 6, 12, 0, 12, 0, 12, 0, 0, 0, 12, 0, 12, 12, 3, 3, 18, 3, 6, 3, 6, 6, 9, 9, 18, 0, 6, 0, 12, 0, 9, 6, 0, 3, 12, 3, 6, 6, 12, 6, 6, 0, 0, 0, 15, 3, 18, 3, 18, 3, 12, 6, 3, 6, 9, 0, 12, 0, 12, 0, 18, 12, 0, 0, 12, 3, 6, 0, 6, 6, 9, 6, 0, 0, 18, 1, 18, 3, 12, 6, 6, 6, 12, 0, 15, 6, 12, 6, 18, 0, 0, 6, 0, 9, 12, 0, 18, 0, 6, 3, 12, 0, 12, 12, 0, 0, 12, 0, 3, 6, 12, 6, 18, 9, 18, 0, 9, 6, 18, 0, 6, 0, 6, 3, 27, 6, 6, 6, 6, 3, 6, 0, 12, 6, 9, 0, 6, 0, 18, 0, 9, 9, 15, 3, 12, 6, 6, 3, 9, 6, 12, 12, 18, 0, 18, 0, 6, 6, 21, 6, 0, 0, 6, 3, 15, 6, 12, 6, 18, 0, 0, 0, 12, 6, 6, 3, 6, 4, 18, 6, 12, 6, 3, 9, 30, 0, 18, 0, 6, 6, 12, 6, 6, 9, 12, 0, 18, 6, 18, 0, 6, 0, 12, 0, 6, 12, 6, 3, 18, 0, 6, 6, 6, 6, 15, 3, 24, 0, 6, 3, 18, 0, 12, 6, 12, 6, 24, 0, 15, 18, 9, 6, 0, 0, 18, 3, 6, 0, 15, 12, 12, 6, 6, 0, 18, 0, 6, 3, 12, 0, 12, 6, 6, 9, 9, 6, 24, 3, 24, 0, 9, 12, 6, 6, 12, 0, 12, 0, 21, 9, 15, 6, 12, 3, 18, 3, 12, 6, 12, 6, 0, 0, 12, 0, 12, 6, 24, 0, 6, 12, 6, 1, 9, 6, 12, 6, 24, 0, 18, 3, 12, 6, 6, 12, 24, 0, 12, 6, 15, 6, 18, 0, 18, 0, 0, 0, 18, 9, 21, 12, 0, 6, 18, 0, 9, 6, 6, 6, 12, 0, 12, 0, 9, 9, 27, 6, 6, 3, 18, 6, 21, 6, 6, 12, 12, 0, 12, 0, 24, 12, 0, 0, 24, 3, 24, 6, 12, 12, 18, 0, 0, 0, 12, 0, 18, 3, 15, 6, 12, 9, 6, 0, 15, 6, 9, 12, 24, 0, 12, 3, 6, 6, 21, 6, 18, 3, 18, 0, 21, 12, 15, 6, 6, 0, 12, 3, 12, 9, 18, 9, 12, 6, 6, 6, 24, 0, 18, 3, 24, 0, 6, 6, 0, 6, 9, 6, 6, 4, 30, 0, 18, 12, 9, 6, 24, 0, 18, 0, 9, 12, 21, 6, 6, 12, 12, 0, 18, 0, 21, 15, 12, 0, 12, 6, 12, 12, 18, 0, 18, 0, 6, 0, 9, 12, 18, 6, 30, 0, 0, 0, 24, 6, 9, 3, 12, 6, 30, 3, 6, 12, 6, 12, 12, 0, 36, 0, 6, 3, 27, 12, 12, 6, 6, 6, 24, 0, 12, 6, 12, 0, 18, 0, 18, 15, 18, 3, 18, 6, 12, 6, 6, 12, 3, 6, 6, 0, 12, 3, 39, 3, 12, 12, 12, 3, 18, 0, 21, 12, 21, 6, 18, 0, 12, 0, 9, 9, 12, 9, 24, 9, 12, 6, 12, 6, 33, 0, 6, 0, 18, 0, 9, 15, 12, 6, 24, 6, 6, 3, 15, 6, 15, 12, 18, 0, 18, 1, 18, 6, 12, 6, 6, 0, 24, 6, 24, 12, 18, 6, 24, 0, 6, 6, 12, 15, 24, 0, 24, 6, 6, 0, 18, 0, 15, 18, 12, 0, 24, 0, 12, 6, 12, 12, 18, 6, 24, 0, 0, 6, 24, 3, 12, 0, 12, 6, 30, 9, 6, 12, 24, 12, 12, 0, 15, 18, 12, 0, 18, 0, 24, 6, 15, 6, 18, 3, 18, 3, 12, 6, 24, 12, 12, 12, 6, 0, 36, 0, 18, 3, 6, 12, 6, 9, 12, 0, 3, 12, 36, 0, 30, 0, 12, 0, 18, 6, 12, 9, 12, 6, 24, 3, 18, 12, 15, 9, 24, 0, 18, 6, 18, 9, 18, 12, 6, 6, 24, 3, 24, 0, 12, 12, 12, 0, 6, 0, 27, 12, 18, 3, 30, 3, 18, 6, 0, 12, 15, 6, 18, 0, 24, 0, 9, 6, 9, 12, 18, 7, 24, 0, 24, 12, 15, 12, 24, 0, 24, 0, 6, 9, 30, 9, 6, 6, 0, 9, 33, 12, 36, 0, 12, 0, 18, 0, 6, 21, 12, 6, 36, 6, 0, 3, 18, 6, 12, 6, 24, 0, 12, 3, 24, 6, 9, 12, 6, 6, 30, 6, 18, 12, 9, 9, 12, 0, 30, 3, 18, 3, 27, 6, 30, 12, 12, 0, 24, 0, 27, 12, 6, 0, 24, 3, 18, 18, 9, 6, 18, 0, 12, 3, 33, 18, 12, 9, 6, 0, 12, 6, 30, 0, 24, 12, 12, 0, 30, 6, 6, 6, 0, 6, 24, 0, 12, 0, 18, 15, 33, 6, 30, 15, 18, 0, 9, 12, 24, 9, 12, 0, 18, 6, 27, 18, 15, 6, 18, 3, 24, 0, 6, 6, 36, 12, 18, 0, 12, 3, 30, 3, 12, 6, 12, 15, 6, 0, 18, 12, 15, 9, 30, 0, 18, 6, 12, 12, 18, 6, 6, 3, 24, 1, 27, 12, 18, 6, 18, 0, 24, 0, 18, 15, 15, 21, 30, 6, 12, 12, 18, 0, 30, 6, 24, 0, 6, 0, 18, 6, 36, 12, 6, 6, 36, 0, 6, 12, 12, 12, 24, 0, 30, 0, 9, 6, 18, 0, 18, 12, 12, 6, 24, 6, 9, 15, 12, 0, 12, 6, 30, 9, 18, 0, 42, 3, 18, 6, 12, 18, 33, 12, 12, 0, 18, 0, 21, 12, 12, 12, 24, 6, 30, 0, 27, 18, 6, 12, 6, 0, 24, 0, 18, 15, 30, 0, 18, 12, 6, 0, 21, 6, 21, 12, 24, 0, 30, 0, 6, 6, 6, 12, 24, 0, 30, 12, 9, 12, 21, 3, 24, 0, 12, 3, 21, 18, 9, 18, 18, 6, 30, 3, 42, 6, 21, 6, 30, 0, 6, 3, 24, 9, 36, 6, 6, 9, 12, 6, 18, 12, 33, 9, 12, 0, 24, 9, 9, 6, 3, 18, 36, 6, 18, 0, 24, 6, 6, 6, 18, 0, 12, 0, 30, 3, 39, 12, 12, 7, 18, 0, 15, 18, 18, 9, 36, 0, 24, 6, 6, 18, 30, 0, 18, 9, 18, 3, 24, 6, 21, 12, 24, 0, 30, 3, 33, 24, 12, 6, 18, 6, 6, 6, 18, 6, 18, 12, 18, 0, 24, 6, 36, 3, 18, 6, 0, 12, 30, 0, 9, 24, 18, 0, 24, 0, 18, 0, 0, 12, 30, 15, 30, 6, 18, 3, 30, 0, 24, 18, 12, 0, 36, 3, 24, 12, 15, 18, 18, 6, 24, 3, 24, 12, 18, 12, 24, 0, 0, 6, 39, 6, 24, 3, 18, 3, 42, 6, 12, 12, 15, 9, 30, 0, 12, 0, 18, 6, 18, 12, 24, 15, 12, 0, 12, 12, 30, 12, 12, 0, 18, 0, 15, 15, 18, 18, 30, 3, 24, 12, 9, 6, 48, 0, 18, 0, 30, 0, 21, 6, 12, 12, 24, 12, 18, 3, 48, 24, 6, 6, 18, 0, 36, 0, 12, 15, 27, 6, 12, 12, 18, 6, 27, 6, 12, 9, 18, 0, 24, 6, 18, 18, 21, 0, 36, 0, 12, 0, 18, 12, 21, 18, 24, 0, 12, 1, 18, 9, 21, 18, 6, 9, 42, 3, 36, 12, 12, 12, 30, 0, 12, 6, 21, 12, 36, 6, 24, 9, 12, 6, 12, 12, 24, 12, 18, 0, 42, 0, 15, 6, 15, 15, 42, 6, 30, 6, 12, 12, 18, 12, 18, 0, 6, 6, 36, 0, 30, 18, 6, 0, 6, 0, 30, 18, 18, 0, 42, 0, 18, 6, 15, 18, 24, 0, 12, 6, 36, 9, 33, 12, 12, 12, 18, 0, 36, 0, 21, 21, 15, 18, 18, 15, 18, 0, 18, 6, 42, 6, 24, 0, 18, 3, 42, 6, 18, 12, 12, 12, 18, 0, 15, 12, 18, 12, 36, 0, 30, 12, 3, 21, 18, 0, 30, 6, 24, 0, 27, 12, 18, 12, 6, 0, 12, 0, 36, 15, 15, 3, 36, 12, 18, 6, 30, 6, 33, 12, 12, 0, 12, 6, 24, 6, 54, 18, 12, 3, 36, 9, 9, 12, 12, 18, 36, 0, 6, 0, 21, 15, 27, 9, 24, 12, 30, 6, 24, 6, 27, 18, 12, 0, 30, 0, 21, 12, 18, 6, 30, 0, 18, 0, 21, 18, 21, 6, 30, 0, 24, 3, 6, 6, 15, 27, 12, 10, 42, 6, 36, 12, 12, 6, 24, 0, 24, 6, 12, 12, 48, 6, 18, 12, 0, 3, 51, 6, 30, 6, 24, 0, 24, 0, 30, 21, 15, 12, 24, 9, 18, 6, 18, 12, 30, 9, 24, 0, 18, 0, 27, 18, 9, 6, 18, 9, 54, 0, 18, 24, 21, 18, 12, 0, 24, 0, 12, 0, 30, 9, 30, 12, 6, 9, 24, 6, 15, 15, 18, 0, 30, 3, 33, 18, 21, 12, 42, 3, 30, 6, 6, 24, 27, 6, 12, 0, 24, 3, 42, 6, 42, 9, 12, 6, 18, 6, 24, 12, 12, 12, 54, 0, 6, 12, 18, 6, 18, 18, 30, 12, 30, 0, 18, 0, 27, 18, 24, 0, 18, 0, 15, 24, 21, 6, 24, 3, 36, 6, 6, 6, 45, 21, 18, 0, 18, 6, 33, 3, 18, 0, 24, 15, 30, 0, 30, 24, 12, 6, 36, 0, 24, 3, 21, 24, 18, 15, 30, 3, 12, 6, 42, 12, 12, 12, 6, 0, 54, 6, 30, 15, 24, 18, 24, 6, 12, 0, 9, 6, 30, 0, 48, 0, 24, 0, 15, 12, 39, 12, 24, 6, 24, 6, 15, 30, 12, 6, 24, 0, 24, 3, 24, 12, 24, 6, 6, 18, 12, 4, 54, 6, 21, 18, 18, 0, 36, 6, 24, 9, 30, 12, 24, 9, 36, 6, 12, 18, 42, 3, 30, 0, 6, 9, 21, 6, 12, 30, 30, 6, 30, 0, 27, 12, 9, 18, 30, 0, 36, 0, 18, 9, 42, 6, 24, 12, 0, 6, 51, 12, 24, 12, 12, 0, 18, 6, 12, 18, 6, 6, 36, 3, 54, 9, 18, 6, 27, 12, 18, 0, 30, 0, 39, 9, 18, 18, 12, 9, 30, 6, 21, 12, 27, 18, 24, 0, 12, 0, 42, 18, 42, 6, 24, 15, 18, 0, 24, 12, 45, 12, 6, 0, 54, 0, 15, 21, 6, 6, 30, 6, 18, 12, 24, 18, 30, 6, 36, 0, 12, 3, 24, 12, 18, 18, 18, 12, 24, 0, 33, 12, 27, 6, 42, 0, 18, 6, 9, 15, 30, 6, 30, 6, 12, 6, 18, 6, 33, 15, 30, 0, 36, 3, 27, 21, 33, 24, 30, 9, 24, 0, 12, 18, 33, 6, 6, 0, 18, 3, 57, 12, 24, 18, 30, 9, 18, 0, 18, 12, 27, 12, 36, 0, 36, 6, 12, 6, 27, 12, 30, 9, 24, 6, 39, 18, 12, 24, 12, 0, 30, 0, 30, 6, 15, 15, 18, 3, 24, 18, 9, 12, 30, 9, 30, 0, 18, 6, 42, 18, 30, 0, 6, 10, 48, 0, 24, 12, 12, 18, 48, 0, 30, 3, 30, 15, 18, 6, 24, 18, 18, 0, 42, 6, 36, 15, 24, 0, 42, 12, 21, 24, 12, 12, 24, 0, 12, 6, 18, 18, 60, 6, 30, 0, 12, 0, 24, 0, 12, 18, 30, 15, 42, 0, 33, 30, 6, 6, 12, 0, 42, 3, 27, 6, 33, 12, 36, 12, 18, 0, 30, 6, 18, 12, 12, 0, 18, 6, 15, 27, 27, 6, 42, 6, 36, 9, 18, 30, 33, 9, 30, 0, 6, 6, 54, 6, 36, 24, 24, 0, 30, 3, 12, 6, 21, 24, 30, 0, 24, 0, 24, 12, 42, 9, 42, 21, 12, 12, 27, 12, 27, 6, 12, 0, 48, 6, 12, 18, 12, 12, 36, 6, 30, 0, 24, 0, 42, 12, 12, 0, 36, 0, 24, 15, 21, 21, 18, 6, 12, 9, 36, 18, 18, 15, 42, 0, 18, 6, 9, 18, 48, 12, 30, 9, 24, 3, 33, 6, 18, 18, 18, 0, 36, 3, 54, 24, 3, 12, 36, 9, 36, 6, 30, 12, 36, 12, 24, 0, 18, 6, 24, 6, 42, 0, 24, 18, 18, 0, 9, 30, 39, 12, 42, 0, 36, 0, 12, 12, 21, 12, 18, 12, 24, 6, 45, 6, 18, 24, 18, 0, 36, 0, 42, 15, 18, 6, 24, 6, 12, 12, 18, 12, 30, 6, 18, 0, 30, 1, 30, 9, 57, 9, 12, 9, 48, 6, 21, 24, 18, 12, 66, 0, 18, 6, 9, 24, 24, 24, 30, 12, 18, 0, 48, 6, 24, 18, 18, 0, 24, 3, 27, 18, 24, 12, 36, 6, 48, 6, 15, 18, 42, 6, 24, 0, 12, 12, 36, 6, 6, 24, 12, 3, 48, 0, 48, 18, 0, 12, 18, 0, 36, 6, 18, 9, 54, 15, 12, 12, 6, 6, 39, 6, 24, 18, 42, 0, 30, 0, 33, 18, 24, 18, 18, 9, 18, 0, 15, 18, 54, 0, 36, 0, 24, 0, 48, 24, 15, 18, 18, 12, 42, 9, 24, 12, 36, 21, 30, 0, 36, 12, 24, 3, 30, 0, 48, 15, 12, 6, 15, 18, 18, 18, 24, 0, 30, 0, 24, 24, 18, 9, 72, 0, 30, 6, 21, 18, 30, 6, 24, 0, 0, 6, 24, 18, 42, 12, 6, 15, 36, 0, 30, 18, 30, 12, 24, 0, 6, 0, 18, 12, 54, 9, 36, 9, 36, 9, 30, 6, 27, 27, 24, 0, 54, 6, 21, 18, 21, 6, 36, 15, 36, 3, 30, 12, 6, 18, 30, 0, 18, 6, 54, 0, 30, 21, 36, 9, 30, 6, 30, 24, 24, 6, 30, 0, 36, 12, 9, 24, 24, 12, 18, 9, 30, 0, 48, 12, 24, 12, 12, 0, 48, 0, 18, 12, 24, 24, 30, 6, 18, 12, 21, 12, 24, 0, 66, 0, 12, 0, 30, 9, 24, 24, 18, 13, 42, 3, 18, 18, 27, 24, 24, 0, 30, 6, 15, 18, 39, 12, 12, 9, 36, 12, 54, 12, 42, 18, 6, 0, 36, 0, 51, 18, 12, 0, 66, 12, 24, 0, 6, 24, 51, 12, 24, 0, 24, 0, 33, 6, 18, 18, 30, 6, 42, 3, 18, 30, 15, 15, 30, 0, 30, 6, 30, 12, 48, 12, 24, 12, 12, 9, 36, 6, 36, 6, 12, 0, 30, 0, 24, 21, 24, 15, 42, 12, 24, 6, 9, 18, 15, 9, 42, 0, 24, 12, 66, 12, 30, 24, 6, 9, 54, 0, 36, 12, 21, 12, 36, 0, 24, 3, 24, 15, 36, 6, 30, 24, 12, 6, 33, 6, 39, 21, 30, 0, 42, 6, 12, 30, 30, 18, 36, 0, 48, 3, 36, 12, 30, 18, 18, 0, 24, 0, 30, 6, 33, 21, 24, 6, 18, 12, 24, 12, 12, 15, 48, 0, 24, 6, 21, 21, 60, 6, 24, 12, 18, 0, 30, 12, 15, 12, 24, 0, 24, 3, 60, 27, 18, 12, 30, 3, 24, 9, 21, 12, 60, 18, 24, 0, 24, 9, 33, 6, 36, 12, 24, 15, 42, 6, 27, 36, 27, 6, 42, 0, 42, 6, 12, 15, 15, 24, 42, 18, 12, 0, 33, 6, 21, 18, 24, 0, 48, 3, 36, 9, 24, 24, 30, 6, 36, 0, 39, 18, 60, 6, 18, 0, 12, 6, 21, 27, 30, 0, 18, 6, 42, 6, 42, 18, 24, 9, 48, 0, 6, 6, 18, 18, 18, 6, 18, 15, 30, 4, 60, 12, 30, 30, 18, 0, 36, 0, 27, 18, 30, 18, 48, 9, 30, 12, 18, 6, 42, 9, 48, 0, 18, 6, 42, 6, 30, 24, 12, 3, 36, 0, 36, 36, 15, 18, 30, 0, 66, 0, 12, 18, 42, 9, 24, 15, 18, 12, 54, 6, 18, 21, 36, 0, 30, 6, 24, 24, 12, 6, 24, 9, 36, 12, 6, 12, 45, 12, 36, 0, 36, 0, 48, 3, 24, 18, 12, 24, 36, 0, 30, 12, 30, 21, 30, 0, 6, 15, 18, 15, 66, 12, 42, 3, 12, 0, 39, 12, 30, 12, 18, 0, 54, 6, 30, 24, 9, 12, 60, 12, 30, 12, 30, 24, 24, 18, 30, 0, 36, 0, 27, 9, 45, 18, 24, 12, 24, 0, 36, 24, 12, 6, 60, 0, 18, 0, 24, 15, 51, 9, 24, 12, 30, 12, 27, 18, 51, 18, 24, 0, 36, 6, 27, 27, 12, 30, 36, 6, 30, 0, 12, 6, 42, 0, 18, 0, 18, 0, 48, 12, 45, 24, 6, 15, 42, 6, 12, 18, 27, 9, 54, 0, 42, 3, 33, 12, 15, 12, 54, 18, 30, 6, 36, 18, 21, 30, 18, 0, 48, 3, 30, 18, 36, 6, 18, 0, 18, 12, 57, 24, 42, 6, 24, 0, 18, 12, 36, 18, 30, 12, 36, 3, 78, 0, 24, 6, 6, 36, 42, 0, 24, 0, 21, 15, 33, 6, 42, 18, 12, 3, 30, 12, 30, 27, 24, 0, 42, 12, 39, 12, 30, 12, 30, 15, 30, 6, 12, 24, 54, 6, 24, 0, 18, 6, 33, 12, 18, 24, 24, 7, 30, 0, 60, 24, 21, 12, 30, 0, 48, 6, 18, 15, 39, 12, 18, 18, 18, 0, 48, 12, 54, 18, 42, 0, 30, 0, 15, 30, 27, 18, 72, 0, 30, 15, 12, 12, 30, 18, 36, 0, 6, 3, 60, 15, 24, 18, 6, 18, 54, 6, 21, 24, 24, 12, 30, 0, 30, 6, 30, 15, 54, 6, 48, 12, 30, 12, 36, 0, 24, 3, 24, 0, 54, 6, 18, 30, 15, 6, 42, 9, 36, 0, 21, 30, 15, 12, 12, 0, 24, 3, 72, 0, 51, 39, 24, 12, 30, 3, 33, 18, 15, 12, 42, 0, 30, 12, 27, 24, 51, 12, 42, 12, 18, 3, 42, 12, 39, 18, 12, 0, 30, 0, 24, 21, 21, 21, 30, 6, 66, 12, 12, 6, 69, 21, 30, 0, 24, 6, 45, 12, 12, 18, 42, 12, 18, 0, 39, 30, 33, 12, 54, 0, 12, 0, 12, 18, 36, 9, 30, 9, 24, 9, 60, 12, 30, 12, 12, 0, 42, 9, 42, 18, 45, 24, 42, 6, 12, 9, 24, 6, 30, 12, 42, 0, 30, 6, 15, 15, 30, 12, 18, 12, 54, 6, 21, 30, 12, 33, 60, 0, 48, 0, 30, 15, 42, 6, 24, 24, 30, 0, 36, 18, 33, 18, 12, 0, 60, 0, 72, 15, 12, 9, 30, 12, 24, 15, 21, 24, 51, 12, 24, 0, 24, 6, 12, 6, 33, 24, 36, 9, 54, 6, 27, 24, 30, 6, 48, 0, 24, 3, 36, 27, 42, 15, 18, 18, 12, 6, 54, 6, 30, 15, 36, 0, 12, 12, 18, 24, 21, 18, 30, 3, 60, 0, 33, 12, 36, 18, 48, 0, 24, 1, 39, 12, 24, 18, 24, 9, 66, 6, 48, 24, 12, 12, 42, 0, 24, 6, 18, 12, 63, 6, 36, 24, 18, 0, 39, 12, 39, 24, 24, 0, 54, 6, 15, 24, 15, 24, 48, 3, 36, 12, 12, 24, 39, 18, 36, 0, 42, 6, 42, 6, 60, 24, 12, 18, 18, 0, 45, 6, 6, 6, 72, 0, 30, 6, 24, 9, 36, 12, 24, 9, 30, 15, 36, 18, 33, 24, 6, 0, 54, 0, 33, 36, 18, 24, 36, 6, 18, 6, 24, 18, 75, 6, 18, 0, 18, 0, 48, 9, 36, 18, 42, 9, 30, 0, 27, 36, 24, 15, 42, 0, 42, 18, 36, 12, 18, 12, 72, 9, 24, 0, 54, 18, 21, 24, 12, 0, 60, 0, 24, 24, 39, 12, 42, 18, 30, 6, 9, 12, 48, 12, 30, 0, 18, 12, 36, 15, 48, 18, 18, 3, 42, 6, 42, 18, 18, 24, 54, 0, 36, 0, 24, 36, 42, 0, 12, 27, 30, 6, 60, 6, 30, 24, 12, 0, 36, 3, 42, 12, 18, 12, 36, 9, 30, 0, 15, 18, 33, 12, 54, 0, 30, 6, 33, 21, 27, 30, 42, 12, 54, 9, 42, 24, 27, 6, 36, 0, 24, 12, 24, 12, 45, 24, 12, 6, 30, 12, 69, 12, 42, 12, 30, 0, 24, 0, 42, 18, 24, 15, 60, 9, 48, 18, 18, 24, 27, 12, 36, 0, 30, 0, 54, 9, 30, 18, 24, 15, 48, 0, 24, 24, 45, 24, 24, 0, 18, 6, 36, 9, 54, 15, 24, 12, 12, 6, 18, 12, 54, 18, 12, 0, 60, 3, 48, 30, 12, 18, 60, 6, 24, 3, 36, 12, 33, 12, 36, 0, 36, 6, 36, 3, 33, 24, 12, 13, 42, 12, 27, 18, 30, 12, 54, 0, 30, 12, 21, 39, 54, 6, 54, 18, 18, 0, 33, 12, 36, 36, 36, 0, 30, 0, 42, 33, 18, 18, 36, 12, 30, 3, 30, 12, 66, 6, 30, 0, 18, 12, 63, 18, 24, 6, 30, 12, 48, 9, 6, 24, 30, 12, 42, 0, 72, 0, 30, 12, 48, 3, 24, 15, 12, 12, 66, 18, 9, 36, 12, 0, 54, 0, 54, 18, 15, 30, 36, 6, 12, 0, 21, 18, 54, 12, 30, 0, 6, 0, 36, 15, 60, 18, 18, 15, 48, 6, 27, 24, 21, 12, 54, 0, 54, 9, 12, 24, 48, 12, 48, 15, 54, 6, 36, 6, 39, 24, 24, 0, 24, 3, 33, 24, 18, 18, 66, 12, 18, 12, 30, 12, 75, 15, 36, 0, 30, 9, 24, 6, 21, 24, 24, 12, 60, 0, 66, 36, 12, 18, 36, 0, 24, 6, 30, 18, 39, 18, 30, 12, 24, 9, 30, 6, 36, 18, 18, 0, 54, 12, 33, 24, 36, 6, 66, 0, 30, 6, 12, 12, 33, 24, 54, 0, 18, 3, 60, 3, 30, 24, 24, 21, 48, 0, 18, 30, 51, 12, 18, 0, 30, 12, 33, 15, 18, 12, 30, 27, 24, 0, 48, 12, 45, 6, 30, 0, 72, 0, 51, 18, 27, 27, 54, 9, 48, 12, 27, 30, 36, 18, 18, 0, 42, 3, 36, 9, 45, 30, 6, 6, 36, 3, 51, 24, 24, 18, 72, 0, 18, 6, 9, 36, 42, 0, 36, 9, 30, 12, 60, 30, 24, 15, 24, 0, 36, 6, 30, 27, 27, 18, 42, 12, 48, 0, 42, 0, 33, 24, 24, 0, 30, 0, 42, 12, 48, 9, 36, 9, 24, 6, 27, 36, 12, 9, 60, 0, 30, 12, 15, 18, 42, 18, 36, 18, 24, 7, 48, 12, 54, 24, 30, 0, 78, 0, 18, 18, 27, 24, 24, 6, 30, 12, 33, 18, 60, 15, 54, 0, 12, 12, 36, 12, 36, 24, 30, 18, 54, 0, 18, 18, 18, 24, 84, 0, 54, 0, 27, 15, 42, 6, 36, 12, 18, 9, 54, 6, 30, 30, 24, 0, 30, 9, 60, 30, 36, 6, 42, 12, 30, 6, 6, 30, 60, 0, 18, 0, 24, 9, 51, 18, 24, 33, 30, 0, 42, 12, 60, 18, 18, 36, 18, 0, 24, 0, 18, 9, 78, 12, 48, 24, 12, 0, 48, 6, 12, 18, 42, 0, 48, 0, 30, 27, 18, 6, 48, 3, 66, 21, 18, 18, 33, 12, 48, 0, 30, 6, 63, 21, 18, 36, 24, 15, 60, 6, 36, 30, 36, 0, 48, 0, 48, 3, 36, 30, 42, 18, 24, 24, 12, 6, 21, 6, 72, 12, 36, 0, 60, 6, 12, 18, 15, 24, 60, 9, 30, 0, 39, 30, 54, 12, 18, 0, 18, 3, 60, 9, 57, 24, 6, 18, 48, 6, 60, 18, 18, 9, 48, 0, 24, 12, 18, 18, 39, 6, 42, 15, 36, 6, 36, 18, 18, 30, 18, 0, 42, 6, 39, 27, 27, 18, 48, 12, 42, 12, 24, 18, 27, 9, 30, 0, 24, 9, 81, 12, 72, 12, 30, 6, 36, 0, 33, 42, 39, 30, 42, 0, 12, 3, 12, 6, 24, 18, 48, 12, 48, 3, 63, 24, 24, 27, 30, 0, 78, 6, 36, 18, 36, 30, 30, 12, 36, 12, 30, 6, 60, 12, 48, 0, 24, 0, 36, 21, 30, 24, 30, 12, 48, 0, 36, 12, 24, 27, 36, 0, 42, 12, 27, 24, 54, 6, 18, 12, 48, 0, 30, 6, 72, 24, 12, 0, 30, 3, 45, 24, 0, 18, 78, 15, 18, 18, 39, 18, 39, 9, 36, 0, 24, 6, 39, 12, 30, 18, 30, 16, 48, 0, 36, 30, 12, 12, 60, 0, 42, 3, 24, 21, 84, 33, 30, 12, 18, 18, 48, 12, 36, 12, 30, 0, 48, 9, 42, 36, 42, 6, 48, 3, 42, 0, 33, 24, 30, 12, 36, 0, 36, 6, 54, 12, 30, 30, 6, 21, 66, 0, 39, 24, 36, 24, 36, 0, 24, 12, 30, 15, 54, 12, 78, 30, 6, 0, 33, 12, 27, 30, 30, 0, 36, 6, 18, 36, 36, 6, 66, 3, 60, 6, 18, 30, 42, 0, 12, 0, 36, 6, 54, 6, 33, 24, 24, 12, 54, 0, 42, 12, 15, 12, 60, 0, 30, 0, 21, 18, 75, 18, 48, 18, 18, 15, 30, 24, 42, 33, 36, 0, 30, 6, 45, 24, 9, 30, 36, 3, 54, 15, 24, 18, 63, 18, 42, 0, 24, 0, 75, 6, 30, 9, 30, 15, 42, 12, 33, 36, 21, 24, 60, 0, 54, 9, 30, 30, 48, 12, 18, 12, 24, 0, 66, 12, 24, 18, 36, 0, 72, 6, 36, 15, 27, 27, 30, 6, 12, 18, 24, 6, 78, 15, 42, 0, 12, 6, 27, 24, 51, 18, 36, 12, 60, 3, 51, 30, 12, 24, 36, 0, 30, 0, 48, 12, 21, 6, 36, 24, 54, 6, 42, 6, 36, 36, 6, 0, 54, 12, 27, 15, 18, 18, 66, 6, 42, 0, 15, 30, 63, 12, 48, 0, 36, 3, 63, 12, 36, 30, 18, 9, 48, 3, 48, 36, 30, 12, 42, 0, 72, 6, 36, 30, 30, 12, 24, 12, 6, 15, 75, 18, 30, 6, 36, 0, 24, 0, 18, 36, 48, 18, 60, 18, 60, 12, 33, 12, 33, 15, 72, 0, 18, 9, 54, 15, 21, 30, 36, 12, 30, 0, 42, 24, 48, 18, 36, 0, 24, 6, 18, 15, 81, 12, 12, 27, 36, 12, 30, 6, 36, 18, 24, 0, 48, 6, 36, 36, 27, 6, 48, 9, 36, 3, 36, 36, 36, 24, 30, 0, 24, 1, 42, 6, 66, 27, 24, 18, 48, 12, 51, 18, 24, 18, 84, 0, 24, 6, 12, 9, 63, 18, 48, 9, 30, 0, 36, 12, 33, 24, 30, 0, 72, 0, 42, 48, 36, 18, 42, 12, 42, 15, 24, 12, 60, 15, 24, 0, 12, 21, 72, 3, 42, 30, 24, 18, 36, 6, 42, 18, 30, 12, 42, 0, 48, 12, 12, 24, 24, 18, 66, 6, 24, 0, 93, 12, 51, 30, 12, 0, 54, 6, 18, 27, 24, 24, 36, 12, 30, 0, 45, 18, 60, 6, 54, 0, 24, 0, 51, 24, 21, 18, 30, 6, 72, 6, 6, 18, 21, 36, 42, 0, 48, 12, 27, 24, 36, 6, 30, 27, 30, 6, 39, 18, 51, 36, 30, 0, 42, 0, 66, 18, 36, 6, 66, 9, 24, 12, 24, 24, 78, 12, 36, 0, 36, 12, 60, 15, 42, 24, 6, 15, 54, 0, 33, 30, 21, 30, 42, 0, 54, 0, 24, 9, 60, 9, 36, 24, 24, 6, 66, 12, 48, 18, 54, 0, 30, 0, 30, 39, 30, 18, 48, 6, 42, 12, 33, 24, 33, 12, 60, 0, 18, 6, 42, 24, 42, 24, 6, 12, 72, 6, 42, 30, 18, 9, 30, 0, 24, 15, 30, 18, 60, 12, 54, 15, 24, 0, 48, 24, 33, 12, 36, 0, 66, 6, 36, 18, 21, 30, 72, 3, 24, 9, 27, 30, 30, 18, 42, 0, 42, 0, 72, 6, 39, 42, 24, 18, 60, 3, 24, 18, 36, 18, 30, 0, 54, 6, 27, 33, 60, 12, 24, 24, 18, 18, 30, 12, 21, 33, 48, 0, 78, 12, 78, 12, 30, 12, 42, 12, 48, 0, 24, 12, 75, 18, 24, 0, 18, 0, 33, 24, 30, 21, 42, 15, 30, 12, 39, 30, 51, 12, 54, 0, 36, 12, 18, 12, 48, 24, 78, 18, 18, 6, 78, 6, 24, 30, 12, 0, 42, 0, 45, 18, 15, 27, 42, 0, 54, 18, 36, 18, 36, 6, 48, 0, 30, 12, 36, 21, 45, 6, 24, 7, 54, 0, 27, 42, 33, 24, 72, 0, 42, 0, 48, 24, 45, 18, 18, 15, 36, 15, 66, 6, 66, 30, 18, 0, 48, 0, 27, 39, 30, 18, 66, 27, 12, 12, 18, 24, 60, 6, 66, 0, 42, 0, 42, 6, 33, 21, 36, 12, 42, 6, 21, 36, 33, 21, 48, 0, 66, 12, 6, 18, 75, 24, 36, 12, 18, 0, 81, 12, 42, 30, 36, 0, 24, 0, 30, 30, 30, 6, 60, 9, 60, 6, 24, 30, 30, 6, 30, 0, 30, 12, 75, 18, 30, 24, 24, 15, 78, 0, 42, 24, 18, 30, 42, 0, 30, 12, 21, 12, 48, 9, 60, 21, 30, 12, 24, 24, 39, 21, 24, 0, 54, 3, 39, 30, 33, 24, 72, 12, 60, 0, 18, 24, 57, 12, 24, 0, 24, 3, 90, 9, 12, 21, 36, 12, 30, 18, 84, 24, 30, 9, 60, 0, 36, 18, 18, 24, 78, 18, 24, 18, 48, 6, 24, 0, 45, 30, 24, 0, 66, 3, 60, 36, 21, 42, 42, 6, 30, 6, 33, 12, 60, 21, 36, 0, 6, 6, 36, 15, 36, 30, 48, 21, 48, 0, 39, 36, 36, 6, 54, 0, 66, 3, 18, 18, 33, 24, 36, 18, 30, 9, 66, 6, 15, 36, 24, 0, 96, 6, 30, 12, 42, 6, 36, 6, 36, 9, 27, 36, 42, 12, 42, 0, 18, 6, 51, 12, 78, 18, 30, 9, 54, 12, 39, 24, 24, 33, 66, 0, 36, 9, 45, 33, 36, 12, 18, 27, 36, 0, 78, 12, 48, 24, 30, 0, 42, 9, 48, 21, 18, 9, 60, 12, 54, 6, 21, 24, 72, 3, 66, 0, 18, 18, 33, 12, 21, 36, 36, 6, 36, 6, 60, 36, 36, 18, 48, 0, 24, 0, 30, 24, 87, 24, 24, 27, 42, 6, 60, 18, 66, 6, 18, 0, 36, 6, 39, 36, 30, 18, 36, 9, 30, 0, 18, 18, 51, 12, 48, 0, 54, 0, 48, 18, 36, 30, 36, 30, 66, 3, 12, 18, 15, 39, 60, 0, 24, 12, 66, 6, 54, 12, 48, 6, 18, 7, 30, 24, 48, 18, 30, 0, 84, 0, 30, 48, 12, 15, 60, 9, 42, 18, 42, 18, 42, 18, 48, 0, 30, 9, 48, 21, 69, 36, 12, 12, 48, 0, 57, 18, 24, 24, 66, 0, 36, 6, 24, 21, 69, 6, 54, 12, 30, 18, 72, 18, 30, 30, 18, 0, 42, 0, 42, 42, 12, 18, 42, 6, 54, 9, 42, 12, 72, 18, 24, 0, 24, 3, 78, 0, 24, 24, 30, 15, 60, 6, 42, 30, 39, 21, 36, 0, 54, 12, 27, 24, 42, 24, 72, 21, 30, 0, 48, 18, 24, 30, 12, 0, 30, 3, 24, 15, 72, 33, 42, 6, 24, 24, 12, 24, 66, 12, 60, 0, 24, 6, 63, 12, 42, 18, 24, 18, 84, 6, 30, 24, 24, 6, 90, 0, 72, 6, 21, 24, 30, 18, 18, 30, 24, 6, 66, 18, 54, 18, 36, 0, 36, 12, 60, 27, 30, 18, 90, 18, 18, 0, 18, 24, 48, 24, 30, 0, 36, 6, 36, 18, 66, 36, 30, 3, 66, 3, 57, 48, 12, 18, 36, 0, 48, 6, 36, 21, 48, 0, 60, 12, 36, 12, 72, 0, 36, 30, 30, 0, 48, 0, 33, 30, 48, 9, 54, 9, 36, 24, 18, 30, 42, 18, 54, 0, 12, 0, 54, 12, 21, 24, 30, 21, 72, 0, 66, 24, 27, 18, 36, 0, 24, 0, 45, 24, 78, 0, 42, 21, 24, 12, 39, 30, 54, 30, 24, 0, 84, 15, 24, 24, 9, 30, 54, 9, 48, 6, 33, 18, 57, 18, 30, 0, 60, 3, 54, 27, 33, 30, 36, 24, 42, 0, 54, 18, 39, 24, 54, 0, 60, 18, 24, 15, 75, 12, 24, 12, 42, 0, 39, 12, 36, 36, 36, 0, 30, 3, 66, 42, 15, 24, 72, 12, 48, 12, 42, 12, 48, 15, 24, 0, 18, 18, 60, 6, 60, 18, 36, 9, 24, 6, 27, 36, 30, 24, 90, 0, 60, 3, 21, 18, 54, 24, 48, 18, 18, 12, 51, 24, 39, 18, 18, 0, 72, 12, 42, 21, 36, 24, 36, 6, 36, 0, 33, 18, 42, 0, 60, 0, 18, 6, 42, 21, 39, 39, 36, 13, 84, 6, 24, 18, 30, 24, 78, 0, 36, 3, 54, 39, 51, 18, 30, 21, 24, 3, 60, 12, 87, 42, 30, 0, 36, 6, 30, 15, 36, 12, 54, 18, 42, 12, 27, 24, 84, 15, 42, 0, 18, 9, 54, 18, 30, 30, 48, 12, 72, 0, 54, 42, 9, 12, 36, 0, 60, 0, 27, 21, 78, 18, 42, 30, 30, 6, 54, 6, 30, 18, 24, 0, 60, 12, 42, 36, 48, 24, 54, 6, 36, 15, 12, 48, 21, 12, 30, 0, 36, 0, 102, 6, 18, 12, 24, 9, 60, 12, 48, 24, 33, 30, 66, 0, 30, 12, 30, 15, 60, 12, 54, 36, 30, 0, 36, 6, 72, 18, 36, 0, 54, 0, 30, 36, 9, 15, 60, 0, 60, 15, 39, 12, 63, 18, 42, 0, 30, 18, 60, 21, 57, 30, 0, 18, 54, 3, 75, 30, 48, 24, 42, 0, 24, 12, 36, 42, 57, 9, 48, 9, 36, 6, 45, 12, 24, 48, 54, 0, 66, 0, 45, 33, 30, 18, 54, 18, 36, 0, 36, 6, 54, 30, 54, 0, 36, 0, 66, 12, 42, 21, 24, 18, 48, 6, 21, 48, 42, 12, 60, 0, 84, 12, 0, 12, 54, 24, 36, 18, 18, 12, 81, 18, 33, 18, 12, 0, 66, 3, 66, 6, 33, 48, 48, 6, 24, 24, 36, 18, 60, 6, 36, 0, 24, 6, 39, 21, 42, 18, 42, 12, 60, 0, 24, 30, 33, 36, 72, 0, 30, 0, 36, 36, 42, 12, 36, 15, 24, 15, 75, 30, 63, 27, 24, 0, 42, 6, 63, 30, 18, 12, 108, 9, 48, 12, 24, 12, 72, 18, 30, 0, 54, 6, 30, 9, 63, 27, 48, 15, 36, 6, 48, 36, 18, 12, 54, 0, 42, 9, 36, 36, 63, 18, 36, 24, 36, 0, 75, 6, 63, 24, 36, 0, 48, 6, 27, 39, 30, 18, 30, 9, 54, 18, 36, 18, 39, 21, 66, 0, 30, 0, 54, 18, 42, 36, 12, 24, 108, 0, 30, 24, 42, 12, 48, 0, 24, 0, 15, 9, 48, 18, 66, 24, 24, 12, 54, 12, 36, 21, 54, 0, 54, 18, 45, 42, 36, 24, 42, 3, 36, 0, 42, 48, 42, 12, 36, 0, 36, 1, 60, 18, 36, 18, 36, 15, 54, 9, 60, 30, 24, 21, 48, 0, 24, 18, 24, 18, 90, 6, 72, 15, 36, 9, 48, 6, 36, 42, 48, 0, 78, 3, 54, 27, 18, 36, 48, 15, 54, 12, 30, 24, 84, 12, 18, 0, 18, 12, 105, 12, 24, 30, 30, 18, 36, 0, 60, 30, 27, 12, 48, 0, 90, 6, 18, 18, 33, 21, 42, 24, 24, 12, 45, 24, 60, 36, 36, 0, 66, 6, 27, 15, 42, 24, 60, 12, 18, 9, 30, 18, 84, 12, 72, 0, 12, 6, 42, 21, 45, 12, 18, 9, 96, 12, 21, 30, 30, 24, 66, 0, 48, 12, 42, 18, 36, 18, 24, 24, 24, 0, 30, 12, 27, 42, 18, 0, 72, 0, 84, 27, 54, 15, 102, 12, 36, 6, 39, 36, 36, 15, 36, 0, 30, 15, 57, 12, 57, 42, 30, 9, 60, 6, 27, 42, 27, 30, 36, 0, 54, 6, 24, 21, 78, 12, 42, 18, 18, 12, 84, 18, 54, 18, 48, 0, 66, 12, 15, 36, 30, 18, 72, 9, 66, 0, 27, 18, 24, 6, 78, 0, 42, 6, 81, 27, 27, 36, 24, 24, 48, 0, 72, 18, 39, 30, 42, 0, 18, 18, 30, 24, 78, 6, 18, 18, 36, 0, 48, 30, 84, 6, 18, 0, 54, 0, 42, 36, 12, 30, 90, 12, 48, 18, 24, 18, 21, 18, 48, 0, 60, 0, 60, 6, 30, 42, 24, 18, 66, 0, 27, 36, 24, 18, 54, 0, 48, 6, 30, 18, 90, 15, 42, 9, 48, 18, 42, 6, 45, 24, 36, 0, 48, 0, 78, 39, 27, 12, 42, 27, 48, 6, 45, 18, 72, 36, 48, 0, 18, 9, 66, 9, 54, 33, 18, 18, 66, 12, 39, 36, 45, 12, 72, 0, 48, 12, 21, 39, 33, 18, 60, 18, 36, 0, 78, 18, 39, 36, 24, 0, 30, 0, 30, 30, 54, 21, 66, 6, 30, 21, 39, 18, 60, 15, 72, 0, 30, 18, 45, 12, 39, 18, 60, 6, 66, 15, 36, 30, 12, 18, 60, 0, 60, 0, 18, 33, 57, 18, 24, 24, 42, 6, 66, 12, 81, 42, 18, 0, 36, 6, 42, 18, 24, 24, 72, 0, 18, 0, 30, 30, 87, 18, 36, 0, 42, 3, 45, 12, 36, 42, 24, 25, 30, 6, 72, 24, 18, 18, 60, 0, 102, 12, 42, 12, 90, 12, 24, 27, 24, 12, 69, 24, 30, 18, 42, 0, 48, 0, 42, 45, 39, 15, 60, 18, 30, 12, 33, 24, 72, 18, 36, 0, 24, 12, 51, 24, 39, 36, 24, 6, 120, 0, 72, 24, 30, 30, 30, 0, 24, 12, 72, 18, 54, 3, 84, 30, 30, 21, 42, 24, 30, 18, 30, 0, 54, 0, 36, 30, 24, 30, 72, 9, 72, 6, 30, 24, 36, 24, 30, 0, 30, 0, 90, 12, 48, 27, 24, 6, 54, 12, 39, 36, 18, 18, 78, 0, 36, 12, 18, 39, 66, 6, 54, 18, 36, 0, 54, 18, 42, 12, 30, 0, 78, 0, 48, 45, 27, 36, 36, 9, 54, 15, 6, 12, 99, 15, 48, 0, 24, 3, 60, 12, 45, 36, 36, 30, 24, 12, 57, 30, 42, 18, 54, 0, 36, 6, 45, 24, 63, 30, 60, 12, 42, 6, 102, 18, 30, 33, 18, 0, 84, 12, 54, 24, 39, 12, 42, 0, 36, 0, 54, 24, 60, 12, 42, 0, 48, 6, 30, 9, 93, 24, 18, 21, 60, 6, 21, 36, 18, 54, 102, 0, 30, 18, 36, 21, 48, 12, 30, 27, 42, 3, 54, 12, 66, 36, 36, 0, 48, 9, 45, 33, 30, 9, 84, 18, 30, 12, 33, 36, 51, 12, 54, 0, 36, 18, 42, 12, 30, 36, 24, 9, 72, 0, 48, 30, 36, 6, 78, 0, 42, 0, 18, 24, 63, 21, 36, 18, 24, 15, 66, 0, 42, 27, 54, 0, 30, 9, 51, 45, 45, 24, 48, 12, 72, 12, 33, 24, 39, 30, 66, 0, 18, 6, 69, 12, 36, 24, 36, 18, 90, 6, 60, 24, 36, 27, 36, 0, 60, 18, 33, 21, 84, 12, 36, 30, 18, 0, 33, 24, 51, 30, 24, 0, 84, 0, 57, 33, 36, 21, 84, 12, 30, 12, 33, 36, 63, 18, 24, 0, 30, 6, 90, 21, 66, 30, 30, 24, 36, 0, 54, 12, 51, 18, 78, 0, 36, 0, 18, 18, 54, 21, 48, 12, 66, 18, 21, 18, 33, 21, 42, 0, 66, 6, 48, 54, 21, 30, 66, 12, 66, 0, 24, 24, 63, 24, 36, 0, 42, 3, 60, 18, 30, 6, 36, 9, 54, 6, 72, 48, 36, 15, 54, 0, 30, 27, 12, 18, 60, 12, 66, 15, 48, 10, 84, 12, 39, 42, 12, 0, 66, 6, 24, 18, 21, 36, 54, 24, 24, 12, 51, 18, 66, 12, 90, 0, 18, 6, 87, 15, 75, 24, 30, 15, 60, 0, 24, 42, 24, 24, 48, 0, 84, 6, 51, 39, 60, 12, 18, 30, 36, 12, 60, 12, 60, 48, 36, 0, 54, 6, 42, 12, 6, 18, 78, 6, 48, 12, 12, 36, 84, 0, 48, 0, 54, 3, 48, 18, 45, 51, 54, 6, 72, 6, 51, 30, 45, 30, 48, 0, 36, 6, 36, 15, 78, 24, 42, 24, 24, 0, 90, 18, 36, 24, 24, 0, 36, 0, 36, 30, 30, 30, 66, 6, 78, 21, 30, 12, 21, 15, 60, 0, 36, 12, 66, 21, 36, 24, 30, 18, 60, 9, 54, 48, 24, 18, 48, 0, 30, 6, 42, 18, 81, 18, 54, 27, 24, 12, 30, 18, 84, 30, 24, 0, 102, 9, 42, 42, 36, 24, 90, 3, 30, 0, 60, 30, 42, 18, 24, 0, 18, 0, 78, 12, 42, 27, 42, 18, 66, 18, 45, 18, 42, 9, 84, 0, 54, 6, 15, 54, 63, 18, 54, 24, 24, 9, 57, 24, 45, 54, 36, 0, 60, 0, 66, 27, 33, 18, 30, 9, 60, 24, 30, 12, 54, 21, 24, 0, 12, 18, 108, 15, 66, 12, 30, 27, 66, 0, 36, 30, 36, 24, 66, 0, 60, 0, 9, 24, 54, 12, 90, 15, 42, 0, 51, 30, 18, 30, 48, 0, 84, 9, 48, 21, 54, 30, 24, 18, 36, 12, 45, 18, 96, 6, 30, 0, 30, 9, 30, 24, 42, 24, 24, 15, 66, 6, 69, 36, 15, 15, 84, 0, 36, 15, 48, 27, 45, 18, 42, 30, 36, 0, 66, 6, 72, 30, 48, 0, 42, 3, 51, 39, 30, 33, 78, 12, 24, 18, 30, 18, 105, 21, 72, 0, 42, 12, 39, 18, 27, 42, 24, 6, 66, 3, 60, 42, 30, 30, 60, 0, 54, 6, 54, 24, 57, 6, 54, 6, 24, 24, 54, 12, 57, 27, 42, 0, 48, 6, 36, 27, 57, 12, 84, 12, 60, 0, 12, 30, 54, 24, 48, 0, 18, 3, 105, 36, 48, 42, 24, 18, 48, 6, 30, 36, 45, 42, 42, 0, 54, 9, 36, 12, 48, 12, 54, 30, 30, 6, 48, 6, 51, 18, 36, 0, 102, 6, 18, 30, 33, 24, 48, 18, 60, 12, 60, 30, 45, 12, 36, 0, 54, 12, 60, 6, 48, 54, 12, 13, 60, 0, 72, 18, 24, 6, 90, 0, 48, 12, 15, 42, 96, 18, 36, 18, 36, 6, 78, 24, 48, 18, 30, 0, 48, 18, 78, 42, 24, 30, 60, 6, 60, 12, 18, 12, 42, 30, 42, 0, 24, 0, 81, 9, 54, 18, 60, 33, 48, 0, 27, 54, 51, 27, 90, 0, 60, 18, 24, 18, 54, 24, 36, 12, 42, 0, 87, 24, 33, 18, 24, 0, 96, 0, 87, 36, 30, 15, 42, 12, 36, 24, 24, 36, 42, 21, 48, 0, 30, 6, 42, 18, 48, 24, 24, 18, 84, 3, 36, 42, 42, 36, 72, 0, 54, 6, 30, 15, 60, 6, 78, 30, 24, 6, 72, 6, 66, 45, 24, 0, 42, 21, 36, 30, 36, 18, 48, 12, 30, 0, 39, 24, 102, 18, 36, 0, 12, 6, 54, 6, 30, 33, 66, 21, 90, 3, 78, 36, 9, 18, 36, 0, 84, 0, 30, 30, 93, 24, 30, 24, 30, 15, 63, 12, 48, 30, 54, 0, 48, 0, 54, 42, 42, 30, 78, 0, 36, 24, 39, 24, 60, 12, 78, 0, 60, 6, 51, 30, 36, 36, 30, 18, 60, 0, 30, 30, 51, 24, 60, 0, 42, 3, 24, 9, 54, 21, 24, 33, 30, 24, 66, 24, 69, 18, 30, 0, 102, 15, 54, 24, 15, 30, 120, 6, 30, 3, 51, 24, 54, 12, 30, 0, 36, 6, 36, 12, 90, 42, 12, 12, 60, 12, 60, 24, 42, 12, 90, 0, 24, 12, 42, 30, 30, 6, 78, 21, 42, 0, 54, 24, 27, 54, 24, 0, 66, 6, 45, 30, 12, 30, 42, 12, 84, 15, 36, 18, 84, 24, 36, 0, 30, 18, 72, 18, 60, 24, 48, 12, 54, 6, 36, 54, 42, 12, 42, 0, 60, 0, 51, 48, 54, 9, 36, 27, 24, 6, 84, 18, 48, 30, 42, 0, 78, 0, 48, 27, 27, 48, 42, 18, 36, 0, 39, 18, 99, 24, 102, 0, 18, 0, 48, 18, 72, 15, 36, 12, 84, 12, 24, 12, 30, 39, 84, 0, 36, 12, 39, 39, 63, 24, 42, 24, 66, 6, 72, 18, 18, 24, 30, 0, 60, 6, 48, 42, 36, 15, 78, 6, 48, 30, 12, 36, 54, 12, 36, 0, 42, 6, 45, 6, 69, 24, 72, 21, 48, 0, 57, 48, 12, 24, 48, 0, 48, 3, 48, 15, 78, 24, 60, 18, 12, 12, 111, 24, 54, 24, 24, 0, 48, 6, 36, 33, 42, 6, 54, 9, 72, 18, 27, 30, 30, 12, 54, 0, 66, 4, 78, 21, 24, 54, 18, 24, 54, 6, 60, 24, 54, 21, 78, 0, 36, 18, 54, 30, 66, 18, 48, 30, 24, 0, 42, 12, 99, 36, 30, 0, 90, 6, 18, 30, 30, 24, 78, 6, 66, 9, 24, 42, 78, 30, 42, 0, 18, 12, 102, 6, 33, 24, 18, 12, 66, 9, 54, 24, 24, 36, 84, 0, 60, 6, 39, 15, 78, 12, 42, 21, 42, 18, 42, 18, 18, 42, 24, 0, 48, 3, 105, 51, 42, 30, 42, 18, 72, 0, 24, 24, 102, 6, 36, 0, 36, 9, 99, 12, 48, 21, 48, 18, 42, 6, 36, 42, 18, 12, 78, 0, 48, 30, 30, 18, 36, 30, 42, 9, 42, 6, 60, 12, 39, 30, 24, 0, 78, 0, 48, 30, 39, 27, 102, 24, 30, 12, 51, 12, 66, 9, 48, 0, 30, 18, 45, 39, 87, 30, 36, 9, 72, 0, 60, 24, 30, 36, 54, 0, 48, 0, 45, 36, 45, 18, 42, 27, 60, 9, 66, 12, 78, 42, 18, 0, 60, 6, 60, 33, 36, 24, 96, 12, 18, 12, 12, 36, 72, 0, 78, 0, 36, 6, 60, 24, 27, 51, 42, 24, 84, 12, 57, 48, 30, 24, 42, 0, 60, 12, 24, 18, 96, 12, 30, 30, 30, 0, 93, 18, 48, 18, 60, 0, 48, 6, 54, 36, 30, 12, 42, 9, 60, 18, 12, 24, 69, 6, 60, 0, 54, 6, 33, 15, 60, 36, 30, 18, 90, 3, 72, 24, 54, 54, 42, 0, 18, 9, 60, 30, 84, 18, 48, 24, 12, 6, 66, 36, 24, 27, 24, 0, 42, 12, 39, 42, 27, 18, 108, 9, 78, 0, 48, 12, 54, 30, 30, 0, 36, 0, 48, 12, 75, 39, 30, 6, 42, 9, 66, 30, 33, 18, 96, 0, 48, 18, 39, 36, 102, 12, 54, 18, 24, 9, 45, 24, 72, 30, 36, 0, 78, 6, 63, 36, 36, 21, 60, 9, 36, 12, 54, 24, 78, 27, 42, 0, 42, 18, 60, 9, 24, 24, 54, 39, 84, 0, 27, 36, 39, 12, 84, 0, 66, 0, 21, 30, 30, 42, 66, 18, 18, 18, 78, 12, 48, 42, 36, 0, 90, 6, 48, 33, 39, 24, 48, 15, 54, 15, 54, 24, 48, 18, 60, 0, 24, 0, 48, 24, 78, 24, 36, 9, 90, 12, 42, 24, 30, 45, 54, 0, 66, 12, 24, 12, 60, 6, 48, 33, 48, 0, 60, 6, 51, 54, 12, 0, 30, 0, 69, 21, 42, 15, 72, 15, 48, 21, 33, 36, 96, 6, 30, 0, 54, 6, 87, 30, 42, 30, 36, 13, 42, 6, 84, 48, 18, 18, 72, 0, 54, 12, 30, 30, 75, 24, 36, 24, 42, 18, 78, 12, 36, 30, 72, 0, 48, 6, 33, 36, 57, 36, 66, 6, 54, 0, 27, 36, 66, 12, 90, 0, 24, 3, 96, 24, 27, 24, 18, 24, 108, 12, 42, 48, 24, 18, 30, 0, 54, 18, 48, 12, 75, 18, 90, 21, 36, 12, 72, 12, 45, 24, 24, 0, 114, 0, 27, 30, 39, 33, 48, 12, 54, 12, 18, 42, 45, 27, 48, 0, 48, 6, 90, 9, 60, 42, 36, 12, 48, 0, 36, 42, 42, 18, 78, 0, 30, 6, 24, 33, 78, 9, 84, 30, 18, 15, 63, 18, 51, 30, 48, 0, 72, 6, 36, 51, 24, 30, 48, 21, 96, 6, 24, 6, 93, 12, 48, 0, 18, 6, 69, 18, 36, 18, 24, 18, 24, 6, 54, 36, 51, 33, 96, 0, 36, 15, 27, 30, 54, 30, 42, 12, 36, 0, 117, 36, 54, 36, 24, 0, 96, 3, 72, 36, 57, 27, 54, 6, 54, 21, 36, 12, 66, 33, 60, 0, 30, 24, 24, 15, 63, 30, 42, 24, 78, 9, 39, 30, 24, 24, 138, 0, 42, 0, 54, 24, 57, 12, 30, 24, 42, 18, 54, 6, 60, 33, 24, 0, 72, 6, 84, 24, 42, 6, 66, 15, 36, 0, 42, 48, 51, 18, 66, 0, 60, 3, 60, 12, 60, 57, 42, 9, 72, 12, 60, 42, 27, 24, 60, 0, 42, 18, 24, 30, 48, 30, 36, 18, 30, 9, 78, 12, 51, 18, 30, 0, 60, 0, 12, 57, 51, 18, 78, 6, 102, 12, 30, 24, 48, 27, 36, 0, 30, 12, 126, 6, 27, 36, 30, 18, 66, 0, 60, 30, 48, 36, 48, 0, 24, 6, 39, 24, 96, 12, 90, 33, 36, 6, 39, 6, 90, 27, 36, 0, 60, 12, 45, 42, 30, 30, 72, 12, 36, 9, 39, 36, 69, 24, 48, 0, 36, 6, 66, 15, 72, 39, 36, 27, 54, 18, 57, 30, 42, 12, 60, 0, 84, 24, 36, 27, 72, 12, 48, 21, 60, 0, 51, 30, 27, 30, 90, 0, 78, 0, 42, 57, 12, 30, 48, 18, 42, 6, 48, 24, 90, 15, 42, 0, 12, 15, 84, 24, 72, 18, 48, 21, 66, 3, 54, 42, 30, 24, 48, 0, 36, 18, 27, 12, 42, 9, 108, 18, 36, 12, 96, 24, 21, 30, 24, 0, 96, 9, 54, 18, 75, 30, 54, 18, 36, 0, 39, 18, 84, 18, 42, 0, 24, 6, 54, 18, 57, 42, 24, 9, 84, 18, 48, 42, 27, 30, 78, 0, 60, 0, 30, 48, 36, 6, 30, 36, 6, 10, 78, 12, 51, 48, 48, 0, 90, 0, 75, 9, 42, 24, 48, 15, 72, 12, 33, 42, 108, 12, 54, 0, 54, 18, 51, 42, 36, 48, 48, 12, 72, 0, 42, 18, 45, 30, 66, 0, 78, 3, 36, 15, 78, 30, 30, 30, 30, 15, 102, 12, 54, 18, 30, 0, 36, 6, 81, 48, 12, 24, 108, 6, 78, 18, 24, 36, 33, 18, 30, 0, 30, 0, 108, 21, 54, 42, 18, 18, 90, 6, 30, 48, 69, 36, 48, 0, 24, 15, 24, 15, 84, 24, 114, 6, 30, 0, 48, 6, 60, 42, 24, 0, 102, 12, 42, 42, 27, 21, 78, 9, 42, 24, 51, 24, 42, 12, 48, 0, 60, 12, 66, 6, 42, 24, 30, 24, 42, 0, 78, 24, 54, 12, 66, 0, 30, 6, 24, 51, 99, 18, 60, 24, 42, 18, 54, 6, 45, 60, 36, 0, 54, 6, 39, 39, 39, 30, 66, 18, 72, 0, 51, 24, 102, 12, 54, 0, 24, 0, 102, 12, 48, 24, 42, 36, 60, 0, 12, 48, 18, 12, 54, 0, 84, 18, 39, 9, 84, 30, 66, 18, 48, 15, 72, 48, 39, 42, 48, 0, 60, 0, 84, 30, 45, 33, 54, 6, 54, 30, 33, 30, 90, 6, 54, 0, 24, 6, 72, 27, 78, 12, 24, 15, 66, 0, 54, 36, 21, 42, 114, 0, 60, 3, 30, 33, 54, 27, 30, 33, 60, 6, 54, 12, 48, 33, 36, 0, 42, 12, 45, 39, 24, 36, 96, 18, 24, 12, 33, 18, 99, 18, 66, 0, 36, 0, 51, 24, 30, 30, 36, 15, 84, 6, 102, 48, 48, 18, 60, 0, 72, 12, 36, 42, 60, 12, 24, 21, 30, 0, 54, 18, 60, 18, 42, 0, 66, 6, 24, 24, 54, 15, 78, 12, 42, 27, 27, 30, 51, 27, 78, 0, 48, 6, 120, 27, 48, 42, 24, 12, 54, 6, 54, 24, 48, 36, 66, 0, 78, 9, 57, 21, 48, 18, 54, 33, 24, 30, 84, 18, 45, 33, 30, 0, 126, 9, 36, 30, 27, 30, 66, 18, 54, 0, 36, 42, 48, 6, 42, 0, 54, 6, 57, 12, 84, 54, 48, 6, 60, 6, 63, 18, 42, 36, 78, 0, 24, 24, 33, 24, 105, 24, 66, 27, 48, 0, 48, 30, 60, 30, 54, 0, 42, 3, 75, 48, 24, 12, 66, 12, 96, 6, 30, 12, 87, 21, 36, 0, 30, 24, 69, 12, 57, 30, 48, 24, 54, 0, 42, 54, 24, 24, 72, 0, 60, 0, 48, 24, 69, 24, 42, 18, 36, 12, 66, 24, 36, 42, 18, 0, 78, 9, 48, 36, 42, 42, 36, 12, 36, 21, 78, 18, 48, 12, 102, 0, 18, 12, 54, 24, 45, 27, 42, 13, 108, 12, 39, 24, 42, 27, 102, 0, 60, 6, 39, 24, 54, 12, 54, 24, 24, 0, 114, 24, 63, 48, 30, 0, 48, 6, 69, 36, 18, 12, 72, 6, 48, 18, 33, 54, 117, 12, 42, 0, 66, 12, 48, 6, 54, 36, 42, 21, 102, 6, 48, 54, 33, 30, 48, 0, 72, 0, 30, 24, 75, 24, 84, 30, 30, 0, 72, 18, 30, 42, 54, 0, 60, 12, 36, 45, 42, 12, 96, 6, 66, 0, 12, 36, 78, 36, 42, 0, 36, 0, 78, 24, 48, 24, 18, 30, 90, 15, 96, 18, 27, 21, 54, 0, 24, 21, 48, 27, 84, 18, 48, 42, 36, 6, 66, 12, 108, 12, 42, 0, 48, 9, 27, 60, 21, 36, 84, 6, 36, 18, 42, 18, 54, 18, 60, 0, 60, 15, 72, 9, 99, 42, 12, 12, 60, 0, 57, 42, 18, 18, 78, 0, 42, 6, 36, 36, 63, 9, 42, 15, 30, 18, 78, 6, 24, 48, 42, 0, 102, 12, 75, 45, 42, 30, 84, 24, 66, 9, 24, 30, 90, 24, 42, 0, 24, 3, 84, 21, 84, 33, 66, 24, 36, 6, 36, 48, 51, 18, 72, 0, 66, 18, 54, 30, 24, 18, 48, 18, 30, 0, 102, 12, 45, 36, 24, 0, 102, 3, 42, 15, 42, 54, 54, 21, 66, 24, 66, 30, 102, 3, 66, 0, 48, 12, 24, 30, 45, 36, 54, 6, 78, 9, 48, 24, 39, 36, 96, 0, 66, 6, 27, 27, 60, 30, 18, 30, 48, 12, 90, 24, 60, 36, 6, 0, 42, 12, 78, 36, 36, 24, 114, 6, 60, 0, 18, 6, 69, 18, 84, 0, 36, 6, 48, 6, 39, 24, 42, 24, 54, 6, 72, 48, 36, 42, 60, 0, 48, 0, 36, 18, 138, 24, 30, 30, 42, 18, 75, 18, 48, 18, 24, 0, 78, 0, 78, 57, 60, 9, 48, 9, 36, 30, 30, 42, 42, 39, 84, 0, 24, 12, 87, 27, 30, 42, 24, 24, 90, 0, 36, 24, 60, 36, 84, 0, 42, 0, 30, 21, 87, 12, 72, 24, 42, 12, 60, 30, 72, 21, 60, 0, 96, 12, 30, 42, 39, 18, 66, 12, 84, 12, 63, 42, 42, 24, 42, 0, 18, 6, 78, 15, 75, 45, 54, 12, 54, 6, 84, 30, 30, 18, 54, 0, 42, 24, 39, 27, 96, 18, 42, 21, 48, 0, 54, 18, 33, 36, 66, 0, 84, 0, 75, 48, 30, 42, 54, 12, 54, 15, 42, 30, 96, 18, 42, 0, 18, 6, 123, 15, 48, 24, 48, 39, 42, 6, 21, 54, 45, 12, 60, 0, 90, 12, 30, 36, 45, 18, 72, 21, 78, 12, 30, 12, 60, 30, 18, 0, 78, 6, 60, 36, 33, 18, 60, 12, 30, 0, 60, 18, 90, 30, 54, 0, 36, 1, 78, 27, 84, 30, 18, 15, 102, 9, 27, 30, 24, 57, 90, 0, 42, 9, 48, 42, 42, 12, 72, 27, 48, 9, 108, 18, 48, 48, 18, 0, 84, 6, 66, 24, 48, 21, 114, 6, 78, 24, 30, 30, 42, 18, 60, 0, 18, 12, 63, 9, 51, 66, 48, 15, 54, 0, 66, 60, 36, 18, 48, 0, 66, 6, 36, 30, 96, 9, 36, 30, 30, 24, 93, 24, 72, 24, 66, 0, 60, 24, 48, 30, 24, 30, 72, 6, 60, 12, 30, 12, 93, 18, 72, 0, 30, 0, 81, 30, 36, 48, 36, 30, 90, 6, 54, 24, 57, 24, 36, 0, 54, 18, 36, 24, 78, 18, 72, 33, 12, 0, 51, 30, 48, 24, 42, 0, 90, 3, 78, 30, 30, 27, 138, 6, 30, 18, 36, 24, 75, 24, 12, 0, 54, 12, 42, 18, 84, 36, 30, 18, 66, 6, 45, 36, 36, 48, 114, 0, 24, 6, 30, 21, 108, 15, 48, 18, 36, 18, 57, 24, 63, 42, 54, 0, 78, 6, 81, 36, 18, 24, 42, 18, 120, 0, 24, 24, 66, 12, 54, 0, 48, 12, 66, 18, 42, 36, 48, 18, 72, 6, 48, 48, 33, 6, 102, 0, 54, 24, 39, 54, 60, 12, 90, 18, 36, 3, 111, 24, 51, 48, 42, 0, 90, 0, 45, 36, 54, 48, 54, 24, 18, 18, 51, 18, 72, 0, 54, 0, 18, 12, 54, 36, 57, 18, 42, 18, 120, 0, 63, 42, 27, 36, 48, 0, 54, 6, 39, 30, 81, 18, 72, 33, 54, 9, 72, 12, 54, 54, 24, 0, 54, 15, 75, 24, 60, 12, 78, 6, 30, 12, 39, 54, 72, 6, 54, 0, 72, 6, 78, 12, 54, 39, 30, 15, 48, 6, 57, 48, 18, 24, 90, 0, 90, 18, 42, 24, 39, 42, 24, 30, 42, 0, 84, 6, 66, 30, 30, 0, 30, 0, 27, 42, 39, 33, 90, 24, 84, 18, 51, 36, 69, 24, 54, 0, 42, 18, 87, 33, 51, 18, 42, 9, 126, 9, 84, 36, 66, 18, 54, 0, 36, 0, 66, 12, 48, 15, 54, 30, 18, 18, 60, 18, 96, 54, 42, 0, 102, 0, 27, 36, 30, 36, 108, 15, 54, 0, 24, 36, 60, 24, 66, 0, 30, 0, 54, 15, 75, 48, 36, 18, 48, 24, 36, 36, 54, 15, 108, 0, 84, 18}; // FOR(n, 1, N+1) { // int ans = 0; // FOR(x, 1, floor(sqrt(N+1))) { // FOR(y, 1, floor(sqrt(N+1))) { // FOR(z, 1, floor(sqrt(N+1))) { // if (x*x + y*y + z*z + x*y + y*z + z*x == n) ans++; // } // } // } // cout << ans << ","; // } rep(i, N) { cout << a[i] << endl; } }
replace
24
37
24
662
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ll l, r, i, j, k, n, m, x; cin >> n; ll ar[1005] = {0}; for (i = 1; i <= 100; i++) { for (j = 1; j <= 100; j++) { for (k = 1; k <= 100; k++) { // cout<<i<<' '<<j<<' '<<k<<endl; ll x = i * i + j * j + k * k + i * j + j * k + k * i; if (x <= n) ar[x]++; } } } for (i = 1; i <= n; i++) cout << ar[i] << endl; }
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { ll l, r, i, j, k, n, m, x; cin >> n; ll ar[10005] = {0}; for (i = 1; i <= 100; i++) { for (j = 1; j <= 100; j++) { for (k = 1; k <= 100; k++) { // cout<<i<<' '<<j<<' '<<k<<endl; ll x = i * i + j * j + k * k + i * j + j * k + k * i; if (x <= n) ar[x]++; } } } for (i = 1; i <= n; i++) cout << ar[i] << endl; }
replace
6
7
6
7
0
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define ALL(x) x.begin(), x.end() #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N; cin >> N; for (int i = 1; i < N + 1; i++) { int ANS = 0; for (int j = 1; pow(j, 2) < i; j++) { for (int k = 1; pow(k, 2) < i; k++) { if (pow(j + k, 2) - j * k > i) { break; } for (int l = 1; pow(l, 2) < i; l++) { if (pow(j + k + l, 2) - j * k - k * l - j * l > i) { break; } if (pow(j + k + l, 2) - j * k - k * l - j * l == i) { ANS++; } } } } cout << ANS << endl; } }
#include <bits/stdc++.h> using namespace std; #define ALL(x) x.begin(), x.end() #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int N; cin >> N; for (int i = 1; i < N + 1; i++) { int ANS = 0; for (int j = 1; j * j <= i; j++) { for (int k = 1; (j + k) * (j + k) - j * k <= i; k++) { for (int l = 1; (j + k + l) * (j + k + l) - j * k - k * l - j * l <= i; l++) { if ((j + k + l) * (j + k + l) - j * k - k * l - j * l == i) { ANS++; } } } } cout << ANS << endl; } }
replace
10
20
10
15
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> ans(n + 1, 0); for (int x = 1; x * x <= n; x++) { for (int y = 1; y * y <= n; y++) { for (int z = 1; z * z <= n; z++) { int num = x * x + y * y + z * z + x * y + y * z + z * x; ans[num]++; } } } for (int i = 1; i <= n; i++) { cout << ans[i] << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> ans(1000000, 0); for (int x = 1; x * x <= n; x++) { for (int y = 1; y * y <= n; y++) { for (int z = 1; z * z <= n; z++) { int num = x * x + y * y + z * z + x * y + y * z + z * x; ans[num]++; } } } for (int i = 1; i <= n; i++) { cout << ans[i] << endl; } }
replace
5
6
5
6
0
p02608
C++
Time Limit Exceeded
#include <stdio.h> #pragma warning(disable : 4996) // prototype int counter(int); int main() { // input int N; (void)scanf("%d", &N); // output for (int i = 1; i <= N; i++) { printf("%d\n", counter(i)); } } int counter(int i) { int count = 0; for (int x = 1; x * x < i; x++) { for (int y = 1; y * y < i - (x * x); y++) { for (int z = 1; z * z < i - (x * x) - (y * y); z++) { if (((x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x)) == i) count++; } } } return count; }
#include <stdio.h> #pragma warning(disable : 4996) // prototype int counter(int); int main() { // input int N; (void)scanf("%d", &N); // output for (int i = 1; i <= N; i++) { printf("%d\n", counter(i)); } } int counter(int i) { int count = 0; for (int x = 1; x * (x + 2) <= (i - 3); x++) { for (int y = 1; y * (x + y + 1) <= i - ((x * x) + x + 1); y++) { for (int z = 1; ((x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x)) <= i; z++) { if (((x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x)) == i) count++; } } } return count; }
replace
19
22
19
24
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, a, b) for (int i = a; i < b; ++i) #define FORR(i, a, b) for (int i = b - 1; i >= a; --i) #define SORT(v) sort(v.begin(), v.end()) #define SORTR(v) sort(v.rbegin(), v.rend()) #define REV(v) reverse(v.begin(), v.end()) #define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr) #define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin()) #define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin()) #define SZ(v) (int)v.size() using namespace std; using ll = long long; using P = pair<int, int>; int g(int x, int y, int z) { return x * x + y * y + z * z + x * y + y * z + z * x; } int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; int n = sqrt(N); vector<int> f(N + 1); FOR(i, 1, N + 1) { FOR(j, 1, N + 1) { FOR(k, 1, N + 1) { int v = g(i, j, k); if (v <= N) { f[v]++; } } } } FOR(i, 1, N + 1) { cout << f[i] << endl; } return 0; }
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, a, b) for (int i = a; i < b; ++i) #define FORR(i, a, b) for (int i = b - 1; i >= a; --i) #define SORT(v) sort(v.begin(), v.end()) #define SORTR(v) sort(v.rbegin(), v.rend()) #define REV(v) reverse(v.begin(), v.end()) #define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr) #define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin()) #define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin()) #define SZ(v) (int)v.size() using namespace std; using ll = long long; using P = pair<int, int>; int g(int x, int y, int z) { return x * x + y * y + z * z + x * y + y * z + z * x; } int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; int n = sqrt(N); vector<int> f(N + 1); FOR(i, 1, n + 1) { FOR(j, 1, n + 1) { FOR(k, 1, n + 1) { int v = g(i, j, k); if (v <= N) { f[v]++; } } } } FOR(i, 1, N + 1) { cout << f[i] << endl; } return 0; }
replace
28
31
28
31
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n; cin >> n; int a[10001] = {0}; for (int i = 1; i * i <= 10050; i++) { for (int j = 1; j * j <= 10050; j++) { for (int k = 1; k * k <= 10050; k++) { ll x = i * i + j * j + k * k + i * j + j * k + k * i; if (x <= 10050) { a[x]++; } } } } for (int i = 1; i <= n; i++) { cout << a[i] << endl; } }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n; cin >> n; int a[10001] = {0}; for (int i = 1; i * i <= 10050; i++) { for (int j = 1; j * j <= 10050; j++) { for (int k = 1; k * k <= 10050; k++) { ll x = i * i + j * j + k * k + i * j + j * k + k * i; if (x <= 10000) { a[x]++; } } } } for (int i = 1; i <= n; i++) { cout << a[i] << endl; } }
replace
11
12
11
12
-6
*** stack smashing detected ***: terminated
p02608
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; vector<int> ans(1000000000); for (int i = 1; i < n; i++) { for (int j = 1; j < n; j++) { for (int k = 1; k < n; k++) { ans[i * i + j * j + k * k + i * j + j * k + k * i]++; } } } for (int i = 1; i <= n; i++) cout << ans[i] << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; vector<int> ans(100000000); for (int i = 1; i <= sqrt(n); i++) { for (int j = 1; j <= sqrt(n); j++) { for (int k = 1; k <= sqrt(n); k++) { ans[i * i + j * j + k * k + i * j + j * k + k * i]++; } } } for (int i = 1; i <= n; i++) cout << ans[i] << endl; return 0; }
replace
9
13
9
13
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define arep(x, n) for (int x : n) using namespace std; int main() { int n; cin >> n; vector<int> ans(n); int max = sqrt(n); // bool over_x, over_y, over_z; int tmp = 0; for (int i = 6; i <= n; i++) { for (int x = 1; x <= max; x++) { for (int y = 1; y <= max; y++) { for (int z = 1; z <= max; z++) { tmp = x * x + y * y + z * z + x * y + y * z + z * x; if (tmp == i) ans.at(i - 1)++; } } } } arep(x, ans) cout << x << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) #define arep(x, n) for (int x : n) using namespace std; int main() { int n; cin >> n; vector<int> ans(n); int max = sqrt(n); // bool over_x, over_y, over_z; int tmp = 0; for (int i = 6; i <= n; i++) { for (int x = 1; x <= max; x++) { for (int y = 1; y <= max; y++) { for (int z = 1; z <= max; z++) { tmp = x * x + y * y + z * z + x * y + y * z + z * x; if (tmp > i) break; if (tmp == i) ans.at(i - 1)++; } } } } arep(x, ans) cout << x << endl; }
replace
23
24
23
25
TLE
p02608
C++
Time Limit Exceeded
#include <cmath> #include <iostream> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 1; i <= n; i++) { int c = 0; for (int x = 1; x <= i; x++) { for (int y = 1; y <= i; y++) { // cout << (y + x) * (y + x) - 4 * (-i + x * x + y * y + x * y) << "\n"; int tmp = pow(x + y, 2) - 4 * (pow(x, 2) + pow(y, 2) + x * y - i); if (tmp == 0) { int z = (-1 * (x + y) + sqrt(tmp)) / 2; if (z >= 1 && pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x == i) { c++; } } else if (tmp > 0) { int z = (-1 * (x + y) + sqrt(tmp)) / 2; if (z >= 1 && pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x == i) { c++; } z = (-1 * (x + y) - sqrt(tmp)) / 2; if (z >= 1 && pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x == i) { c++; } } } } cout << c << " \n"; } }
#include <cmath> #include <iostream> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 1; i <= n; i++) { int c = 0; for (int x = 1; x <= sqrt(i); x++) { for (int y = 1; y <= sqrt(i); y++) { // cout << (y + x) * (y + x) - 4 * (-i + x * x + y * y + x * y) << "\n"; int tmp = pow(x + y, 2) - 4 * (pow(x, 2) + pow(y, 2) + x * y - i); if (tmp == 0) { int z = (-1 * (x + y) + sqrt(tmp)) / 2; if (z >= 1 && pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x == i) { c++; } } else if (tmp > 0) { int z = (-1 * (x + y) + sqrt(tmp)) / 2; if (z >= 1 && pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x == i) { c++; } z = (-1 * (x + y) - sqrt(tmp)) / 2; if (z >= 1 && pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x == i) { c++; } } } } cout << c << " \n"; } }
replace
12
14
12
14
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using llong = long long; using ldbl = long double; using lpair = pair<llong, llong>; #define ALL(x) x.begin(), x.end() constexpr llong mod = 1e9 + 7; constexpr llong inf = mod * mod; int main() { llong N; cin >> N; for (llong i = 1; i <= N; ++i) { llong cnt = 0; for (llong x = 1; x <= 1000; x++) { for (llong y = x; y <= 1000; y++) { for (llong z = y; z <= 1000; z++) { llong sum = x * x + y * y + z * z + x * y + x * z + y * z - i; if (sum == 0) { if (x == y && y == z) { cnt += 1; } else if (x == y || y == z || x == z) { cnt += 3; } else { cnt += 6; } } if (sum > i) { break; } } } } cout << cnt << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; using llong = long long; using ldbl = long double; using lpair = pair<llong, llong>; #define ALL(x) x.begin(), x.end() constexpr llong mod = 1e9 + 7; constexpr llong inf = mod * mod; int main() { llong N; cin >> N; for (llong i = 1; i <= N; ++i) { llong cnt = 0; for (llong x = 1; x <= 1000; x++) { for (llong y = 1; y <= 1000; y++) { if (x * x + y * y + x * y > i) { break; } llong d = (x + y) * (x + y) - 4 * (x * x + y * y + x * y - i); llong sqrt_d = sqrtl(d); if (sqrt_d * sqrt_d == d && sqrt_d - (x + y) > 0 && (sqrt_d - (x + y)) % 2 == 0) { cnt++; } } } cout << cnt << endl; } return 0; }
replace
19
34
19
29
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // #define int long long #define ll long long #define sz(a) (int)(a.size()) #define pb push_back #define all(c) c.begin(), c.end() #define tr(it, c) for (auto it = c.begin(); it != c.end(); it++) #define fr(i, a, n) for (int i = a; i < n; i++) #define present(c, x) (c.find(x) != c.end()) // for set/map etc. #define cpresent(c, x) (find(all(c), x) != c.end()) typedef pair<int, int> pi; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<long long> vll; typedef vector<pair<int, int>> vp; int N = 100001; int mod = 1e9 + 7; int min(int a, int b) { if (a < b) return a; else return b; } int max(ll a, ll b) { if (a > b) return a; else return b; } int power(int a, int b) { int res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1) res = res * a % mod; a = a * a % mod; } return res; } int gcd(int p, int q) { if (p % q == 0) return q; else { return gcd(q, p % q); } } bool comp(int a, int b) { return (a > b); } void solve() { // int n; // cin>>n; // string s; // cin>>s; // int sum=0; // int c1=0; // for(int i=n-1;i>=0;i--) // { // if(s[i]=='1') // { // c1++; // sum+= pow(2,n-1-i); // } // } // int ans=0; // int cou=c1; // fr(i,0,n) // { // if(i=='1'){ans=sum-pow(2,n-1-i);cou=c1-1;} // else {ans= sum+ pow(2,n-1-i);cou=c1+1;} // int main=0; // while(ans!=0) // { // ans= ans%c1; // } // } int n; cin >> n; vi count1(n, 0); fr(i, 1, sqrt(n) + 1) { fr(j, 1, sqrt(n) + 1) { fr(k, 1, sqrt(n) + 1) { count1[i * i + j * j + k * k + i * j + j * k + k * i]++; } } } fr(i, 1, n + 1) { cout << count1[i] << endl; } // v[0]=v[n]; // v[n+1]=v[0]; // while(v.size()>1) // { // auto it = min_element(v.begin(),v.end()); // if(it==v.begin()) // { // *it = *(it+1) + *(v.end()-1); // v.erase(v.end()); // v.erase(it+1); // } // else if(it==v.end()) // { // *it = *(it-1) + *(v.begin()); // v.erase(v.begin()); // v.erase(it-1); // cout<<1; // } // else // { // *it = *(it-1) + *(it+1); // v.erase(it+1); // v.erase(it-1); // } // } // cout<<v[0]; } int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif // int t; // cin>>t; // while(t--) // { // solve(); // cout<<endl; // } solve(); return 0; }
#include <bits/stdc++.h> using namespace std; // #define int long long #define ll long long #define sz(a) (int)(a.size()) #define pb push_back #define all(c) c.begin(), c.end() #define tr(it, c) for (auto it = c.begin(); it != c.end(); it++) #define fr(i, a, n) for (int i = a; i < n; i++) #define present(c, x) (c.find(x) != c.end()) // for set/map etc. #define cpresent(c, x) (find(all(c), x) != c.end()) typedef pair<int, int> pi; typedef vector<int> vi; typedef vector<vector<int>> vvi; typedef vector<long long> vll; typedef vector<pair<int, int>> vp; int N = 100001; int mod = 1e9 + 7; int min(int a, int b) { if (a < b) return a; else return b; } int max(ll a, ll b) { if (a > b) return a; else return b; } int power(int a, int b) { int res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1) res = res * a % mod; a = a * a % mod; } return res; } int gcd(int p, int q) { if (p % q == 0) return q; else { return gcd(q, p % q); } } bool comp(int a, int b) { return (a > b); } void solve() { // int n; // cin>>n; // string s; // cin>>s; // int sum=0; // int c1=0; // for(int i=n-1;i>=0;i--) // { // if(s[i]=='1') // { // c1++; // sum+= pow(2,n-1-i); // } // } // int ans=0; // int cou=c1; // fr(i,0,n) // { // if(i=='1'){ans=sum-pow(2,n-1-i);cou=c1-1;} // else {ans= sum+ pow(2,n-1-i);cou=c1+1;} // int main=0; // while(ans!=0) // { // ans= ans%c1; // } // } int n; cin >> n; vi count1(2e6, 0); fr(i, 1, sqrt(n) + 1) { fr(j, 1, sqrt(n) + 1) { fr(k, 1, sqrt(n) + 1) { count1[i * i + j * j + k * k + i * j + j * k + k * i]++; } } } fr(i, 1, n + 1) { cout << count1[i] << endl; } // v[0]=v[n]; // v[n+1]=v[0]; // while(v.size()>1) // { // auto it = min_element(v.begin(),v.end()); // if(it==v.begin()) // { // *it = *(it+1) + *(v.end()-1); // v.erase(v.end()); // v.erase(it+1); // } // else if(it==v.end()) // { // *it = *(it-1) + *(v.begin()); // v.erase(v.begin()); // v.erase(it-1); // cout<<1; // } // else // { // *it = *(it-1) + *(it+1); // v.erase(it+1); // v.erase(it-1); // } // } // cout<<v[0]; } int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif // int t; // cin>>t; // while(t--) // { // solve(); // cout<<endl; // } solve(); return 0; }
replace
79
80
79
80
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<string, int>; const int INF = 1000000007; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int cnt = 0; for (int x = 1; x <= sqrt(i); x++) { for (int y = 1; y <= sqrt(i); y++) { for (int z = 1; z <= sqrt(i); z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) cnt++; } } } cout << cnt << endl; } }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<string, int>; const int INF = 1000000007; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int cnt = 0; for (int x = 1; x <= sqrt(i); x++) { for (int y = x; y <= sqrt(i); y++) { for (int z = y; z <= sqrt(i); z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) { if (x == y && y == z) { cnt += 1; } else if (x == y || y == z || z == x) { cnt += 3; } else { cnt += 6; } } } } } cout << cnt << endl; } }
replace
14
18
14
29
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define all(v) v.begin(), v.end() int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { int ansi = 0; for (int x = 1; x < sqrt(n); x++) { for (int y = x; y < sqrt(n); y++) { for (int z = y; z < sqrt(n); z++) { if ((x * x + y * y + z * z + x * y + y * z + z * x) == i) { if ((x == y) && (y == z)) { ansi += 1; } else if ((x != y) && (y != z)) { ansi += 6; } else { ansi += 3; } } } } } cout << ansi << endl; } }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define all(v) v.begin(), v.end() int main() { int n; cin >> n; vector<int> ans( {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 1, 6, 0, 3, 0, 0, 0, 0, 0, 3, 3, 6, 0, 0, 3, 0, 0, 0, 0, 3, 3, 6, 0, 6, 0, 0, 0, 3, 0, 0, 1, 6, 0, 6, 6, 0, 0, 6, 0, 0, 0, 0, 3, 3, 3, 6, 0, 6, 3, 6, 0, 0, 0, 6, 0, 0, 0, 3, 3, 9, 0, 6, 3, 6, 0, 3, 6, 0, 0, 0, 0, 6, 1, 6, 0, 6, 6, 0, 3, 12, 0, 6, 0, 0, 3, 6, 0, 0, 0, 3, 3, 12, 0, 6, 3, 6, 0, 3, 6, 9, 0, 6, 0, 0, 0, 3, 6, 3, 3, 6, 0, 6, 3, 12, 0, 3, 6, 6, 0, 6, 0, 6, 3, 6, 0, 0, 1, 6, 3, 12, 6, 0, 0, 12, 0, 6, 0, 6, 6, 12, 0, 0, 6, 0, 0, 6, 0, 12, 3, 6, 0, 6, 3, 9, 6, 3, 6, 6, 0, 6, 0, 6, 0, 15, 6, 0, 0, 6, 0, 3, 3, 12, 0, 12, 6, 6, 0, 3, 6, 6, 3, 12, 0, 6, 0, 9, 6, 0, 0, 6, 3, 12, 1, 6, 6, 6, 6, 0, 0, 18, 0, 12, 0, 3, 6, 12, 0, 0, 6, 3, 6, 12, 0, 12, 0, 0, 0, 9, 3, 9, 6, 12, 3, 12, 0, 3, 6, 6, 0, 12, 0, 12, 0, 9, 9, 0, 0, 6, 3, 6, 3, 12, 6, 9, 3, 6, 0, 12, 3, 6, 3, 9, 6, 12, 6, 6, 0, 6, 0, 9, 6, 6, 0, 12, 3, 6, 0, 9, 6, 6, 1, 6, 0, 21, 12, 6, 0, 12, 0, 12, 0, 0, 6, 15, 6, 0, 6, 12, 0, 12, 0, 12, 0, 0, 0, 12, 0, 12, 12, 3, 3, 18, 3, 6, 3, 6, 6, 9, 9, 18, 0, 6, 0, 12, 0, 9, 6, 0, 3, 12, 3, 6, 6, 12, 6, 6, 0, 0, 0, 15, 3, 18, 3, 18, 3, 12, 6, 3, 6, 9, 0, 12, 0, 12, 0, 18, 12, 0, 0, 12, 3, 6, 0, 6, 6, 9, 6, 0, 0, 18, 1, 18, 3, 12, 6, 6, 6, 12, 0, 15, 6, 12, 6, 18, 0, 0, 6, 0, 9, 12, 0, 18, 0, 6, 3, 12, 0, 12, 12, 0, 0, 12, 0, 3, 6, 12, 6, 18, 9, 18, 0, 9, 6, 18, 0, 6, 0, 6, 3, 27, 6, 6, 6, 6, 3, 6, 0, 12, 6, 9, 0, 6, 0, 18, 0, 9, 9, 15, 3, 12, 6, 6, 3, 9, 6, 12, 12, 18, 0, 18, 0, 6, 6, 21, 6, 0, 0, 6, 3, 15, 6, 12, 6, 18, 0, 0, 0, 12, 6, 6, 3, 6, 4, 18, 6, 12, 6, 3, 9, 30, 0, 18, 0, 6, 6, 12, 6, 6, 9, 12, 0, 18, 6, 18, 0, 6, 0, 12, 0, 6, 12, 6, 3, 18, 0, 6, 6, 6, 6, 15, 3, 24, 0, 6, 3, 18, 0, 12, 6, 12, 6, 24, 0, 15, 18, 9, 6, 0, 0, 18, 3, 6, 0, 15, 12, 12, 6, 6, 0, 18, 0, 6, 3, 12, 0, 12, 6, 6, 9, 9, 6, 24, 3, 24, 0, 9, 12, 6, 6, 12, 0, 12, 0, 21, 9, 15, 6, 12, 3, 18, 3, 12, 6, 12, 6, 0, 0, 12, 0, 12, 6, 24, 0, 6, 12, 6, 1, 9, 6, 12, 6, 24, 0, 18, 3, 12, 6, 6, 12, 24, 0, 12, 6, 15, 6, 18, 0, 18, 0, 0, 0, 18, 9, 21, 12, 0, 6, 18, 0, 9, 6, 6, 6, 12, 0, 12, 0, 9, 9, 27, 6, 6, 3, 18, 6, 21, 6, 6, 12, 12, 0, 12, 0, 24, 12, 0, 0, 24, 3, 24, 6, 12, 12, 18, 0, 0, 0, 12, 0, 18, 3, 15, 6, 12, 9, 6, 0, 15, 6, 9, 12, 24, 0, 12, 3, 6, 6, 21, 6, 18, 3, 18, 0, 21, 12, 15, 6, 6, 0, 12, 3, 12, 9, 18, 9, 12, 6, 6, 6, 24, 0, 18, 3, 24, 0, 6, 6, 0, 6, 9, 6, 6, 4, 30, 0, 18, 12, 9, 6, 24, 0, 18, 0, 9, 12, 21, 6, 6, 12, 12, 0, 18, 0, 21, 15, 12, 0, 12, 6, 12, 12, 18, 0, 18, 0, 6, 0, 9, 12, 18, 6, 30, 0, 0, 0, 24, 6, 9, 3, 12, 6, 30, 3, 6, 12, 6, 12, 12, 0, 36, 0, 6, 3, 27, 12, 12, 6, 6, 6, 24, 0, 12, 6, 12, 0, 18, 0, 18, 15, 18, 3, 18, 6, 12, 6, 6, 12, 3, 6, 6, 0, 12, 3, 39, 3, 12, 12, 12, 3, 18, 0, 21, 12, 21, 6, 18, 0, 12, 0, 9, 9, 12, 9, 24, 9, 12, 6, 12, 6, 33, 0, 6, 0, 18, 0, 9, 15, 12, 6, 24, 6, 6, 3, 15, 6, 15, 12, 18, 0, 18, 1, 18, 6, 12, 6, 6, 0, 24, 6, 24, 12, 18, 6, 24, 0, 6, 6, 12, 15, 24, 0, 24, 6, 6, 0, 18, 0, 15, 18, 12, 0, 24, 0, 12, 6, 12, 12, 18, 6, 24, 0, 0, 6, 24, 3, 12, 0, 12, 6, 30, 9, 6, 12, 24, 12, 12, 0, 15, 18, 12, 0, 18, 0, 24, 6, 15, 6, 18, 3, 18, 3, 12, 6, 24, 12, 12, 12, 6, 0, 36, 0, 18, 3, 6, 12, 6, 9, 12, 0, 3, 12, 36, 0, 30, 0, 12, 0, 18, 6, 12, 9, 12, 6, 24, 3, 18, 12, 15, 9, 24, 0, 18, 6, 18, 9, 18, 12, 6, 6, 24, 3, 24, 0, 12, 12, 12, 0, 6, 0, 27, 12, 18, 3, 30, 3, 18, 6, 0, 12, 15, 6, 18, 0, 24, 0, 9, 6, 9, 12, 18, 7, 24, 0, 24, 12, 15, 12, 24, 0, 24, 0, 6, 9, 30, 9, 6, 6, 0, 9, 33, 12, 36, 0, 12, 0, 18, 0, 6, 21, 12, 6, 36, 6, 0, 3, 18, 6, 12, 6, 24, 0, 12, 3, 24, 6, 9, 12, 6, 6, 30, 6, 18, 12, 9, 9, 12, 0, 30, 3, 18, 3, 27, 6, 30, 12, 12, 0, 24, 0, 27, 12, 6, 0, 24, 3, 18, 18, 9, 6, 18, 0, 12, 3, 33, 18, 12, 9, 6, 0, 12, 6, 30, 0, 24, 12, 12, 0, 30, 6, 6, 6, 0, 6, 24, 0, 12, 0, 18, 15, 33, 6, 30, 15, 18, 0, 9, 12, 24, 9, 12, 0, 18, 6, 27, 18, 15, 6, 18, 3, 24, 0, 6, 6, 36, 12, 18, 0, 12, 3, 30, 3, 12, 6, 12, 15, 6, 0, 18, 12, 15, 9, 30, 0, 18, 6, 12, 12, 18, 6, 6, 3, 24, 1, 27, 12, 18, 6, 18, 0, 24, 0, 18, 15, 15, 21, 30, 6, 12, 12, 18, 0, 30, 6, 24, 0, 6, 0, 18, 6, 36, 12, 6, 6, 36, 0, 6, 12, 12, 12, 24, 0, 30, 0, 9, 6, 18, 0, 18, 12, 12, 6, 24, 6, 9, 15, 12, 0, 12, 6, 30, 9, 18, 0, 42, 3, 18, 6, 12, 18, 33, 12, 12, 0, 18, 0, 21, 12, 12, 12, 24, 6, 30, 0, 27, 18, 6, 12, 6, 0, 24, 0, 18, 15, 30, 0, 18, 12, 6, 0, 21, 6, 21, 12, 24, 0, 30, 0, 6, 6, 6, 12, 24, 0, 30, 12, 9, 12, 21, 3, 24, 0, 12, 3, 21, 18, 9, 18, 18, 6, 30, 3, 42, 6, 21, 6, 30, 0, 6, 3, 24, 9, 36, 6, 6, 9, 12, 6, 18, 12, 33, 9, 12, 0, 24, 9, 9, 6, 3, 18, 36, 6, 18, 0, 24, 6, 6, 6, 18, 0, 12, 0, 30, 3, 39, 12, 12, 7, 18, 0, 15, 18, 18, 9, 36, 0, 24, 6, 6, 18, 30, 0, 18, 9, 18, 3, 24, 6, 21, 12, 24, 0, 30, 3, 33, 24, 12, 6, 18, 6, 6, 6, 18, 6, 18, 12, 18, 0, 24, 6, 36, 3, 18, 6, 0, 12, 30, 0, 9, 24, 18, 0, 24, 0, 18, 0, 0, 12, 30, 15, 30, 6, 18, 3, 30, 0, 24, 18, 12, 0, 36, 3, 24, 12, 15, 18, 18, 6, 24, 3, 24, 12, 18, 12, 24, 0, 0, 6, 39, 6, 24, 3, 18, 3, 42, 6, 12, 12, 15, 9, 30, 0, 12, 0, 18, 6, 18, 12, 24, 15, 12, 0, 12, 12, 30, 12, 12, 0, 18, 0, 15, 15, 18, 18, 30, 3, 24, 12, 9, 6, 48, 0, 18, 0, 30, 0, 21, 6, 12, 12, 24, 12, 18, 3, 48, 24, 6, 6, 18, 0, 36, 0, 12, 15, 27, 6, 12, 12, 18, 6, 27, 6, 12, 9, 18, 0, 24, 6, 18, 18, 21, 0, 36, 0, 12, 0, 18, 12, 21, 18, 24, 0, 12, 1, 18, 9, 21, 18, 6, 9, 42, 3, 36, 12, 12, 12, 30, 0, 12, 6, 21, 12, 36, 6, 24, 9, 12, 6, 12, 12, 24, 12, 18, 0, 42, 0, 15, 6, 15, 15, 42, 6, 30, 6, 12, 12, 18, 12, 18, 0, 6, 6, 36, 0, 30, 18, 6, 0, 6, 0, 30, 18, 18, 0, 42, 0, 18, 6, 15, 18, 24, 0, 12, 6, 36, 9, 33, 12, 12, 12, 18, 0, 36, 0, 21, 21, 15, 18, 18, 15, 18, 0, 18, 6, 42, 6, 24, 0, 18, 3, 42, 6, 18, 12, 12, 12, 18, 0, 15, 12, 18, 12, 36, 0, 30, 12, 3, 21, 18, 0, 30, 6, 24, 0, 27, 12, 18, 12, 6, 0, 12, 0, 36, 15, 15, 3, 36, 12, 18, 6, 30, 6, 33, 12, 12, 0, 12, 6, 24, 6, 54, 18, 12, 3, 36, 9, 9, 12, 12, 18, 36, 0, 6, 0, 21, 15, 27, 9, 24, 12, 30, 6, 24, 6, 27, 18, 12, 0, 30, 0, 21, 12, 18, 6, 30, 0, 18, 0, 21, 18, 21, 6, 30, 0, 24, 3, 6, 6, 15, 27, 12, 10, 42, 6, 36, 12, 12, 6, 24, 0, 24, 6, 12, 12, 48, 6, 18, 12, 0, 3, 51, 6, 30, 6, 24, 0, 24, 0, 30, 21, 15, 12, 24, 9, 18, 6, 18, 12, 30, 9, 24, 0, 18, 0, 27, 18, 9, 6, 18, 9, 54, 0, 18, 24, 21, 18, 12, 0, 24, 0, 12, 0, 30, 9, 30, 12, 6, 9, 24, 6, 15, 15, 18, 0, 30, 3, 33, 18, 21, 12, 42, 3, 30, 6, 6, 24, 27, 6, 12, 0, 24, 3, 42, 6, 42, 9, 12, 6, 18, 6, 24, 12, 12, 12, 54, 0, 6, 12, 18, 6, 18, 18, 30, 12, 30, 0, 18, 0, 27, 18, 24, 0, 18, 0, 15, 24, 21, 6, 24, 3, 36, 6, 6, 6, 45, 21, 18, 0, 18, 6, 33, 3, 18, 0, 24, 15, 30, 0, 30, 24, 12, 6, 36, 0, 24, 3, 21, 24, 18, 15, 30, 3, 12, 6, 42, 12, 12, 12, 6, 0, 54, 6, 30, 15, 24, 18, 24, 6, 12, 0, 9, 6, 30, 0, 48, 0, 24, 0, 15, 12, 39, 12, 24, 6, 24, 6, 15, 30, 12, 6, 24, 0, 24, 3, 24, 12, 24, 6, 6, 18, 12, 4, 54, 6, 21, 18, 18, 0, 36, 6, 24, 9, 30, 12, 24, 9, 36, 6, 12, 18, 42, 3, 30, 0, 6, 9, 21, 6, 12, 30, 30, 6, 30, 0, 27, 12, 9, 18, 30, 0, 36, 0, 18, 9, 42, 6, 24, 12, 0, 6, 51, 12, 24, 12, 12, 0, 18, 6, 12, 18, 6, 6, 36, 3, 54, 9, 18, 6, 27, 12, 18, 0, 30, 0, 39, 9, 18, 18, 12, 9, 30, 6, 21, 12, 27, 18, 24, 0, 12, 0, 42, 18, 42, 6, 24, 15, 18, 0, 24, 12, 45, 12, 6, 0, 54, 0, 15, 21, 6, 6, 30, 6, 18, 12, 24, 18, 30, 6, 36, 0, 12, 3, 24, 12, 18, 18, 18, 12, 24, 0, 33, 12, 27, 6, 42, 0, 18, 6, 9, 15, 30, 6, 30, 6, 12, 6, 18, 6, 33, 15, 30, 0, 36, 3, 27, 21, 33, 24, 30, 9, 24, 0, 12, 18, 33, 6, 6, 0, 18, 3, 57, 12, 24, 18, 30, 9, 18, 0, 18, 12, 27, 12, 36, 0, 36, 6, 12, 6, 27, 12, 30, 9, 24, 6, 39, 18, 12, 24, 12, 0, 30, 0, 30, 6, 15, 15, 18, 3, 24, 18, 9, 12, 30, 9, 30, 0, 18, 6, 42, 18, 30, 0, 6, 10, 48, 0, 24, 12, 12, 18, 48, 0, 30, 3, 30, 15, 18, 6, 24, 18, 18, 0, 42, 6, 36, 15, 24, 0, 42, 12, 21, 24, 12, 12, 24, 0, 12, 6, 18, 18, 60, 6, 30, 0, 12, 0, 24, 0, 12, 18, 30, 15, 42, 0, 33, 30, 6, 6, 12, 0, 42, 3, 27, 6, 33, 12, 36, 12, 18, 0, 30, 6, 18, 12, 12, 0, 18, 6, 15, 27, 27, 6, 42, 6, 36, 9, 18, 30, 33, 9, 30, 0, 6, 6, 54, 6, 36, 24, 24, 0, 30, 3, 12, 6, 21, 24, 30, 0, 24, 0, 24, 12, 42, 9, 42, 21, 12, 12, 27, 12, 27, 6, 12, 0, 48, 6, 12, 18, 12, 12, 36, 6, 30, 0, 24, 0, 42, 12, 12, 0, 36, 0, 24, 15, 21, 21, 18, 6, 12, 9, 36, 18, 18, 15, 42, 0, 18, 6, 9, 18, 48, 12, 30, 9, 24, 3, 33, 6, 18, 18, 18, 0, 36, 3, 54, 24, 3, 12, 36, 9, 36, 6, 30, 12, 36, 12, 24, 0, 18, 6, 24, 6, 42, 0, 24, 18, 18, 0, 9, 30, 39, 12, 42, 0, 36, 0, 12, 12, 21, 12, 18, 12, 24, 6, 45, 6, 18, 24, 18, 0, 36, 0, 42, 15, 18, 6, 24, 6, 12, 12, 18, 12, 30, 6, 18, 0, 30, 1, 30, 9, 57, 9, 12, 9, 48, 6, 21, 24, 18, 12, 66, 0, 18, 6, 9, 24, 24, 24, 30, 12, 18, 0, 48, 6, 24, 18, 18, 0, 24, 3, 27, 18, 24, 12, 36, 6, 48, 6, 15, 18, 42, 6, 24, 0, 12, 12, 36, 6, 6, 24, 12, 3, 48, 0, 48, 18, 0, 12, 18, 0, 36, 6, 18, 9, 54, 15, 12, 12, 6, 6, 39, 6, 24, 18, 42, 0, 30, 0, 33, 18, 24, 18, 18, 9, 18, 0, 15, 18, 54, 0, 36, 0, 24, 0, 48, 24, 15, 18, 18, 12, 42, 9, 24, 12, 36, 21, 30, 0, 36, 12, 24, 3, 30, 0, 48, 15, 12, 6, 15, 18, 18, 18, 24, 0, 30, 0, 24, 24, 18, 9, 72, 0, 30, 6, 21, 18, 30, 6, 24, 0, 0, 6, 24, 18, 42, 12, 6, 15, 36, 0, 30, 18, 30, 12, 24, 0, 6, 0, 18, 12, 54, 9, 36, 9, 36, 9, 30, 6, 27, 27, 24, 0, 54, 6, 21, 18, 21, 6, 36, 15, 36, 3, 30, 12, 6, 18, 30, 0, 18, 6, 54, 0, 30, 21, 36, 9, 30, 6, 30, 24, 24, 6, 30, 0, 36, 12, 9, 24, 24, 12, 18, 9, 30, 0, 48, 12, 24, 12, 12, 0, 48, 0, 18, 12, 24, 24, 30, 6, 18, 12, 21, 12, 24, 0, 66, 0, 12, 0, 30, 9, 24, 24, 18, 13, 42, 3, 18, 18, 27, 24, 24, 0, 30, 6, 15, 18, 39, 12, 12, 9, 36, 12, 54, 12, 42, 18, 6, 0, 36, 0, 51, 18, 12, 0, 66, 12, 24, 0, 6, 24, 51, 12, 24, 0, 24, 0, 33, 6, 18, 18, 30, 6, 42, 3, 18, 30, 15, 15, 30, 0, 30, 6, 30, 12, 48, 12, 24, 12, 12, 9, 36, 6, 36, 6, 12, 0, 30, 0, 24, 21, 24, 15, 42, 12, 24, 6, 9, 18, 15, 9, 42, 0, 24, 12, 66, 12, 30, 24, 6, 9, 54, 0, 36, 12, 21, 12, 36, 0, 24, 3, 24, 15, 36, 6, 30, 24, 12, 6, 33, 6, 39, 21, 30, 0, 42, 6, 12, 30, 30, 18, 36, 0, 48, 3, 36, 12, 30, 18, 18, 0, 24, 0, 30, 6, 33, 21, 24, 6, 18, 12, 24, 12, 12, 15, 48, 0, 24, 6, 21, 21, 60, 6, 24, 12, 18, 0, 30, 12, 15, 12, 24, 0, 24, 3, 60, 27, 18, 12, 30, 3, 24, 9, 21, 12, 60, 18, 24, 0, 24, 9, 33, 6, 36, 12, 24, 15, 42, 6, 27, 36, 27, 6, 42, 0, 42, 6, 12, 15, 15, 24, 42, 18, 12, 0, 33, 6, 21, 18, 24, 0, 48, 3, 36, 9, 24, 24, 30, 6, 36, 0, 39, 18, 60, 6, 18, 0, 12, 6, 21, 27, 30, 0, 18, 6, 42, 6, 42, 18, 24, 9, 48, 0, 6, 6, 18, 18, 18, 6, 18, 15, 30, 4, 60, 12, 30, 30, 18, 0, 36, 0, 27, 18, 30, 18, 48, 9, 30, 12, 18, 6, 42, 9, 48, 0, 18, 6, 42, 6, 30, 24, 12, 3, 36, 0, 36, 36, 15, 18, 30, 0, 66, 0, 12, 18, 42, 9, 24, 15, 18, 12, 54, 6, 18, 21, 36, 0, 30, 6, 24, 24, 12, 6, 24, 9, 36, 12, 6, 12, 45, 12, 36, 0, 36, 0, 48, 3, 24, 18, 12, 24, 36, 0, 30, 12, 30, 21, 30, 0, 6, 15, 18, 15, 66, 12, 42, 3, 12, 0, 39, 12, 30, 12, 18, 0, 54, 6, 30, 24, 9, 12, 60, 12, 30, 12, 30, 24, 24, 18, 30, 0, 36, 0, 27, 9, 45, 18, 24, 12, 24, 0, 36, 24, 12, 6, 60, 0, 18, 0, 24, 15, 51, 9, 24, 12, 30, 12, 27, 18, 51, 18, 24, 0, 36, 6, 27, 27, 12, 30, 36, 6, 30, 0, 12, 6, 42, 0, 18, 0, 18, 0, 48, 12, 45, 24, 6, 15, 42, 6, 12, 18, 27, 9, 54, 0, 42, 3, 33, 12, 15, 12, 54, 18, 30, 6, 36, 18, 21, 30, 18, 0, 48, 3, 30, 18, 36, 6, 18, 0, 18, 12, 57, 24, 42, 6, 24, 0, 18, 12, 36, 18, 30, 12, 36, 3, 78, 0, 24, 6, 6, 36, 42, 0, 24, 0, 21, 15, 33, 6, 42, 18, 12, 3, 30, 12, 30, 27, 24, 0, 42, 12, 39, 12, 30, 12, 30, 15, 30, 6, 12, 24, 54, 6, 24, 0, 18, 6, 33, 12, 18, 24, 24, 7, 30, 0, 60, 24, 21, 12, 30, 0, 48, 6, 18, 15, 39, 12, 18, 18, 18, 0, 48, 12, 54, 18, 42, 0, 30, 0, 15, 30, 27, 18, 72, 0, 30, 15, 12, 12, 30, 18, 36, 0, 6, 3, 60, 15, 24, 18, 6, 18, 54, 6, 21, 24, 24, 12, 30, 0, 30, 6, 30, 15, 54, 6, 48, 12, 30, 12, 36, 0, 24, 3, 24, 0, 54, 6, 18, 30, 15, 6, 42, 9, 36, 0, 21, 30, 15, 12, 12, 0, 24, 3, 72, 0, 51, 39, 24, 12, 30, 3, 33, 18, 15, 12, 42, 0, 30, 12, 27, 24, 51, 12, 42, 12, 18, 3, 42, 12, 39, 18, 12, 0, 30, 0, 24, 21, 21, 21, 30, 6, 66, 12, 12, 6, 69, 21, 30, 0, 24, 6, 45, 12, 12, 18, 42, 12, 18, 0, 39, 30, 33, 12, 54, 0, 12, 0, 12, 18, 36, 9, 30, 9, 24, 9, 60, 12, 30, 12, 12, 0, 42, 9, 42, 18, 45, 24, 42, 6, 12, 9, 24, 6, 30, 12, 42, 0, 30, 6, 15, 15, 30, 12, 18, 12, 54, 6, 21, 30, 12, 33, 60, 0, 48, 0, 30, 15, 42, 6, 24, 24, 30, 0, 36, 18, 33, 18, 12, 0, 60, 0, 72, 15, 12, 9, 30, 12, 24, 15, 21, 24, 51, 12, 24, 0, 24, 6, 12, 6, 33, 24, 36, 9, 54, 6, 27, 24, 30, 6, 48, 0, 24, 3, 36, 27, 42, 15, 18, 18, 12, 6, 54, 6, 30, 15, 36, 0, 12, 12, 18, 24, 21, 18, 30, 3, 60, 0, 33, 12, 36, 18, 48, 0, 24, 1, 39, 12, 24, 18, 24, 9, 66, 6, 48, 24, 12, 12, 42, 0, 24, 6, 18, 12, 63, 6, 36, 24, 18, 0, 39, 12, 39, 24, 24, 0, 54, 6, 15, 24, 15, 24, 48, 3, 36, 12, 12, 24, 39, 18, 36, 0, 42, 6, 42, 6, 60, 24, 12, 18, 18, 0, 45, 6, 6, 6, 72, 0, 30, 6, 24, 9, 36, 12, 24, 9, 30, 15, 36, 18, 33, 24, 6, 0, 54, 0, 33, 36, 18, 24, 36, 6, 18, 6, 24, 18, 75, 6, 18, 0, 18, 0, 48, 9, 36, 18, 42, 9, 30, 0, 27, 36, 24, 15, 42, 0, 42, 18, 36, 12, 18, 12, 72, 9, 24, 0, 54, 18, 21, 24, 12, 0, 60, 0, 24, 24, 39, 12, 42, 18, 30, 6, 9, 12, 48, 12, 30, 0, 18, 12, 36, 15, 48, 18, 18, 3, 42, 6, 42, 18, 18, 24, 54, 0, 36, 0, 24, 36, 42, 0, 12, 27, 30, 6, 60, 6, 30, 24, 12, 0, 36, 3, 42, 12, 18, 12, 36, 9, 30, 0, 15, 18, 33, 12, 54, 0, 30, 6, 33, 21, 27, 30, 42, 12, 54, 9, 42, 24, 27, 6, 36, 0, 24, 12, 24, 12, 45, 24, 12, 6, 30, 12, 69, 12, 42, 12, 30, 0, 24, 0, 42, 18, 24, 15, 60, 9, 48, 18, 18, 24, 27, 12, 36, 0, 30, 0, 54, 9, 30, 18, 24, 15, 48, 0, 24, 24, 45, 24, 24, 0, 18, 6, 36, 9, 54, 15, 24, 12, 12, 6, 18, 12, 54, 18, 12, 0, 60, 3, 48, 30, 12, 18, 60, 6, 24, 3, 36, 12, 33, 12, 36, 0, 36, 6, 36, 3, 33, 24, 12, 13, 42, 12, 27, 18, 30, 12, 54, 0, 30, 12, 21, 39, 54, 6, 54, 18, 18, 0, 33, 12, 36, 36, 36, 0, 30, 0, 42, 33, 18, 18, 36, 12, 30, 3, 30, 12, 66, 6, 30, 0, 18, 12, 63, 18, 24, 6, 30, 12, 48, 9, 6, 24, 30, 12, 42, 0, 72, 0, 30, 12, 48, 3, 24, 15, 12, 12, 66, 18, 9, 36, 12, 0, 54, 0, 54, 18, 15, 30, 36, 6, 12, 0, 21, 18, 54, 12, 30, 0, 6, 0, 36, 15, 60, 18, 18, 15, 48, 6, 27, 24, 21, 12, 54, 0, 54, 9, 12, 24, 48, 12, 48, 15, 54, 6, 36, 6, 39, 24, 24, 0, 24, 3, 33, 24, 18, 18, 66, 12, 18, 12, 30, 12, 75, 15, 36, 0, 30, 9, 24, 6, 21, 24, 24, 12, 60, 0, 66, 36, 12, 18, 36, 0, 24, 6, 30, 18, 39, 18, 30, 12, 24, 9, 30, 6, 36, 18, 18, 0, 54, 12, 33, 24, 36, 6, 66, 0, 30, 6, 12, 12, 33, 24, 54, 0, 18, 3, 60, 3, 30, 24, 24, 21, 48, 0, 18, 30, 51, 12, 18, 0, 30, 12, 33, 15, 18, 12, 30, 27, 24, 0, 48, 12, 45, 6, 30, 0, 72, 0, 51, 18, 27, 27, 54, 9, 48, 12, 27, 30, 36, 18, 18, 0, 42, 3, 36, 9, 45, 30, 6, 6, 36, 3, 51, 24, 24, 18, 72, 0, 18, 6, 9, 36, 42, 0, 36, 9, 30, 12, 60, 30, 24, 15, 24, 0, 36, 6, 30, 27, 27, 18, 42, 12, 48, 0, 42, 0, 33, 24, 24, 0, 30, 0, 42, 12, 48, 9, 36, 9, 24, 6, 27, 36, 12, 9, 60, 0, 30, 12, 15, 18, 42, 18, 36, 18, 24, 7, 48, 12, 54, 24, 30, 0, 78, 0, 18, 18, 27, 24, 24, 6, 30, 12, 33, 18, 60, 15, 54, 0, 12, 12, 36, 12, 36, 24, 30, 18, 54, 0, 18, 18, 18, 24, 84, 0, 54, 0, 27, 15, 42, 6, 36, 12, 18, 9, 54, 6, 30, 30, 24, 0, 30, 9, 60, 30, 36, 6, 42, 12, 30, 6, 6, 30, 60, 0, 18, 0, 24, 9, 51, 18, 24, 33, 30, 0, 42, 12, 60, 18, 18, 36, 18, 0, 24, 0, 18, 9, 78, 12, 48, 24, 12, 0, 48, 6, 12, 18, 42, 0, 48, 0, 30, 27, 18, 6, 48, 3, 66, 21, 18, 18, 33, 12, 48, 0, 30, 6, 63, 21, 18, 36, 24, 15, 60, 6, 36, 30, 36, 0, 48, 0, 48, 3, 36, 30, 42, 18, 24, 24, 12, 6, 21, 6, 72, 12, 36, 0, 60, 6, 12, 18, 15, 24, 60, 9, 30, 0, 39, 30, 54, 12, 18, 0, 18, 3, 60, 9, 57, 24, 6, 18, 48, 6, 60, 18, 18, 9, 48, 0, 24, 12, 18, 18, 39, 6, 42, 15, 36, 6, 36, 18, 18, 30, 18, 0, 42, 6, 39, 27, 27, 18, 48, 12, 42, 12, 24, 18, 27, 9, 30, 0, 24, 9, 81, 12, 72, 12, 30, 6, 36, 0, 33, 42, 39, 30, 42, 0, 12, 3, 12, 6, 24, 18, 48, 12, 48, 3, 63, 24, 24, 27, 30, 0, 78, 6, 36, 18, 36, 30, 30, 12, 36, 12, 30, 6, 60, 12, 48, 0, 24, 0, 36, 21, 30, 24, 30, 12, 48, 0, 36, 12, 24, 27, 36, 0, 42, 12, 27, 24, 54, 6, 18, 12, 48, 0, 30, 6, 72, 24, 12, 0, 30, 3, 45, 24, 0, 18, 78, 15, 18, 18, 39, 18, 39, 9, 36, 0, 24, 6, 39, 12, 30, 18, 30, 16, 48, 0, 36, 30, 12, 12, 60, 0, 42, 3, 24, 21, 84, 33, 30, 12, 18, 18, 48, 12, 36, 12, 30, 0, 48, 9, 42, 36, 42, 6, 48, 3, 42, 0, 33, 24, 30, 12, 36, 0, 36, 6, 54, 12, 30, 30, 6, 21, 66, 0, 39, 24, 36, 24, 36, 0, 24, 12, 30, 15, 54, 12, 78, 30, 6, 0, 33, 12, 27, 30, 30, 0, 36, 6, 18, 36, 36, 6, 66, 3, 60, 6, 18, 30, 42, 0, 12, 0, 36, 6, 54, 6, 33, 24, 24, 12, 54, 0, 42, 12, 15, 12, 60, 0, 30, 0, 21, 18, 75, 18, 48, 18, 18, 15, 30, 24, 42, 33, 36, 0, 30, 6, 45, 24, 9, 30, 36, 3, 54, 15, 24, 18, 63, 18, 42, 0, 24, 0, 75, 6, 30, 9, 30, 15, 42, 12, 33, 36, 21, 24, 60, 0, 54, 9, 30, 30, 48, 12, 18, 12, 24, 0, 66, 12, 24, 18, 36, 0, 72, 6, 36, 15, 27, 27, 30, 6, 12, 18, 24, 6, 78, 15, 42, 0, 12, 6, 27, 24, 51, 18, 36, 12, 60, 3, 51, 30, 12, 24, 36, 0, 30, 0, 48, 12, 21, 6, 36, 24, 54, 6, 42, 6, 36, 36, 6, 0, 54, 12, 27, 15, 18, 18, 66, 6, 42, 0, 15, 30, 63, 12, 48, 0, 36, 3, 63, 12, 36, 30, 18, 9, 48, 3, 48, 36, 30, 12, 42, 0, 72, 6, 36, 30, 30, 12, 24, 12, 6, 15, 75, 18, 30, 6, 36, 0, 24, 0, 18, 36, 48, 18, 60, 18, 60, 12, 33, 12, 33, 15, 72, 0, 18, 9, 54, 15, 21, 30, 36, 12, 30, 0, 42, 24, 48, 18, 36, 0, 24, 6, 18, 15, 81, 12, 12, 27, 36, 12, 30, 6, 36, 18, 24, 0, 48, 6, 36, 36, 27, 6, 48, 9, 36, 3, 36, 36, 36, 24, 30, 0, 24, 1, 42, 6, 66, 27, 24, 18, 48, 12, 51, 18, 24, 18, 84, 0, 24, 6, 12, 9, 63, 18, 48, 9, 30, 0, 36, 12, 33, 24, 30, 0, 72, 0, 42, 48, 36, 18, 42, 12, 42, 15, 24, 12, 60, 15, 24, 0, 12, 21, 72, 3, 42, 30, 24, 18, 36, 6, 42, 18, 30, 12, 42, 0, 48, 12, 12, 24, 24, 18, 66, 6, 24, 0, 93, 12, 51, 30, 12, 0, 54, 6, 18, 27, 24, 24, 36, 12, 30, 0, 45, 18, 60, 6, 54, 0, 24, 0, 51, 24, 21, 18, 30, 6, 72, 6, 6, 18, 21, 36, 42, 0, 48, 12, 27, 24, 36, 6, 30, 27, 30, 6, 39, 18, 51, 36, 30, 0, 42, 0, 66, 18, 36, 6, 66, 9, 24, 12, 24, 24, 78, 12, 36, 0, 36, 12, 60, 15, 42, 24, 6, 15, 54, 0, 33, 30, 21, 30, 42, 0, 54, 0, 24, 9, 60, 9, 36, 24, 24, 6, 66, 12, 48, 18, 54, 0, 30, 0, 30, 39, 30, 18, 48, 6, 42, 12, 33, 24, 33, 12, 60, 0, 18, 6, 42, 24, 42, 24, 6, 12, 72, 6, 42, 30, 18, 9, 30, 0, 24, 15, 30, 18, 60, 12, 54, 15, 24, 0, 48, 24, 33, 12, 36, 0, 66, 6, 36, 18, 21, 30, 72, 3, 24, 9, 27, 30, 30, 18, 42, 0, 42, 0, 72, 6, 39, 42, 24, 18, 60, 3, 24, 18, 36, 18, 30, 0, 54, 6, 27, 33, 60, 12, 24, 24, 18, 18, 30, 12, 21, 33, 48, 0, 78, 12, 78, 12, 30, 12, 42, 12, 48, 0, 24, 12, 75, 18, 24, 0, 18, 0, 33, 24, 30, 21, 42, 15, 30, 12, 39, 30, 51, 12, 54, 0, 36, 12, 18, 12, 48, 24, 78, 18, 18, 6, 78, 6, 24, 30, 12, 0, 42, 0, 45, 18, 15, 27, 42, 0, 54, 18, 36, 18, 36, 6, 48, 0, 30, 12, 36, 21, 45, 6, 24, 7, 54, 0, 27, 42, 33, 24, 72, 0, 42, 0, 48, 24, 45, 18, 18, 15, 36, 15, 66, 6, 66, 30, 18, 0, 48, 0, 27, 39, 30, 18, 66, 27, 12, 12, 18, 24, 60, 6, 66, 0, 42, 0, 42, 6, 33, 21, 36, 12, 42, 6, 21, 36, 33, 21, 48, 0, 66, 12, 6, 18, 75, 24, 36, 12, 18, 0, 81, 12, 42, 30, 36, 0, 24, 0, 30, 30, 30, 6, 60, 9, 60, 6, 24, 30, 30, 6, 30, 0, 30, 12, 75, 18, 30, 24, 24, 15, 78, 0, 42, 24, 18, 30, 42, 0, 30, 12, 21, 12, 48, 9, 60, 21, 30, 12, 24, 24, 39, 21, 24, 0, 54, 3, 39, 30, 33, 24, 72, 12, 60, 0, 18, 24, 57, 12, 24, 0, 24, 3, 90, 9, 12, 21, 36, 12, 30, 18, 84, 24, 30, 9, 60, 0, 36, 18, 18, 24, 78, 18, 24, 18, 48, 6, 24, 0, 45, 30, 24, 0, 66, 3, 60, 36, 21, 42, 42, 6, 30, 6, 33, 12, 60, 21, 36, 0, 6, 6, 36, 15, 36, 30, 48, 21, 48, 0, 39, 36, 36, 6, 54, 0, 66, 3, 18, 18, 33, 24, 36, 18, 30, 9, 66, 6, 15, 36, 24, 0, 96, 6, 30, 12, 42, 6, 36, 6, 36, 9, 27, 36, 42, 12, 42, 0, 18, 6, 51, 12, 78, 18, 30, 9, 54, 12, 39, 24, 24, 33, 66, 0, 36, 9, 45, 33, 36, 12, 18, 27, 36, 0, 78, 12, 48, 24, 30, 0, 42, 9, 48, 21, 18, 9, 60, 12, 54, 6, 21, 24, 72, 3, 66, 0, 18, 18, 33, 12, 21, 36, 36, 6, 36, 6, 60, 36, 36, 18, 48, 0, 24, 0, 30, 24, 87, 24, 24, 27, 42, 6, 60, 18, 66, 6, 18, 0, 36, 6, 39, 36, 30, 18, 36, 9, 30, 0, 18, 18, 51, 12, 48, 0, 54, 0, 48, 18, 36, 30, 36, 30, 66, 3, 12, 18, 15, 39, 60, 0, 24, 12, 66, 6, 54, 12, 48, 6, 18, 7, 30, 24, 48, 18, 30, 0, 84, 0, 30, 48, 12, 15, 60, 9, 42, 18, 42, 18, 42, 18, 48, 0, 30, 9, 48, 21, 69, 36, 12, 12, 48, 0, 57, 18, 24, 24, 66, 0, 36, 6, 24, 21, 69, 6, 54, 12, 30, 18, 72, 18, 30, 30, 18, 0, 42, 0, 42, 42, 12, 18, 42, 6, 54, 9, 42, 12, 72, 18, 24, 0, 24, 3, 78, 0, 24, 24, 30, 15, 60, 6, 42, 30, 39, 21, 36, 0, 54, 12, 27, 24, 42, 24, 72, 21, 30, 0, 48, 18, 24, 30, 12, 0, 30, 3, 24, 15, 72, 33, 42, 6, 24, 24, 12, 24, 66, 12, 60, 0, 24, 6, 63, 12, 42, 18, 24, 18, 84, 6, 30, 24, 24, 6, 90, 0, 72, 6, 21, 24, 30, 18, 18, 30, 24, 6, 66, 18, 54, 18, 36, 0, 36, 12, 60, 27, 30, 18, 90, 18, 18, 0, 18, 24, 48, 24, 30, 0, 36, 6, 36, 18, 66, 36, 30, 3, 66, 3, 57, 48, 12, 18, 36, 0, 48, 6, 36, 21, 48, 0, 60, 12, 36, 12, 72, 0, 36, 30, 30, 0, 48, 0, 33, 30, 48, 9, 54, 9, 36, 24, 18, 30, 42, 18, 54, 0, 12, 0, 54, 12, 21, 24, 30, 21, 72, 0, 66, 24, 27, 18, 36, 0, 24, 0, 45, 24, 78, 0, 42, 21, 24, 12, 39, 30, 54, 30, 24, 0, 84, 15, 24, 24, 9, 30, 54, 9, 48, 6, 33, 18, 57, 18, 30, 0, 60, 3, 54, 27, 33, 30, 36, 24, 42, 0, 54, 18, 39, 24, 54, 0, 60, 18, 24, 15, 75, 12, 24, 12, 42, 0, 39, 12, 36, 36, 36, 0, 30, 3, 66, 42, 15, 24, 72, 12, 48, 12, 42, 12, 48, 15, 24, 0, 18, 18, 60, 6, 60, 18, 36, 9, 24, 6, 27, 36, 30, 24, 90, 0, 60, 3, 21, 18, 54, 24, 48, 18, 18, 12, 51, 24, 39, 18, 18, 0, 72, 12, 42, 21, 36, 24, 36, 6, 36, 0, 33, 18, 42, 0, 60, 0, 18, 6, 42, 21, 39, 39, 36, 13, 84, 6, 24, 18, 30, 24, 78, 0, 36, 3, 54, 39, 51, 18, 30, 21, 24, 3, 60, 12, 87, 42, 30, 0, 36, 6, 30, 15, 36, 12, 54, 18, 42, 12, 27, 24, 84, 15, 42, 0, 18, 9, 54, 18, 30, 30, 48, 12, 72, 0, 54, 42, 9, 12, 36, 0, 60, 0, 27, 21, 78, 18, 42, 30, 30, 6, 54, 6, 30, 18, 24, 0, 60, 12, 42, 36, 48, 24, 54, 6, 36, 15, 12, 48, 21, 12, 30, 0, 36, 0, 102, 6, 18, 12, 24, 9, 60, 12, 48, 24, 33, 30, 66, 0, 30, 12, 30, 15, 60, 12, 54, 36, 30, 0, 36, 6, 72, 18, 36, 0, 54, 0, 30, 36, 9, 15, 60, 0, 60, 15, 39, 12, 63, 18, 42, 0, 30, 18, 60, 21, 57, 30, 0, 18, 54, 3, 75, 30, 48, 24, 42, 0, 24, 12, 36, 42, 57, 9, 48, 9, 36, 6, 45, 12, 24, 48, 54, 0, 66, 0, 45, 33, 30, 18, 54, 18, 36, 0, 36, 6, 54, 30, 54, 0, 36, 0, 66, 12, 42, 21, 24, 18, 48, 6, 21, 48, 42, 12, 60, 0, 84, 12, 0, 12, 54, 24, 36, 18, 18, 12, 81, 18, 33, 18, 12, 0, 66, 3, 66, 6, 33, 48, 48, 6, 24, 24, 36, 18, 60, 6, 36, 0, 24, 6, 39, 21, 42, 18, 42, 12, 60, 0, 24, 30, 33, 36, 72, 0, 30, 0, 36, 36, 42, 12, 36, 15, 24, 15, 75, 30, 63, 27, 24, 0, 42, 6, 63, 30, 18, 12, 108, 9, 48, 12, 24, 12, 72, 18, 30, 0, 54, 6, 30, 9, 63, 27, 48, 15, 36, 6, 48, 36, 18, 12, 54, 0, 42, 9, 36, 36, 63, 18, 36, 24, 36, 0, 75, 6, 63, 24, 36, 0, 48, 6, 27, 39, 30, 18, 30, 9, 54, 18, 36, 18, 39, 21, 66, 0, 30, 0, 54, 18, 42, 36, 12, 24, 108, 0, 30, 24, 42, 12, 48, 0, 24, 0, 15, 9, 48, 18, 66, 24, 24, 12, 54, 12, 36, 21, 54, 0, 54, 18, 45, 42, 36, 24, 42, 3, 36, 0, 42, 48, 42, 12, 36, 0, 36, 1, 60, 18, 36, 18, 36, 15, 54, 9, 60, 30, 24, 21, 48, 0, 24, 18, 24, 18, 90, 6, 72, 15, 36, 9, 48, 6, 36, 42, 48, 0, 78, 3, 54, 27, 18, 36, 48, 15, 54, 12, 30, 24, 84, 12, 18, 0, 18, 12, 105, 12, 24, 30, 30, 18, 36, 0, 60, 30, 27, 12, 48, 0, 90, 6, 18, 18, 33, 21, 42, 24, 24, 12, 45, 24, 60, 36, 36, 0, 66, 6, 27, 15, 42, 24, 60, 12, 18, 9, 30, 18, 84, 12, 72, 0, 12, 6, 42, 21, 45, 12, 18, 9, 96, 12, 21, 30, 30, 24, 66, 0, 48, 12, 42, 18, 36, 18, 24, 24, 24, 0, 30, 12, 27, 42, 18, 0, 72, 0, 84, 27, 54, 15, 102, 12, 36, 6, 39, 36, 36, 15, 36, 0, 30, 15, 57, 12, 57, 42, 30, 9, 60, 6, 27, 42, 27, 30, 36, 0, 54, 6, 24, 21, 78, 12, 42, 18, 18, 12, 84, 18, 54, 18, 48, 0, 66, 12, 15, 36, 30, 18, 72, 9, 66, 0, 27, 18, 24, 6, 78, 0, 42, 6, 81, 27, 27, 36, 24, 24, 48, 0, 72, 18, 39, 30, 42, 0, 18, 18, 30, 24, 78, 6, 18, 18, 36, 0, 48, 30, 84, 6, 18, 0, 54, 0, 42, 36, 12, 30, 90, 12, 48, 18, 24, 18, 21, 18, 48, 0, 60, 0, 60, 6, 30, 42, 24, 18, 66, 0, 27, 36, 24, 18, 54, 0, 48, 6, 30, 18, 90, 15, 42, 9, 48, 18, 42, 6, 45, 24, 36, 0, 48, 0, 78, 39, 27, 12, 42, 27, 48, 6, 45, 18, 72, 36, 48, 0, 18, 9, 66, 9, 54, 33, 18, 18, 66, 12, 39, 36, 45, 12, 72, 0, 48, 12, 21, 39, 33, 18, 60, 18, 36, 0, 78, 18, 39, 36, 24, 0, 30, 0, 30, 30, 54, 21, 66, 6, 30, 21, 39, 18, 60, 15, 72, 0, 30, 18, 45, 12, 39, 18, 60, 6, 66, 15, 36, 30, 12, 18, 60, 0, 60, 0, 18, 33, 57, 18, 24, 24, 42, 6, 66, 12, 81, 42, 18, 0, 36, 6, 42, 18, 24, 24, 72, 0, 18, 0, 30, 30, 87, 18, 36, 0, 42, 3, 45, 12, 36, 42, 24, 25, 30, 6, 72, 24, 18, 18, 60, 0, 102, 12, 42, 12, 90, 12, 24, 27, 24, 12, 69, 24, 30, 18, 42, 0, 48, 0, 42, 45, 39, 15, 60, 18, 30, 12, 33, 24, 72, 18, 36, 0, 24, 12, 51, 24, 39, 36, 24, 6, 120, 0, 72, 24, 30, 30, 30, 0, 24, 12, 72, 18, 54, 3, 84, 30, 30, 21, 42, 24, 30, 18, 30, 0, 54, 0, 36, 30, 24, 30, 72, 9, 72, 6, 30, 24, 36, 24, 30, 0, 30, 0, 90, 12, 48, 27, 24, 6, 54, 12, 39, 36, 18, 18, 78, 0, 36, 12, 18, 39, 66, 6, 54, 18, 36, 0, 54, 18, 42, 12, 30, 0, 78, 0, 48, 45, 27, 36, 36, 9, 54, 15, 6, 12, 99, 15, 48, 0, 24, 3, 60, 12, 45, 36, 36, 30, 24, 12, 57, 30, 42, 18, 54, 0, 36, 6, 45, 24, 63, 30, 60, 12, 42, 6, 102, 18, 30, 33, 18, 0, 84, 12, 54, 24, 39, 12, 42, 0, 36, 0, 54, 24, 60, 12, 42, 0, 48, 6, 30, 9, 93, 24, 18, 21, 60, 6, 21, 36, 18, 54, 102, 0, 30, 18, 36, 21, 48, 12, 30, 27, 42, 3, 54, 12, 66, 36, 36, 0, 48, 9, 45, 33, 30, 9, 84, 18, 30, 12, 33, 36, 51, 12, 54, 0, 36, 18, 42, 12, 30, 36, 24, 9, 72, 0, 48, 30, 36, 6, 78, 0, 42, 0, 18, 24, 63, 21, 36, 18, 24, 15, 66, 0, 42, 27, 54, 0, 30, 9, 51, 45, 45, 24, 48, 12, 72, 12, 33, 24, 39, 30, 66, 0, 18, 6, 69, 12, 36, 24, 36, 18, 90, 6, 60, 24, 36, 27, 36, 0, 60, 18, 33, 21, 84, 12, 36, 30, 18, 0, 33, 24, 51, 30, 24, 0, 84, 0, 57, 33, 36, 21, 84, 12, 30, 12, 33, 36, 63, 18, 24, 0, 30, 6, 90, 21, 66, 30, 30, 24, 36, 0, 54, 12, 51, 18, 78, 0, 36, 0, 18, 18, 54, 21, 48, 12, 66, 18, 21, 18, 33, 21, 42, 0, 66, 6, 48, 54, 21, 30, 66, 12, 66, 0, 24, 24, 63, 24, 36, 0, 42, 3, 60, 18, 30, 6, 36, 9, 54, 6, 72, 48, 36, 15, 54, 0, 30, 27, 12, 18, 60, 12, 66, 15, 48, 10, 84, 12, 39, 42, 12, 0, 66, 6, 24, 18, 21, 36, 54, 24, 24, 12, 51, 18, 66, 12, 90, 0, 18, 6, 87, 15, 75, 24, 30, 15, 60, 0, 24, 42, 24, 24, 48, 0, 84, 6, 51, 39, 60, 12, 18, 30, 36, 12, 60, 12, 60, 48, 36, 0, 54, 6, 42, 12, 6, 18, 78, 6, 48, 12, 12, 36, 84, 0, 48, 0, 54, 3, 48, 18, 45, 51, 54, 6, 72, 6, 51, 30, 45, 30, 48, 0, 36, 6, 36, 15, 78, 24, 42, 24, 24, 0, 90, 18, 36, 24, 24, 0, 36, 0, 36, 30, 30, 30, 66, 6, 78, 21, 30, 12, 21, 15, 60, 0, 36, 12, 66, 21, 36, 24, 30, 18, 60, 9, 54, 48, 24, 18, 48, 0, 30, 6, 42, 18, 81, 18, 54, 27, 24, 12, 30, 18, 84, 30, 24, 0, 102, 9, 42, 42, 36, 24, 90, 3, 30, 0, 60, 30, 42, 18, 24, 0, 18, 0, 78, 12, 42, 27, 42, 18, 66, 18, 45, 18, 42, 9, 84, 0, 54, 6, 15, 54, 63, 18, 54, 24, 24, 9, 57, 24, 45, 54, 36, 0, 60, 0, 66, 27, 33, 18, 30, 9, 60, 24, 30, 12, 54, 21, 24, 0, 12, 18, 108, 15, 66, 12, 30, 27, 66, 0, 36, 30, 36, 24, 66, 0, 60, 0, 9, 24, 54, 12, 90, 15, 42, 0, 51, 30, 18, 30, 48, 0, 84, 9, 48, 21, 54, 30, 24, 18, 36, 12, 45, 18, 96, 6, 30, 0, 30, 9, 30, 24, 42, 24, 24, 15, 66, 6, 69, 36, 15, 15, 84, 0, 36, 15, 48, 27, 45, 18, 42, 30, 36, 0, 66, 6, 72, 30, 48, 0, 42, 3, 51, 39, 30, 33, 78, 12, 24, 18, 30, 18, 105, 21, 72, 0, 42, 12, 39, 18, 27, 42, 24, 6, 66, 3, 60, 42, 30, 30, 60, 0, 54, 6, 54, 24, 57, 6, 54, 6, 24, 24, 54, 12, 57, 27, 42, 0, 48, 6, 36, 27, 57, 12, 84, 12, 60, 0, 12, 30, 54, 24, 48, 0, 18, 3, 105, 36, 48, 42, 24, 18, 48, 6, 30, 36, 45, 42, 42, 0, 54, 9, 36, 12, 48, 12, 54, 30, 30, 6, 48, 6, 51, 18, 36, 0, 102, 6, 18, 30, 33, 24, 48, 18, 60, 12, 60, 30, 45, 12, 36, 0, 54, 12, 60, 6, 48, 54, 12, 13, 60, 0, 72, 18, 24, 6, 90, 0, 48, 12, 15, 42, 96, 18, 36, 18, 36, 6, 78, 24, 48, 18, 30, 0, 48, 18, 78, 42, 24, 30, 60, 6, 60, 12, 18, 12, 42, 30, 42, 0, 24, 0, 81, 9, 54, 18, 60, 33, 48, 0, 27, 54, 51, 27, 90, 0, 60, 18, 24, 18, 54, 24, 36, 12, 42, 0, 87, 24, 33, 18, 24, 0, 96, 0, 87, 36, 30, 15, 42, 12, 36, 24, 24, 36, 42, 21, 48, 0, 30, 6, 42, 18, 48, 24, 24, 18, 84, 3, 36, 42, 42, 36, 72, 0, 54, 6, 30, 15, 60, 6, 78, 30, 24, 6, 72, 6, 66, 45, 24, 0, 42, 21, 36, 30, 36, 18, 48, 12, 30, 0, 39, 24, 102, 18, 36, 0, 12, 6, 54, 6, 30, 33, 66, 21, 90, 3, 78, 36, 9, 18, 36, 0, 84, 0, 30, 30, 93, 24, 30, 24, 30, 15, 63, 12, 48, 30, 54, 0, 48, 0, 54, 42, 42, 30, 78, 0, 36, 24, 39, 24, 60, 12, 78, 0, 60, 6, 51, 30, 36, 36, 30, 18, 60, 0, 30, 30, 51, 24, 60, 0, 42, 3, 24, 9, 54, 21, 24, 33, 30, 24, 66, 24, 69, 18, 30, 0, 102, 15, 54, 24, 15, 30, 120, 6, 30, 3, 51, 24, 54, 12, 30, 0, 36, 6, 36, 12, 90, 42, 12, 12, 60, 12, 60, 24, 42, 12, 90, 0, 24, 12, 42, 30, 30, 6, 78, 21, 42, 0, 54, 24, 27, 54, 24, 0, 66, 6, 45, 30, 12, 30, 42, 12, 84, 15, 36, 18, 84, 24, 36, 0, 30, 18, 72, 18, 60, 24, 48, 12, 54, 6, 36, 54, 42, 12, 42, 0, 60, 0, 51, 48, 54, 9, 36, 27, 24, 6, 84, 18, 48, 30, 42, 0, 78, 0, 48, 27, 27, 48, 42, 18, 36, 0, 39, 18, 99, 24, 102, 0, 18, 0, 48, 18, 72, 15, 36, 12, 84, 12, 24, 12, 30, 39, 84, 0, 36, 12, 39, 39, 63, 24, 42, 24, 66, 6, 72, 18, 18, 24, 30, 0, 60, 6, 48, 42, 36, 15, 78, 6, 48, 30, 12, 36, 54, 12, 36, 0, 42, 6, 45, 6, 69, 24, 72, 21, 48, 0, 57, 48, 12, 24, 48, 0, 48, 3, 48, 15, 78, 24, 60, 18, 12, 12, 111, 24, 54, 24, 24, 0, 48, 6, 36, 33, 42, 6, 54, 9, 72, 18, 27, 30, 30, 12, 54, 0, 66, 4, 78, 21, 24, 54, 18, 24, 54, 6, 60, 24, 54, 21, 78, 0, 36, 18, 54, 30, 66, 18, 48, 30, 24, 0, 42, 12, 99, 36, 30, 0, 90, 6, 18, 30, 30, 24, 78, 6, 66, 9, 24, 42, 78, 30, 42, 0, 18, 12, 102, 6, 33, 24, 18, 12, 66, 9, 54, 24, 24, 36, 84, 0, 60, 6, 39, 15, 78, 12, 42, 21, 42, 18, 42, 18, 18, 42, 24, 0, 48, 3, 105, 51, 42, 30, 42, 18, 72, 0, 24, 24, 102, 6, 36, 0, 36, 9, 99, 12, 48, 21, 48, 18, 42, 6, 36, 42, 18, 12, 78, 0, 48, 30, 30, 18, 36, 30, 42, 9, 42, 6, 60, 12, 39, 30, 24, 0, 78, 0, 48, 30, 39, 27, 102, 24, 30, 12, 51, 12, 66, 9, 48, 0, 30, 18, 45, 39, 87, 30, 36, 9, 72, 0, 60, 24, 30, 36, 54, 0, 48, 0, 45, 36, 45, 18, 42, 27, 60, 9, 66, 12, 78, 42, 18, 0, 60, 6, 60, 33, 36, 24, 96, 12, 18, 12, 12, 36, 72, 0, 78, 0, 36, 6, 60, 24, 27, 51, 42, 24, 84, 12, 57, 48, 30, 24, 42, 0, 60, 12, 24, 18, 96, 12, 30, 30, 30, 0, 93, 18, 48, 18, 60, 0, 48, 6, 54, 36, 30, 12, 42, 9, 60, 18, 12, 24, 69, 6, 60, 0, 54, 6, 33, 15, 60, 36, 30, 18, 90, 3, 72, 24, 54, 54, 42, 0, 18, 9, 60, 30, 84, 18, 48, 24, 12, 6, 66, 36, 24, 27, 24, 0, 42, 12, 39, 42, 27, 18, 108, 9, 78, 0, 48, 12, 54, 30, 30, 0, 36, 0, 48, 12, 75, 39, 30, 6, 42, 9, 66, 30, 33, 18, 96, 0, 48, 18, 39, 36, 102, 12, 54, 18, 24, 9, 45, 24, 72, 30, 36, 0, 78, 6, 63, 36, 36, 21, 60, 9, 36, 12, 54, 24, 78, 27, 42, 0, 42, 18, 60, 9, 24, 24, 54, 39, 84, 0, 27, 36, 39, 12, 84, 0, 66, 0, 21, 30, 30, 42, 66, 18, 18, 18, 78, 12, 48, 42, 36, 0, 90, 6, 48, 33, 39, 24, 48, 15, 54, 15, 54, 24, 48, 18, 60, 0, 24, 0, 48, 24, 78, 24, 36, 9, 90, 12, 42, 24, 30, 45, 54, 0, 66, 12, 24, 12, 60, 6, 48, 33, 48, 0, 60, 6, 51, 54, 12, 0, 30, 0, 69, 21, 42, 15, 72, 15, 48, 21, 33, 36, 96, 6, 30, 0, 54, 6, 87, 30, 42, 30, 36, 13, 42, 6, 84, 48, 18, 18, 72, 0, 54, 12, 30, 30, 75, 24, 36, 24, 42, 18, 78, 12, 36, 30, 72, 0, 48, 6, 33, 36, 57, 36, 66, 6, 54, 0, 27, 36, 66, 12, 90, 0, 24, 3, 96, 24, 27, 24, 18, 24, 108, 12, 42, 48, 24, 18, 30, 0, 54, 18, 48, 12, 75, 18, 90, 21, 36, 12, 72, 12, 45, 24, 24, 0, 114, 0, 27, 30, 39, 33, 48, 12, 54, 12, 18, 42, 45, 27, 48, 0, 48, 6, 90, 9, 60, 42, 36, 12, 48, 0, 36, 42, 42, 18, 78, 0, 30, 6, 24, 33, 78, 9, 84, 30, 18, 15, 63, 18, 51, 30, 48, 0, 72, 6, 36, 51, 24, 30, 48, 21, 96, 6, 24, 6, 93, 12, 48, 0, 18, 6, 69, 18, 36, 18, 24, 18, 24, 6, 54, 36, 51, 33, 96, 0, 36, 15, 27, 30, 54, 30, 42, 12, 36, 0, 117, 36, 54, 36, 24, 0, 96, 3, 72, 36, 57, 27, 54, 6, 54, 21, 36, 12, 66, 33, 60, 0, 30, 24, 24, 15, 63, 30, 42, 24, 78, 9, 39, 30, 24, 24, 138, 0, 42, 0, 54, 24, 57, 12, 30, 24, 42, 18, 54, 6, 60, 33, 24, 0, 72, 6, 84, 24, 42, 6, 66, 15, 36, 0, 42, 48, 51, 18, 66, 0, 60, 3, 60, 12, 60, 57, 42, 9, 72, 12, 60, 42, 27, 24, 60, 0, 42, 18, 24, 30, 48, 30, 36, 18, 30, 9, 78, 12, 51, 18, 30, 0, 60, 0, 12, 57, 51, 18, 78, 6, 102, 12, 30, 24, 48, 27, 36, 0, 30, 12, 126, 6, 27, 36, 30, 18, 66, 0, 60, 30, 48, 36, 48, 0, 24, 6, 39, 24, 96, 12, 90, 33, 36, 6, 39, 6, 90, 27, 36, 0, 60, 12, 45, 42, 30, 30, 72, 12, 36, 9, 39, 36, 69, 24, 48, 0, 36, 6, 66, 15, 72, 39, 36, 27, 54, 18, 57, 30, 42, 12, 60, 0, 84, 24, 36, 27, 72, 12, 48, 21, 60, 0, 51, 30, 27, 30, 90, 0, 78, 0, 42, 57, 12, 30, 48, 18, 42, 6, 48, 24, 90, 15, 42, 0, 12, 15, 84, 24, 72, 18, 48, 21, 66, 3, 54, 42, 30, 24, 48, 0, 36, 18, 27, 12, 42, 9, 108, 18, 36, 12, 96, 24, 21, 30, 24, 0, 96, 9, 54, 18, 75, 30, 54, 18, 36, 0, 39, 18, 84, 18, 42, 0, 24, 6, 54, 18, 57, 42, 24, 9, 84, 18, 48, 42, 27, 30, 78, 0, 60, 0, 30, 48, 36, 6, 30, 36, 6, 10, 78, 12, 51, 48, 48, 0, 90, 0, 75, 9, 42, 24, 48, 15, 72, 12, 33, 42, 108, 12, 54, 0, 54, 18, 51, 42, 36, 48, 48, 12, 72, 0, 42, 18, 45, 30, 66, 0, 78, 3, 36, 15, 78, 30, 30, 30, 30, 15, 102, 12, 54, 18, 30, 0, 36, 6, 81, 48, 12, 24, 108, 6, 78, 18, 24, 36, 33, 18, 30, 0, 30, 0, 108, 21, 54, 42, 18, 18, 90, 6, 30, 48, 69, 36, 48, 0, 24, 15, 24, 15, 84, 24, 114, 6, 30, 0, 48, 6, 60, 42, 24, 0, 102, 12, 42, 42, 27, 21, 78, 9, 42, 24, 51, 24, 42, 12, 48, 0, 60, 12, 66, 6, 42, 24, 30, 24, 42, 0, 78, 24, 54, 12, 66, 0, 30, 6, 24, 51, 99, 18, 60, 24, 42, 18, 54, 6, 45, 60, 36, 0, 54, 6, 39, 39, 39, 30, 66, 18, 72, 0, 51, 24, 102, 12, 54, 0, 24, 0, 102, 12, 48, 24, 42, 36, 60, 0, 12, 48, 18, 12, 54, 0, 84, 18, 39, 9, 84, 30, 66, 18, 48, 15, 72, 48, 39, 42, 48, 0, 60, 0, 84, 30, 45, 33, 54, 6, 54, 30, 33, 30, 90, 6, 54, 0, 24, 6, 72, 27, 78, 12, 24, 15, 66, 0, 54, 36, 21, 42, 114, 0, 60, 3, 30, 33, 54, 27, 30, 33, 60, 6, 54, 12, 48, 33, 36, 0, 42, 12, 45, 39, 24, 36, 96, 18, 24, 12, 33, 18, 99, 18, 66, 0, 36, 0, 51, 24, 30, 30, 36, 15, 84, 6, 102, 48, 48, 18, 60, 0, 72, 12, 36, 42, 60, 12, 24, 21, 30, 0, 54, 18, 60, 18, 42, 0, 66, 6, 24, 24, 54, 15, 78, 12, 42, 27, 27, 30, 51, 27, 78, 0, 48, 6, 120, 27, 48, 42, 24, 12, 54, 6, 54, 24, 48, 36, 66, 0, 78, 9, 57, 21, 48, 18, 54, 33, 24, 30, 84, 18, 45, 33, 30, 0, 126, 9, 36, 30, 27, 30, 66, 18, 54, 0, 36, 42, 48, 6, 42, 0, 54, 6, 57, 12, 84, 54, 48, 6, 60, 6, 63, 18, 42, 36, 78, 0, 24, 24, 33, 24, 105, 24, 66, 27, 48, 0, 48, 30, 60, 30, 54, 0, 42, 3, 75, 48, 24, 12, 66, 12, 96, 6, 30, 12, 87, 21, 36, 0, 30, 24, 69, 12, 57, 30, 48, 24, 54, 0, 42, 54, 24, 24, 72, 0, 60, 0, 48, 24, 69, 24, 42, 18, 36, 12, 66, 24, 36, 42, 18, 0, 78, 9, 48, 36, 42, 42, 36, 12, 36, 21, 78, 18, 48, 12, 102, 0, 18, 12, 54, 24, 45, 27, 42, 13, 108, 12, 39, 24, 42, 27, 102, 0, 60, 6, 39, 24, 54, 12, 54, 24, 24, 0, 114, 24, 63, 48, 30, 0, 48, 6, 69, 36, 18, 12, 72, 6, 48, 18, 33, 54, 117, 12, 42, 0, 66, 12, 48, 6, 54, 36, 42, 21, 102, 6, 48, 54, 33, 30, 48, 0, 72, 0, 30, 24, 75, 24, 84, 30, 30, 0, 72, 18, 30, 42, 54, 0, 60, 12, 36, 45, 42, 12, 96, 6, 66, 0, 12, 36, 78, 36, 42, 0, 36, 0, 78, 24, 48, 24, 18, 30, 90, 15, 96, 18, 27, 21, 54, 0, 24, 21, 48, 27, 84, 18, 48, 42, 36, 6, 66, 12, 108, 12, 42, 0, 48, 9, 27, 60, 21, 36, 84, 6, 36, 18, 42, 18, 54, 18, 60, 0, 60, 15, 72, 9, 99, 42, 12, 12, 60, 0, 57, 42, 18, 18, 78, 0, 42, 6, 36, 36, 63, 9, 42, 15, 30, 18, 78, 6, 24, 48, 42, 0, 102, 12, 75, 45, 42, 30, 84, 24, 66, 9, 24, 30, 90, 24, 42, 0, 24, 3, 84, 21, 84, 33, 66, 24, 36, 6, 36, 48, 51, 18, 72, 0, 66, 18, 54, 30, 24, 18, 48, 18, 30, 0, 102, 12, 45, 36, 24, 0, 102, 3, 42, 15, 42, 54, 54, 21, 66, 24, 66, 30, 102, 3, 66, 0, 48, 12, 24, 30, 45, 36, 54, 6, 78, 9, 48, 24, 39, 36, 96, 0, 66, 6, 27, 27, 60, 30, 18, 30, 48, 12, 90, 24, 60, 36, 6, 0, 42, 12, 78, 36, 36, 24, 114, 6, 60, 0, 18, 6, 69, 18, 84, 0, 36, 6, 48, 6, 39, 24, 42, 24, 54, 6, 72, 48, 36, 42, 60, 0, 48, 0, 36, 18, 138, 24, 30, 30, 42, 18, 75, 18, 48, 18, 24, 0, 78, 0, 78, 57, 60, 9, 48, 9, 36, 30, 30, 42, 42, 39, 84, 0, 24, 12, 87, 27, 30, 42, 24, 24, 90, 0, 36, 24, 60, 36, 84, 0, 42, 0, 30, 21, 87, 12, 72, 24, 42, 12, 60, 30, 72, 21, 60, 0, 96, 12, 30, 42, 39, 18, 66, 12, 84, 12, 63, 42, 42, 24, 42, 0, 18, 6, 78, 15, 75, 45, 54, 12, 54, 6, 84, 30, 30, 18, 54, 0, 42, 24, 39, 27, 96, 18, 42, 21, 48, 0, 54, 18, 33, 36, 66, 0, 84, 0, 75, 48, 30, 42, 54, 12, 54, 15, 42, 30, 96, 18, 42, 0, 18, 6, 123, 15, 48, 24, 48, 39, 42, 6, 21, 54, 45, 12, 60, 0, 90, 12, 30, 36, 45, 18, 72, 21, 78, 12, 30, 12, 60, 30, 18, 0, 78, 6, 60, 36, 33, 18, 60, 12, 30, 0, 60, 18, 90, 30, 54, 0, 36, 1, 78, 27, 84, 30, 18, 15, 102, 9, 27, 30, 24, 57, 90, 0, 42, 9, 48, 42, 42, 12, 72, 27, 48, 9, 108, 18, 48, 48, 18, 0, 84, 6, 66, 24, 48, 21, 114, 6, 78, 24, 30, 30, 42, 18, 60, 0, 18, 12, 63, 9, 51, 66, 48, 15, 54, 0, 66, 60, 36, 18, 48, 0, 66, 6, 36, 30, 96, 9, 36, 30, 30, 24, 93, 24, 72, 24, 66, 0, 60, 24, 48, 30, 24, 30, 72, 6, 60, 12, 30, 12, 93, 18, 72, 0, 30, 0, 81, 30, 36, 48, 36, 30, 90, 6, 54, 24, 57, 24, 36, 0, 54, 18, 36, 24, 78, 18, 72, 33, 12, 0, 51, 30, 48, 24, 42, 0, 90, 3, 78, 30, 30, 27, 138, 6, 30, 18, 36, 24, 75, 24, 12, 0, 54, 12, 42, 18, 84, 36, 30, 18, 66, 6, 45, 36, 36, 48, 114, 0, 24, 6, 30, 21, 108, 15, 48, 18, 36, 18, 57, 24, 63, 42, 54, 0, 78, 6, 81, 36, 18, 24, 42, 18, 120, 0, 24, 24, 66, 12, 54, 0, 48, 12, 66, 18, 42, 36, 48, 18, 72, 6, 48, 48, 33, 6, 102, 0, 54, 24, 39, 54, 60, 12, 90, 18, 36, 3, 111, 24, 51, 48, 42, 0, 90, 0, 45, 36, 54, 48, 54, 24, 18, 18, 51, 18, 72, 0, 54, 0, 18, 12, 54, 36, 57, 18, 42, 18, 120, 0, 63, 42, 27, 36, 48, 0, 54, 6, 39, 30, 81, 18, 72, 33, 54, 9, 72, 12, 54, 54, 24, 0, 54, 15, 75, 24, 60, 12, 78, 6, 30, 12, 39, 54, 72, 6, 54, 0, 72, 6, 78, 12, 54, 39, 30, 15, 48, 6, 57, 48, 18, 24, 90, 0, 90, 18, 42, 24, 39, 42, 24, 30, 42, 0, 84, 6, 66, 30, 30, 0, 30, 0, 27, 42, 39, 33, 90, 24, 84, 18, 51, 36, 69, 24, 54, 0, 42, 18, 87, 33, 51, 18, 42, 9, 126, 9, 84, 36, 66, 18, 54, 0, 36, 0, 66, 12, 48, 15, 54, 30, 18, 18, 60, 18, 96, 54, 42, 0, 102, 0, 27, 36, 30, 36, 108, 15, 54, 0, 24, 36, 60, 24, 66, 0, 30, 0, 54, 15, 75, 48, 36, 18, 48, 24, 36, 36, 54, 15, 108, 0, 84, 18}); for (int i = 0; i < n; i++) { cout << ans[i] << endl; } }
replace
8
26
8
637
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define mp make_pair #define fi first #define se second #define VAL 100000 #define ll long long #define INF 10000000000000000LL #define pll pair<long long, long long> const int MAX = 1e7 + 9; const ll MOD = 1e9 + 7; const int TOT_PRIMES = 19; const int MAX_A = 70; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; int cnt = 0; int arr[n + 1]; memset(arr, 0, sizeof(arr)); for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { for (int k = 1; k <= n; k++) { int now = (i * i) + (j * j) + (k * k) + (i * k) + (i * j) + (j * k); if (now > n) continue; arr[now] = arr[now] + 1; } } } for (int i = 1; i <= n; i++) cout << arr[i] << endl; }
#include <bits/stdc++.h> #define mp make_pair #define fi first #define se second #define VAL 100000 #define ll long long #define INF 10000000000000000LL #define pll pair<long long, long long> const int MAX = 1e7 + 9; const ll MOD = 1e9 + 7; const int TOT_PRIMES = 19; const int MAX_A = 70; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; int cnt = 0; int arr[n + 1]; memset(arr, 0, sizeof(arr)); for (int i = 1; i <= sqrt(n); i++) { for (int j = 1; j <= sqrt(n); j++) { for (int k = 1; k <= sqrt(n); k++) { int now = (i * i) + (j * j) + (k * k) + (i * k) + (i * j) + (j * k); if (now > n) continue; arr[now] = arr[now] + 1; } } } for (int i = 1; i <= n; i++) cout << arr[i] << endl; }
replace
22
25
22
25
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; ll ans[2001] = {}; int main() { int n_max; cin >> n_max; for (int x = 1; x * x <= n_max; ++x) { for (int y = 1; x * x + y * y + x * y <= n_max; ++y) { for (int z = 1; x * x + y * (x + y) + z * (x + y + z) <= n_max; ++z) { ans[x * x + y * (x + y) + z * (x + y + z)]++; } } } for (int i = 1; i <= n_max; ++i) { cout << ans[i] << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; ll ans[10001] = {}; int main() { int n_max; cin >> n_max; for (int x = 1; x * x <= n_max; ++x) { for (int y = 1; x * x + y * y + x * y <= n_max; ++y) { for (int z = 1; x * x + y * (x + y) + z * (x + y + z) <= n_max; ++z) { ans[x * x + y * (x + y) + z * (x + y + z)]++; } } } for (int i = 1; i <= n_max; ++i) { cout << ans[i] << endl; } return 0; }
replace
3
4
3
4
0
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int X = N / 6 + 1; int F; for (int l = 1; l <= N; l++) { F = 0; for (int i = 1; i <= X; i++) { for (int j = i; j <= X; j++) { for (int k = j; k <= X; k++) { if (i * i + j * j + k * k + i * j + j * k + k * i == l) { if (i == j && j == k) { F++; } else if (i != j && j != k && k != i) { F += 6; } else { F += 3; } } } } } cout << F << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int X = sqrt(N) + 1; int F; for (int l = 1; l <= N; l++) { F = 0; for (int i = 1; i <= X; i++) { for (int j = i; j <= X; j++) { for (int k = j; k <= X; k++) { if (i * i + j * j + k * k + i * j + j * k + k * i == l) { if (i == j && j == k) { F++; } else if (i != j && j != k && k != i) { F += 6; } else { F += 3; } } } } } cout << F << endl; } }
replace
6
7
6
7
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define repr(i, n) for (int i = (int)n - 1; i >= 0; --i) #define ALL(a) (a).begin(), (a).end() using ll = long long; using Graph = vector<vector<int>>; using P = pair<ll, ll>; const int dx[] = {0, 1, -1, 0}; const int dy[] = {1, 0, 0, -1}; const ll mod = 1e9 + 7; const ll INF = 1e9; const ll LINF = 1LL << 60; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } int main() { ios::sync_with_stdio(false); cin.tie(0); ////////////////////////////////////// int n; cin >> n; for (int i = 1; i <= n; i++) { int ans = 0; for (int x = 1; x <= sqrt(n); x++) { for (int y = x; y <= sqrt(n); y++) { for (int z = y; z <= sqrt(n); z++) if (x * x + y * y + z * z + x * y + y * z + z * x == i) { map<int, int> mp; mp[x]++; mp[y]++; mp[z]++; if (mp.size() == 1) ans++; if (mp.size() == 2) ans += 3; if (mp.size() == 3) ans += 6; } } } cout << ans << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define repr(i, n) for (int i = (int)n - 1; i >= 0; --i) #define ALL(a) (a).begin(), (a).end() using ll = long long; using Graph = vector<vector<int>>; using P = pair<ll, ll>; const int dx[] = {0, 1, -1, 0}; const int dy[] = {1, 0, 0, -1}; const ll mod = 1e9 + 7; const ll INF = 1e9; const ll LINF = 1LL << 60; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } int main() { ios::sync_with_stdio(false); cin.tie(0); ////////////////////////////////////// int n; cin >> n; for (int i = 1; i <= n; i++) { int ans = 0; for (int x = 1; x <= sqrt(n); x++) { for (int y = x; y <= sqrt(n); y++) { for (int z = y; z * (z + x + y) <= i - x * x - y * y - x * y; z++) if (x * x + y * y + z * z + x * y + y * z + z * x == i) { map<int, int> mp; mp[x]++; mp[y]++; mp[z]++; if (mp.size() == 1) ans++; if (mp.size() == 2) ans += 3; if (mp.size() == 3) ans += 6; } } } cout << ans << endl; } return 0; }
replace
39
40
39
40
TLE
p02608
C++
Runtime Error
#include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <unordered_map> #include <unordered_set> #include <utility> #include <valarray> #include <vector> #define _GLIBCXX_DEBUG #define INF 100000010 #define PI 3.14159265359 using namespace std; const int64_t mod = 1000000007; const int64_t tmpMod = 998244353; int main() { int64_t N; cin >> N; vector<int64_t> A(N, 0); // for(int i=0; i<N; i++){cin>>A[i];} // vector<vector<int> > A(N,vector<int>(M)); for (int i = 1; i < 100; i++) { for (int j = 1; j < 100; j++) { for (int k = 1; k < 100; k++) { A[(i * i) + (j * j) + k * k + i * j + j * k + k * i - 1]++; } } } // sort(A.begin(),A.end()); // for (int i = 0; i < N; i++) { maximum = max(maximum , A[i]);} for (int i = 0; i < N; i++) { cout << A[i] << endl; } }
#include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <unordered_map> #include <unordered_set> #include <utility> #include <valarray> #include <vector> #define _GLIBCXX_DEBUG #define INF 100000010 #define PI 3.14159265359 using namespace std; const int64_t mod = 1000000007; const int64_t tmpMod = 998244353; int main() { int64_t N; cin >> N; vector<int64_t> A(N, 0); // for(int i=0; i<N; i++){cin>>A[i];} // vector<vector<int> > A(N,vector<int>(M)); for (int i = 1; i < 100; i++) { for (int j = 1; j < 100; j++) { for (int k = 1; k < 100; k++) { if ((i * i) + (j * j) + k * k + i * j + j * k + k * i - 1 < N) A[(i * i) + (j * j) + k * k + i * j + j * k + k * i - 1]++; } } } // sort(A.begin(),A.end()); // for (int i = 0; i < N; i++) { maximum = max(maximum , A[i]);} for (int i = 0; i < N; i++) { cout << A[i] << endl; } }
replace
52
53
52
54
-11
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N = 10010; vector<int> vec(N); int n; cin >> n; for (int i = 1; i * i < N; i++) { for (int j = 1; j * j < N; j++) { for (int k = 1; k * k < N; k++) { int a = i * i + j * j + k * k; int b = i * j + j * k + k * i; if (a + b > N) break; vec.at(a + b)++; } } } for (int i = 1; i < n + 1; i++) { cout << vec.at(i) << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int N = 10010; vector<int> vec(N); int n; cin >> n; for (int i = 1; i * i < N; i++) { for (int j = 1; j * j < N; j++) { for (int k = 1; k * k < N; k++) { int a = i * i + j * j + k * k; int b = i * j + j * k + k * i; if (a + b >= N) break; vec.at(a + b)++; } } } for (int i = 1; i < n + 1; i++) { cout << vec.at(i) << endl; } }
replace
13
14
13
14
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 10010) >= this->size() (which is 10010)
p02608
C++
Runtime Error
#include <cstdio> int n, f[1100], data[101][101][101]; void check(int x, int y, int z) { int tmp = x * x + y * y + z * z + x * y + y * z + z * x; if (tmp > n) return; data[x][y][z] = 1; if (!data[x + 1][y][z]) check(x + 1, y, z); if (!data[x][y + 1][z]) check(x, y + 1, z); if (!data[x][y][z + 1]) check(x, y, z + 1); } int main() { scanf("%d", &n); check(1, 1, 1); for (int i = 1; i <= 100; ++i) for (int j = 1; j <= 100; ++j) for (int k = 1; k <= 100; ++k) if (data[i][j][k]) f[i * i + j * j + k * k + i * j + j * k + k * i]++; for (int i = 1; i <= n; ++i) printf("%d\n", f[i]); return 0; }
#include <cstdio> int n, f[11000], data[101][101][101]; void check(int x, int y, int z) { int tmp = x * x + y * y + z * z + x * y + y * z + z * x; if (tmp > n) return; data[x][y][z] = 1; if (!data[x + 1][y][z]) check(x + 1, y, z); if (!data[x][y + 1][z]) check(x, y + 1, z); if (!data[x][y][z + 1]) check(x, y, z + 1); } int main() { scanf("%d", &n); check(1, 1, 1); for (int i = 1; i <= 100; ++i) for (int j = 1; j <= 100; ++j) for (int k = 1; k <= 100; ++k) if (data[i][j][k]) f[i * i + j * j + k * k + i * j + j * k + k * i]++; for (int i = 1; i <= n; ++i) printf("%d\n", f[i]); return 0; }
replace
1
2
1
2
0
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> count(N, 0); int max; for (int i = 0; i < N; i++) { if (i * i > N) { max = i - 1; break; } } if (N == 1) { max = 1; } // これでmax求まった int value; for (int i = 1; i <= max; i++) { for (int j = 1; j <= max; j++) { if (i * i + j * j + i * j + i + j + 1 > N) break; for (int k = 1; k <= max; k++) { value = i * i + j * j + k * k + i * j + j * k + k * i; if (value > N) break; count.at(value)++; } } } for (int i = 0; i < N; i++) { cout << count.at(i) << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> count(N, 0); int max; for (int i = 0; i < N; i++) { if (i * i > N) { max = i - 1; break; } } if (N == 1) { max = 1; } // これでmax求まった int value; for (int i = 1; i <= max; i++) { for (int j = 1; j <= max; j++) { if (i * i + j * j + i * j + i + j + 1 > N) break; for (int k = 1; k <= max; k++) { value = i * i + j * j + k * k + i * j + j * k + k * i; if (value > N) break; count.at(value - 1)++; } } } for (int i = 0; i < N; i++) { cout << count.at(i) << endl; } }
replace
32
33
32
33
0
p02608
C++
Runtime Error
#include "bits/stdc++.h" #define MOD 1000000007 #define rep(i, n) for (ll i = 0; i < (n); i++) #define rrep(i, n) for (ll i = (n)-1; i >= 0; i--) #define ALL(v) v.begin(), v.end() #define rALL(v) v.rbegin(), v.rend() #define FOR(i, j, k) for (ll i = j; i < k; i++) #define debug_print(var) cerr << #var << "=" << var << endl; #define DUMP(i, v) \ for (ll i = 0; i < v.size(); i++) \ cerr << v[i] << " " using namespace std; typedef long long int ll; typedef vector<ll> llvec; typedef vector<double> dvec; typedef pair<ll, ll> P; typedef long double ld; struct edge { ll x, c; }; ll mod(ll a, ll mod) { ll res = a % mod; if (res < 0) res = res + mod; return res; } ll modpow(ll a, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } ll modinv(ll a, ll mod) { return modpow(a, mod - 2, mod); } ll gcd(ll a, ll b) { ll r = a % b; if (r == 0) return b; else return gcd(b, a % b); } bool is_prime(ll n) { ll i = 2; if (n == 1) return false; if (n == 2) return true; bool res = true; while (i * i < n) { if (n % i == 0) { res = false; } i = i + 1; } // if(i==1)res = false; if (n % i == 0) res = false; return res; } struct UnionFind { ll N; llvec p; llvec cnt; UnionFind(ll n) { N = n; p = llvec(N); cnt = llvec(N, 0); rep(i, N) { p[i] = i; cnt[i] = 1; } } void con(ll a, ll b) { P at = root(a); P bt = root(b); if (at.second != bt.second) { if (at.first > bt.first) { swap(at, bt); swap(a, b); } p[at.second] = bt.second; cnt[bt.second] += cnt[at.second]; p[a] = bt.second; } } P root(ll a) { ll atmp = a; ll c = 0; while (atmp != p[atmp]) { atmp = p[atmp]; c++; } p[a] = atmp; return {c, atmp}; } bool is_con(ll a, ll b) { P at = root(a); P bt = root(b); return at.second == bt.second; } }; struct dijkstra { ll N; llvec d; vector<vector<edge>> e; dijkstra(ll n) { N = n; // d = llvec(N, 1e18); e = vector<vector<edge>>(N); } void add_edge(ll from, ll to, ll cost) { e[from].push_back({to, cost}); } void run(ll start) { priority_queue<P, vector<P>, greater<P>> que; que.push({0, start}); d = llvec(N, 1e18); d[start] = 0; while (!que.empty()) { P q = que.top(); que.pop(); ll dc = q.first; ll x = q.second; if (dc > d[x]) { continue; } else { for (auto ip : e[x]) { if (d[ip.x] <= d[x] + ip.c) { continue; } else { d[ip.x] = d[x] + ip.c; que.push({d[ip.x], ip.x}); } } } } } }; /************************************** ** A main function starts from here ** ***************************************/ int main() { ll N; cin >> N; llvec f(N, 0); for (ll x = 1; x <= sqrt(N); x++) { for (ll y = 1; y <= sqrt(N); y++) { for (ll z = 1; z <= sqrt(N); z++) { f[x * x + y * y + z * z + x * y + y * z + z * x]++; } } } rep(i, N) { cout << f[i + 1] << endl; } return 0; }
#include "bits/stdc++.h" #define MOD 1000000007 #define rep(i, n) for (ll i = 0; i < (n); i++) #define rrep(i, n) for (ll i = (n)-1; i >= 0; i--) #define ALL(v) v.begin(), v.end() #define rALL(v) v.rbegin(), v.rend() #define FOR(i, j, k) for (ll i = j; i < k; i++) #define debug_print(var) cerr << #var << "=" << var << endl; #define DUMP(i, v) \ for (ll i = 0; i < v.size(); i++) \ cerr << v[i] << " " using namespace std; typedef long long int ll; typedef vector<ll> llvec; typedef vector<double> dvec; typedef pair<ll, ll> P; typedef long double ld; struct edge { ll x, c; }; ll mod(ll a, ll mod) { ll res = a % mod; if (res < 0) res = res + mod; return res; } ll modpow(ll a, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } ll modinv(ll a, ll mod) { return modpow(a, mod - 2, mod); } ll gcd(ll a, ll b) { ll r = a % b; if (r == 0) return b; else return gcd(b, a % b); } bool is_prime(ll n) { ll i = 2; if (n == 1) return false; if (n == 2) return true; bool res = true; while (i * i < n) { if (n % i == 0) { res = false; } i = i + 1; } // if(i==1)res = false; if (n % i == 0) res = false; return res; } struct UnionFind { ll N; llvec p; llvec cnt; UnionFind(ll n) { N = n; p = llvec(N); cnt = llvec(N, 0); rep(i, N) { p[i] = i; cnt[i] = 1; } } void con(ll a, ll b) { P at = root(a); P bt = root(b); if (at.second != bt.second) { if (at.first > bt.first) { swap(at, bt); swap(a, b); } p[at.second] = bt.second; cnt[bt.second] += cnt[at.second]; p[a] = bt.second; } } P root(ll a) { ll atmp = a; ll c = 0; while (atmp != p[atmp]) { atmp = p[atmp]; c++; } p[a] = atmp; return {c, atmp}; } bool is_con(ll a, ll b) { P at = root(a); P bt = root(b); return at.second == bt.second; } }; struct dijkstra { ll N; llvec d; vector<vector<edge>> e; dijkstra(ll n) { N = n; // d = llvec(N, 1e18); e = vector<vector<edge>>(N); } void add_edge(ll from, ll to, ll cost) { e[from].push_back({to, cost}); } void run(ll start) { priority_queue<P, vector<P>, greater<P>> que; que.push({0, start}); d = llvec(N, 1e18); d[start] = 0; while (!que.empty()) { P q = que.top(); que.pop(); ll dc = q.first; ll x = q.second; if (dc > d[x]) { continue; } else { for (auto ip : e[x]) { if (d[ip.x] <= d[x] + ip.c) { continue; } else { d[ip.x] = d[x] + ip.c; que.push({d[ip.x], ip.x}); } } } } } }; /************************************** ** A main function starts from here ** ***************************************/ int main() { ll N; cin >> N; llvec f(1000000, 0); for (ll x = 1; x <= sqrt(N); x++) { for (ll y = 1; y <= sqrt(N); y++) { for (ll z = 1; z <= sqrt(N); z++) { f[x * x + y * y + z * z + x * y + y * z + z * x]++; } } } rep(i, N) { cout << f[i + 1] << endl; } return 0; }
replace
161
162
161
162
0
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define codefor \ int test; \ scanf("%d", &test); \ while (test--) #define yn(ans) cout << (ans ? "Yes" : "No") << endl #define YN(ans) cout << (ans ? "YES" : "NO") << endl #define umap unordered_map #define uset unordered_set using namespace std; using ll = long long; // 入力系 void scan(int &a) { scanf("%d", &a); } void scan(long long &a) { scanf("%lld", &a); } template <class T> void scan(T &a) { cin >> a; } template <class T> void scan(vector<T> &vec) { for (auto &&it : vec) scan(it); } void in() {} template <class Head, class... Tail> void in(Head &head, Tail &...tail) { scan(head); in(tail...); } // 出力系 void print(const int &a) { printf("%d", a); } void print(const long long &a) { printf("%lld", a); } void print(const double &a) { printf("%.15lf", a); } template <class T> void print(const T &a) { cout << a; } template <class T> void print(const vector<T> &vec) { if (vec.empty()) return; print(vec[0]); for (auto it = vec.begin(); ++it != vec.end();) { putchar(' '); print(*it); } } void out() { putchar('\n'); } template <class T> void out(const T &t) { print(t); putchar('\n'); } template <class Head, class... Tail> void out(const Head &head, const Tail &...tail) { print(head); putchar(' '); out(tail...); } // デバッグ系 template <class T> void dprint(const T &a) { cerr << a; } template <class T> void dprint(const vector<T> &vec) { if (vec.empty()) return; cerr << vec[0]; for (auto it = vec.begin(); ++it != vec.end();) { cerr << " " << *it; } } void debug() { cerr << endl; } template <class T> void debug(const T &t) { dprint(t); cerr << endl; } template <class Head, class... Tail> void debug(const Head &head, const Tail &...tail) { dprint(head); cerr << " "; debug(tail...); } int main() { int n; in(n); int ans = 0; for (int i = 1; i <= n; i++) { ans = 0; for (int x = 1; x * x <= i; x++) { for (int y = 1; y * y <= i; y++) { for (int z = 1; z * z <= i; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) ans++; } } } out(ans); } }
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define codefor \ int test; \ scanf("%d", &test); \ while (test--) #define yn(ans) cout << (ans ? "Yes" : "No") << endl #define YN(ans) cout << (ans ? "YES" : "NO") << endl #define umap unordered_map #define uset unordered_set using namespace std; using ll = long long; // 入力系 void scan(int &a) { scanf("%d", &a); } void scan(long long &a) { scanf("%lld", &a); } template <class T> void scan(T &a) { cin >> a; } template <class T> void scan(vector<T> &vec) { for (auto &&it : vec) scan(it); } void in() {} template <class Head, class... Tail> void in(Head &head, Tail &...tail) { scan(head); in(tail...); } // 出力系 void print(const int &a) { printf("%d", a); } void print(const long long &a) { printf("%lld", a); } void print(const double &a) { printf("%.15lf", a); } template <class T> void print(const T &a) { cout << a; } template <class T> void print(const vector<T> &vec) { if (vec.empty()) return; print(vec[0]); for (auto it = vec.begin(); ++it != vec.end();) { putchar(' '); print(*it); } } void out() { putchar('\n'); } template <class T> void out(const T &t) { print(t); putchar('\n'); } template <class Head, class... Tail> void out(const Head &head, const Tail &...tail) { print(head); putchar(' '); out(tail...); } // デバッグ系 template <class T> void dprint(const T &a) { cerr << a; } template <class T> void dprint(const vector<T> &vec) { if (vec.empty()) return; cerr << vec[0]; for (auto it = vec.begin(); ++it != vec.end();) { cerr << " " << *it; } } void debug() { cerr << endl; } template <class T> void debug(const T &t) { dprint(t); cerr << endl; } template <class Head, class... Tail> void debug(const Head &head, const Tail &...tail) { dprint(head); cerr << " "; debug(tail...); } int main() { int n; in(n); vector<int> vec = { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 1, 6, 0, 3, 0, 0, 0, 0, 0, 3, 3, 6, 0, 0, 3, 0, 0, 0, 0, 3, 3, 6, 0, 6, 0, 0, 0, 3, 0, 0, 1, 6, 0, 6, 6, 0, 0, 6, 0, 0, 0, 0, 3, 3, 3, 6, 0, 6, 3, 6, 0, 0, 0, 6, 0, 0, 0, 3, 3, 9, 0, 6, 3, 6, 0, 3, 6, 0, 0, 0, 0, 6, 1, 6, 0, 6, 6, 0, 3, 12, 0, 6, 0, 0, 3, 6, 0, 0, 0, 3, 3, 12, 0, 6, 3, 6, 0, 3, 6, 9, 0, 6, 0, 0, 0, 3, 6, 3, 3, 6, 0, 6, 3, 12, 0, 3, 6, 6, 0, 6, 0, 6, 3, 6, 0, 0, 1, 6, 3, 12, 6, 0, 0, 12, 0, 6, 0, 6, 6, 12, 0, 0, 6, 0, 0, 6, 0, 12, 3, 6, 0, 6, 3, 9, 6, 3, 6, 6, 0, 6, 0, 6, 0, 15, 6, 0, 0, 6, 0, 3, 3, 12, 0, 12, 6, 6, 0, 3, 6, 6, 3, 12, 0, 6, 0, 9, 6, 0, 0, 6, 3, 12, 1, 6, 6, 6, 6, 0, 0, 18, 0, 12, 0, 3, 6, 12, 0, 0, 6, 3, 6, 12, 0, 12, 0, 0, 0, 9, 3, 9, 6, 12, 3, 12, 0, 3, 6, 6, 0, 12, 0, 12, 0, 9, 9, 0, 0, 6, 3, 6, 3, 12, 6, 9, 3, 6, 0, 12, 3, 6, 3, 9, 6, 12, 6, 6, 0, 6, 0, 9, 6, 6, 0, 12, 3, 6, 0, 9, 6, 6, 1, 6, 0, 21, 12, 6, 0, 12, 0, 12, 0, 0, 6, 15, 6, 0, 6, 12, 0, 12, 0, 12, 0, 0, 0, 12, 0, 12, 12, 3, 3, 18, 3, 6, 3, 6, 6, 9, 9, 18, 0, 6, 0, 12, 0, 9, 6, 0, 3, 12, 3, 6, 6, 12, 6, 6, 0, 0, 0, 15, 3, 18, 3, 18, 3, 12, 6, 3, 6, 9, 0, 12, 0, 12, 0, 18, 12, 0, 0, 12, 3, 6, 0, 6, 6, 9, 6, 0, 0, 18, 1, 18, 3, 12, 6, 6, 6, 12, 0, 15, 6, 12, 6, 18, 0, 0, 6, 0, 9, 12, 0, 18, 0, 6, 3, 12, 0, 12, 12, 0, 0, 12, 0, 3, 6, 12, 6, 18, 9, 18, 0, 9, 6, 18, 0, 6, 0, 6, 3, 27, 6, 6, 6, 6, 3, 6, 0, 12, 6, 9, 0, 6, 0, 18, 0, 9, 9, 15, 3, 12, 6, 6, 3, 9, 6, 12, 12, 18, 0, 18, 0, 6, 6, 21, 6, 0, 0, 6, 3, 15, 6, 12, 6, 18, 0, 0, 0, 12, 6, 6, 3, 6, 4, 18, 6, 12, 6, 3, 9, 30, 0, 18, 0, 6, 6, 12, 6, 6, 9, 12, 0, 18, 6, 18, 0, 6, 0, 12, 0, 6, 12, 6, 3, 18, 0, 6, 6, 6, 6, 15, 3, 24, 0, 6, 3, 18, 0, 12, 6, 12, 6, 24, 0, 15, 18, 9, 6, 0, 0, 18, 3, 6, 0, 15, 12, 12, 6, 6, 0, 18, 0, 6, 3, 12, 0, 12, 6, 6, 9, 9, 6, 24, 3, 24, 0, 9, 12, 6, 6, 12, 0, 12, 0, 21, 9, 15, 6, 12, 3, 18, 3, 12, 6, 12, 6, 0, 0, 12, 0, 12, 6, 24, 0, 6, 12, 6, 1, 9, 6, 12, 6, 24, 0, 18, 3, 12, 6, 6, 12, 24, 0, 12, 6, 15, 6, 18, 0, 18, 0, 0, 0, 18, 9, 21, 12, 0, 6, 18, 0, 9, 6, 6, 6, 12, 0, 12, 0, 9, 9, 27, 6, 6, 3, 18, 6, 21, 6, 6, 12, 12, 0, 12, 0, 24, 12, 0, 0, 24, 3, 24, 6, 12, 12, 18, 0, 0, 0, 12, 0, 18, 3, 15, 6, 12, 9, 6, 0, 15, 6, 9, 12, 24, 0, 12, 3, 6, 6, 21, 6, 18, 3, 18, 0, 21, 12, 15, 6, 6, 0, 12, 3, 12, 9, 18, 9, 12, 6, 6, 6, 24, 0, 18, 3, 24, 0, 6, 6, 0, 6, 9, 6, 6, 4, 30, 0, 18, 12, 9, 6, 24, 0, 18, 0, 9, 12, 21, 6, 6, 12, 12, 0, 18, 0, 21, 15, 12, 0, 12, 6, 12, 12, 18, 0, 18, 0, 6, 0, 9, 12, 18, 6, 30, 0, 0, 0, 24, 6, 9, 3, 12, 6, 30, 3, 6, 12, 6, 12, 12, 0, 36, 0, 6, 3, 27, 12, 12, 6, 6, 6, 24, 0, 12, 6, 12, 0, 18, 0, 18, 15, 18, 3, 18, 6, 12, 6, 6, 12, 3, 6, 6, 0, 12, 3, 39, 3, 12, 12, 12, 3, 18, 0, 21, 12, 21, 6, 18, 0, 12, 0, 9, 9, 12, 9, 24, 9, 12, 6, 12, 6, 33, 0, 6, 0, 18, 0, 9, 15, 12, 6, 24, 6, 6, 3, 15, 6, 15, 12, 18, 0, 18, 1, 18, 6, 12, 6, 6, 0, 24, 6, 24, 12, 18, 6, 24, 0, 6, 6, 12, 15, 24, 0, 24, 6, 6, 0, 18, 0, 15, 18, 12, 0, 24, 0, 12, 6, 12, 12, 18, 6, 24, 0, 0, 6, 24, 3, 12, 0, 12, 6, 30, 9, 6, 12, 24, 12, 12, 0, 15, 18, 12, 0, 18, 0, 24, 6, 15, 6, 18, 3, 18, 3, 12, 6, 24, 12, 12, 12, 6, 0, 36, 0, 18, 3, 6, 12, 6, 9, 12, 0, 3, 12, 36, 0, 30, 0, 12, 0, 18, 6, 12, 9, 12, 6, 24, 3, 18, 12, 15, 9, 24, 0, 18, 6, 18, 9, 18, 12, 6, 6, 24, 3, 24, 0, 12, 12, 12, 0, 6, 0, 27, 12, 18, 3, 30, 3, 18, 6, 0, 12, 15, 6, 18, 0, 24, 0, 9, 6, 9, 12, 18, 7, 24, 0, 24, 12, 15, 12, 24, 0, 24, 0, 6, 9, 30, 9, 6, 6, 0, 9, 33, 12, 36, 0, 12, 0, 18, 0, 6, 21, 12, 6, 36, 6, 0, 3, 18, 6, 12, 6, 24, 0, 12, 3, 24, 6, 9, 12, 6, 6, 30, 6, 18, 12, 9, 9, 12, 0, 30, 3, 18, 3, 27, 6, 30, 12, 12, 0, 24, 0, 27, 12, 6, 0, 24, 3, 18, 18, 9, 6, 18, 0, 12, 3, 33, 18, 12, 9, 6, 0, 12, 6, 30, 0, 24, 12, 12, 0, 30, 6, 6, 6, 0, 6, 24, 0, 12, 0, 18, 15, 33, 6, 30, 15, 18, 0, 9, 12, 24, 9, 12, 0, 18, 6, 27, 18, 15, 6, 18, 3, 24, 0, 6, 6, 36, 12, 18, 0, 12, 3, 30, 3, 12, 6, 12, 15, 6, 0, 18, 12, 15, 9, 30, 0, 18, 6, 12, 12, 18, 6, 6, 3, 24, 1, 27, 12, 18, 6, 18, 0, 24, 0, 18, 15, 15, 21, 30, 6, 12, 12, 18, 0, 30, 6, 24, 0, 6, 0, 18, 6, 36, 12, 6, 6, 36, 0, 6, 12, 12, 12, 24, 0, 30, 0, 9, 6, 18, 0, 18, 12, 12, 6, 24, 6, 9, 15, 12, 0, 12, 6, 30, 9, 18, 0, 42, 3, 18, 6, 12, 18, 33, 12, 12, 0, 18, 0, 21, 12, 12, 12, 24, 6, 30, 0, 27, 18, 6, 12, 6, 0, 24, 0, 18, 15, 30, 0, 18, 12, 6, 0, 21, 6, 21, 12, 24, 0, 30, 0, 6, 6, 6, 12, 24, 0, 30, 12, 9, 12, 21, 3, 24, 0, 12, 3, 21, 18, 9, 18, 18, 6, 30, 3, 42, 6, 21, 6, 30, 0, 6, 3, 24, 9, 36, 6, 6, 9, 12, 6, 18, 12, 33, 9, 12, 0, 24, 9, 9, 6, 3, 18, 36, 6, 18, 0, 24, 6, 6, 6, 18, 0, 12, 0, 30, 3, 39, 12, 12, 7, 18, 0, 15, 18, 18, 9, 36, 0, 24, 6, 6, 18, 30, 0, 18, 9, 18, 3, 24, 6, 21, 12, 24, 0, 30, 3, 33, 24, 12, 6, 18, 6, 6, 6, 18, 6, 18, 12, 18, 0, 24, 6, 36, 3, 18, 6, 0, 12, 30, 0, 9, 24, 18, 0, 24, 0, 18, 0, 0, 12, 30, 15, 30, 6, 18, 3, 30, 0, 24, 18, 12, 0, 36, 3, 24, 12, 15, 18, 18, 6, 24, 3, 24, 12, 18, 12, 24, 0, 0, 6, 39, 6, 24, 3, 18, 3, 42, 6, 12, 12, 15, 9, 30, 0, 12, 0, 18, 6, 18, 12, 24, 15, 12, 0, 12, 12, 30, 12, 12, 0, 18, 0, 15, 15, 18, 18, 30, 3, 24, 12, 9, 6, 48, 0, 18, 0, 30, 0, 21, 6, 12, 12, 24, 12, 18, 3, 48, 24, 6, 6, 18, 0, 36, 0, 12, 15, 27, 6, 12, 12, 18, 6, 27, 6, 12, 9, 18, 0, 24, 6, 18, 18, 21, 0, 36, 0, 12, 0, 18, 12, 21, 18, 24, 0, 12, 1, 18, 9, 21, 18, 6, 9, 42, 3, 36, 12, 12, 12, 30, 0, 12, 6, 21, 12, 36, 6, 24, 9, 12, 6, 12, 12, 24, 12, 18, 0, 42, 0, 15, 6, 15, 15, 42, 6, 30, 6, 12, 12, 18, 12, 18, 0, 6, 6, 36, 0, 30, 18, 6, 0, 6, 0, 30, 18, 18, 0, 42, 0, 18, 6, 15, 18, 24, 0, 12, 6, 36, 9, 33, 12, 12, 12, 18, 0, 36, 0, 21, 21, 15, 18, 18, 15, 18, 0, 18, 6, 42, 6, 24, 0, 18, 3, 42, 6, 18, 12, 12, 12, 18, 0, 15, 12, 18, 12, 36, 0, 30, 12, 3, 21, 18, 0, 30, 6, 24, 0, 27, 12, 18, 12, 6, 0, 12, 0, 36, 15, 15, 3, 36, 12, 18, 6, 30, 6, 33, 12, 12, 0, 12, 6, 24, 6, 54, 18, 12, 3, 36, 9, 9, 12, 12, 18, 36, 0, 6, 0, 21, 15, 27, 9, 24, 12, 30, 6, 24, 6, 27, 18, 12, 0, 30, 0, 21, 12, 18, 6, 30, 0, 18, 0, 21, 18, 21, 6, 30, 0, 24, 3, 6, 6, 15, 27, 12, 10, 42, 6, 36, 12, 12, 6, 24, 0, 24, 6, 12, 12, 48, 6, 18, 12, 0, 3, 51, 6, 30, 6, 24, 0, 24, 0, 30, 21, 15, 12, 24, 9, 18, 6, 18, 12, 30, 9, 24, 0, 18, 0, 27, 18, 9, 6, 18, 9, 54, 0, 18, 24, 21, 18, 12, 0, 24, 0, 12, 0, 30, 9, 30, 12, 6, 9, 24, 6, 15, 15, 18, 0, 30, 3, 33, 18, 21, 12, 42, 3, 30, 6, 6, 24, 27, 6, 12, 0, 24, 3, 42, 6, 42, 9, 12, 6, 18, 6, 24, 12, 12, 12, 54, 0, 6, 12, 18, 6, 18, 18, 30, 12, 30, 0, 18, 0, 27, 18, 24, 0, 18, 0, 15, 24, 21, 6, 24, 3, 36, 6, 6, 6, 45, 21, 18, 0, 18, 6, 33, 3, 18, 0, 24, 15, 30, 0, 30, 24, 12, 6, 36, 0, 24, 3, 21, 24, 18, 15, 30, 3, 12, 6, 42, 12, 12, 12, 6, 0, 54, 6, 30, 15, 24, 18, 24, 6, 12, 0, 9, 6, 30, 0, 48, 0, 24, 0, 15, 12, 39, 12, 24, 6, 24, 6, 15, 30, 12, 6, 24, 0, 24, 3, 24, 12, 24, 6, 6, 18, 12, 4, 54, 6, 21, 18, 18, 0, 36, 6, 24, 9, 30, 12, 24, 9, 36, 6, 12, 18, 42, 3, 30, 0, 6, 9, 21, 6, 12, 30, 30, 6, 30, 0, 27, 12, 9, 18, 30, 0, 36, 0, 18, 9, 42, 6, 24, 12, 0, 6, 51, 12, 24, 12, 12, 0, 18, 6, 12, 18, 6, 6, 36, 3, 54, 9, 18, 6, 27, 12, 18, 0, 30, 0, 39, 9, 18, 18, 12, 9, 30, 6, 21, 12, 27, 18, 24, 0, 12, 0, 42, 18, 42, 6, 24, 15, 18, 0, 24, 12, 45, 12, 6, 0, 54, 0, 15, 21, 6, 6, 30, 6, 18, 12, 24, 18, 30, 6, 36, 0, 12, 3, 24, 12, 18, 18, 18, 12, 24, 0, 33, 12, 27, 6, 42, 0, 18, 6, 9, 15, 30, 6, 30, 6, 12, 6, 18, 6, 33, 15, 30, 0, 36, 3, 27, 21, 33, 24, 30, 9, 24, 0, 12, 18, 33, 6, 6, 0, 18, 3, 57, 12, 24, 18, 30, 9, 18, 0, 18, 12, 27, 12, 36, 0, 36, 6, 12, 6, 27, 12, 30, 9, 24, 6, 39, 18, 12, 24, 12, 0, 30, 0, 30, 6, 15, 15, 18, 3, 24, 18, 9, 12, 30, 9, 30, 0, 18, 6, 42, 18, 30, 0, 6, 10, 48, 0, 24, 12, 12, 18, 48, 0, 30, 3, 30, 15, 18, 6, 24, 18, 18, 0, 42, 6, 36, 15, 24, 0, 42, 12, 21, 24, 12, 12, 24, 0, 12, 6, 18, 18, 60, 6, 30, 0, 12, 0, 24, 0, 12, 18, 30, 15, 42, 0, 33, 30, 6, 6, 12, 0, 42, 3, 27, 6, 33, 12, 36, 12, 18, 0, 30, 6, 18, 12, 12, 0, 18, 6, 15, 27, 27, 6, 42, 6, 36, 9, 18, 30, 33, 9, 30, 0, 6, 6, 54, 6, 36, 24, 24, 0, 30, 3, 12, 6, 21, 24, 30, 0, 24, 0, 24, 12, 42, 9, 42, 21, 12, 12, 27, 12, 27, 6, 12, 0, 48, 6, 12, 18, 12, 12, 36, 6, 30, 0, 24, 0, 42, 12, 12, 0, 36, 0, 24, 15, 21, 21, 18, 6, 12, 9, 36, 18, 18, 15, 42, 0, 18, 6, 9, 18, 48, 12, 30, 9, 24, 3, 33, 6, 18, 18, 18, 0, 36, 3, 54, 24, 3, 12, 36, 9, 36, 6, 30, 12, 36, 12, 24, 0, 18, 6, 24, 6, 42, 0, 24, 18, 18, 0, 9, 30, 39, 12, 42, 0, 36, 0, 12, 12, 21, 12, 18, 12, 24, 6, 45, 6, 18, 24, 18, 0, 36, 0, 42, 15, 18, 6, 24, 6, 12, 12, 18, 12, 30, 6, 18, 0, 30, 1, 30, 9, 57, 9, 12, 9, 48, 6, 21, 24, 18, 12, 66, 0, 18, 6, 9, 24, 24, 24, 30, 12, 18, 0, 48, 6, 24, 18, 18, 0, 24, 3, 27, 18, 24, 12, 36, 6, 48, 6, 15, 18, 42, 6, 24, 0, 12, 12, 36, 6, 6, 24, 12, 3, 48, 0, 48, 18, 0, 12, 18, 0, 36, 6, 18, 9, 54, 15, 12, 12, 6, 6, 39, 6, 24, 18, 42, 0, 30, 0, 33, 18, 24, 18, 18, 9, 18, 0, 15, 18, 54, 0, 36, 0, 24, 0, 48, 24, 15, 18, 18, 12, 42, 9, 24, 12, 36, 21, 30, 0, 36, 12, 24, 3, 30, 0, 48, 15, 12, 6, 15, 18, 18, 18, 24, 0, 30, 0, 24, 24, 18, 9, 72, 0, 30, 6, 21, 18, 30, 6, 24, 0, 0, 6, 24, 18, 42, 12, 6, 15, 36, 0, 30, 18, 30, 12, 24, 0, 6, 0, 18, 12, 54, 9, 36, 9, 36, 9, 30, 6, 27, 27, 24, 0, 54, 6, 21, 18, 21, 6, 36, 15, 36, 3, 30, 12, 6, 18, 30, 0, 18, 6, 54, 0, 30, 21, 36, 9, 30, 6, 30, 24, 24, 6, 30, 0, 36, 12, 9, 24, 24, 12, 18, 9, 30, 0, 48, 12, 24, 12, 12, 0, 48, 0, 18, 12, 24, 24, 30, 6, 18, 12, 21, 12, 24, 0, 66, 0, 12, 0, 30, 9, 24, 24, 18, 13, 42, 3, 18, 18, 27, 24, 24, 0, 30, 6, 15, 18, 39, 12, 12, 9, 36, 12, 54, 12, 42, 18, 6, 0, 36, 0, 51, 18, 12, 0, 66, 12, 24, 0, 6, 24, 51, 12, 24, 0, 24, 0, 33, 6, 18, 18, 30, 6, 42, 3, 18, 30, 15, 15, 30, 0, 30, 6, 30, 12, 48, 12, 24, 12, 12, 9, 36, 6, 36, 6, 12, 0, 30, 0, 24, 21, 24, 15, 42, 12, 24, 6, 9, 18, 15, 9, 42, 0, 24, 12, 66, 12, 30, 24, 6, 9, 54, 0, 36, 12, 21, 12, 36, 0, 24, 3, 24, 15, 36, 6, 30, 24, 12, 6, 33, 6, 39, 21, 30, 0, 42, 6, 12, 30, 30, 18, 36, 0, 48, 3, 36, 12, 30, 18, 18, 0, 24, 0, 30, 6, 33, 21, 24, 6, 18, 12, 24, 12, 12, 15, 48, 0, 24, 6, 21, 21, 60, 6, 24, 12, 18, 0, 30, 12, 15, 12, 24, 0, 24, 3, 60, 27, 18, 12, 30, 3, 24, 9, 21, 12, 60, 18, 24, 0, 24, 9, 33, 6, 36, 12, 24, 15, 42, 6, 27, 36, 27, 6, 42, 0, 42, 6, 12, 15, 15, 24, 42, 18, 12, 0, 33, 6, 21, 18, 24, 0, 48, 3, 36, 9, 24, 24, 30, 6, 36, 0, 39, 18, 60, 6, 18, 0, 12, 6, 21, 27, 30, 0, 18, 6, 42, 6, 42, 18, 24, 9, 48, 0, 6, 6, 18, 18, 18, 6, 18, 15, 30, 4, 60, 12, 30, 30, 18, 0, 36, 0, 27, 18, 30, 18, 48, 9, 30, 12, 18, 6, 42, 9, 48, 0, 18, 6, 42, 6, 30, 24, 12, 3, 36, 0, 36, 36, 15, 18, 30, 0, 66, 0, 12, 18, 42, 9, 24, 15, 18, 12, 54, 6, 18, 21, 36, 0, 30, 6, 24, 24, 12, 6, 24, 9, 36, 12, 6, 12, 45, 12, 36, 0, 36, 0, 48, 3, 24, 18, 12, 24, 36, 0, 30, 12, 30, 21, 30, 0, 6, 15, 18, 15, 66, 12, 42, 3, 12, 0, 39, 12, 30, 12, 18, 0, 54, 6, 30, 24, 9, 12, 60, 12, 30, 12, 30, 24, 24, 18, 30, 0, 36, 0, 27, 9, 45, 18, 24, 12, 24, 0, 36, 24, 12, 6, 60, 0, 18, 0, 24, 15, 51, 9, 24, 12, 30, 12, 27, 18, 51, 18, 24, 0, 36, 6, 27, 27, 12, 30, 36, 6, 30, 0, 12, 6, 42, 0, 18, 0, 18, 0, 48, 12, 45, 24, 6, 15, 42, 6, 12, 18, 27, 9, 54, 0, 42, 3, 33, 12, 15, 12, 54, 18, 30, 6, 36, 18, 21, 30, 18, 0, 48, 3, 30, 18, 36, 6, 18, 0, 18, 12, 57, 24, 42, 6, 24, 0, 18, 12, 36, 18, 30, 12, 36, 3, 78, 0, 24, 6, 6, 36, 42, 0, 24, 0, 21, 15, 33, 6, 42, 18, 12, 3, 30, 12, 30, 27, 24, 0, 42, 12, 39, 12, 30, 12, 30, 15, 30, 6, 12, 24, 54, 6, 24, 0, 18, 6, 33, 12, 18, 24, 24, 7, 30, 0, 60, 24, 21, 12, 30, 0, 48, 6, 18, 15, 39, 12, 18, 18, 18, 0, 48, 12, 54, 18, 42, 0, 30, 0, 15, 30, 27, 18, 72, 0, 30, 15, 12, 12, 30, 18, 36, 0, 6, 3, 60, 15, 24, 18, 6, 18, 54, 6, 21, 24, 24, 12, 30, 0, 30, 6, 30, 15, 54, 6, 48, 12, 30, 12, 36, 0, 24, 3, 24, 0, 54, 6, 18, 30, 15, 6, 42, 9, 36, 0, 21, 30, 15, 12, 12, 0, 24, 3, 72, 0, 51, 39, 24, 12, 30, 3, 33, 18, 15, 12, 42, 0, 30, 12, 27, 24, 51, 12, 42, 12, 18, 3, 42, 12, 39, 18, 12, 0, 30, 0, 24, 21, 21, 21, 30, 6, 66, 12, 12, 6, 69, 21, 30, 0, 24, 6, 45, 12, 12, 18, 42, 12, 18, 0, 39, 30, 33, 12, 54, 0, 12, 0, 12, 18, 36, 9, 30, 9, 24, 9, 60, 12, 30, 12, 12, 0, 42, 9, 42, 18, 45, 24, 42, 6, 12, 9, 24, 6, 30, 12, 42, 0, 30, 6, 15, 15, 30, 12, 18, 12, 54, 6, 21, 30, 12, 33, 60, 0, 48, 0, 30, 15, 42, 6, 24, 24, 30, 0, 36, 18, 33, 18, 12, 0, 60, 0, 72, 15, 12, 9, 30, 12, 24, 15, 21, 24, 51, 12, 24, 0, 24, 6, 12, 6, 33, 24, 36, 9, 54, 6, 27, 24, 30, 6, 48, 0, 24, 3, 36, 27, 42, 15, 18, 18, 12, 6, 54, 6, 30, 15, 36, 0, 12, 12, 18, 24, 21, 18, 30, 3, 60, 0, 33, 12, 36, 18, 48, 0, 24, 1, 39, 12, 24, 18, 24, 9, 66, 6, 48, 24, 12, 12, 42, 0, 24, 6, 18, 12, 63, 6, 36, 24, 18, 0, 39, 12, 39, 24, 24, 0, 54, 6, 15, 24, 15, 24, 48, 3, 36, 12, 12, 24, 39, 18, 36, 0, 42, 6, 42, 6, 60, 24, 12, 18, 18, 0, 45, 6, 6, 6, 72, 0, 30, 6, 24, 9, 36, 12, 24, 9, 30, 15, 36, 18, 33, 24, 6, 0, 54, 0, 33, 36, 18, 24, 36, 6, 18, 6, 24, 18, 75, 6, 18, 0, 18, 0, 48, 9, 36, 18, 42, 9, 30, 0, 27, 36, 24, 15, 42, 0, 42, 18, 36, 12, 18, 12, 72, 9, 24, 0, 54, 18, 21, 24, 12, 0, 60, 0, 24, 24, 39, 12, 42, 18, 30, 6, 9, 12, 48, 12, 30, 0, 18, 12, 36, 15, 48, 18, 18, 3, 42, 6, 42, 18, 18, 24, 54, 0, 36, 0, 24, 36, 42, 0, 12, 27, 30, 6, 60, 6, 30, 24, 12, 0, 36, 3, 42, 12, 18, 12, 36, 9, 30, 0, 15, 18, 33, 12, 54, 0, 30, 6, 33, 21, 27, 30, 42, 12, 54, 9, 42, 24, 27, 6, 36, 0, 24, 12, 24, 12, 45, 24, 12, 6, 30, 12, 69, 12, 42, 12, 30, 0, 24, 0, 42, 18, 24, 15, 60, 9, 48, 18, 18, 24, 27, 12, 36, 0, 30, 0, 54, 9, 30, 18, 24, 15, 48, 0, 24, 24, 45, 24, 24, 0, 18, 6, 36, 9, 54, 15, 24, 12, 12, 6, 18, 12, 54, 18, 12, 0, 60, 3, 48, 30, 12, 18, 60, 6, 24, 3, 36, 12, 33, 12, 36, 0, 36, 6, 36, 3, 33, 24, 12, 13, 42, 12, 27, 18, 30, 12, 54, 0, 30, 12, 21, 39, 54, 6, 54, 18, 18, 0, 33, 12, 36, 36, 36, 0, 30, 0, 42, 33, 18, 18, 36, 12, 30, 3, 30, 12, 66, 6, 30, 0, 18, 12, 63, 18, 24, 6, 30, 12, 48, 9, 6, 24, 30, 12, 42, 0, 72, 0, 30, 12, 48, 3, 24, 15, 12, 12, 66, 18, 9, 36, 12, 0, 54, 0, 54, 18, 15, 30, 36, 6, 12, 0, 21, 18, 54, 12, 30, 0, 6, 0, 36, 15, 60, 18, 18, 15, 48, 6, 27, 24, 21, 12, 54, 0, 54, 9, 12, 24, 48, 12, 48, 15, 54, 6, 36, 6, 39, 24, 24, 0, 24, 3, 33, 24, 18, 18, 66, 12, 18, 12, 30, 12, 75, 15, 36, 0, 30, 9, 24, 6, 21, 24, 24, 12, 60, 0, 66, 36, 12, 18, 36, 0, 24, 6, 30, 18, 39, 18, 30, 12, 24, 9, 30, 6, 36, 18, 18, 0, 54, 12, 33, 24, 36, 6, 66, 0, 30, 6, 12, 12, 33, 24, 54, 0, 18, 3, 60, 3, 30, 24, 24, 21, 48, 0, 18, 30, 51, 12, 18, 0, 30, 12, 33, 15, 18, 12, 30, 27, 24, 0, 48, 12, 45, 6, 30, 0, 72, 0, 51, 18, 27, 27, 54, 9, 48, 12, 27, 30, 36, 18, 18, 0, 42, 3, 36, 9, 45, 30, 6, 6, 36, 3, 51, 24, 24, 18, 72, 0, 18, 6, 9, 36, 42, 0, 36, 9, 30, 12, 60, 30, 24, 15, 24, 0, 36, 6, 30, 27, 27, 18, 42, 12, 48, 0, 42, 0, 33, 24, 24, 0, 30, 0, 42, 12, 48, 9, 36, 9, 24, 6, 27, 36, 12, 9, 60, 0, 30, 12, 15, 18, 42, 18, 36, 18, 24, 7, 48, 12, 54, 24, 30, 0, 78, 0, 18, 18, 27, 24, 24, 6, 30, 12, 33, 18, 60, 15, 54, 0, 12, 12, 36, 12, 36, 24, 30, 18, 54, 0, 18, 18, 18, 24, 84, 0, 54, 0, 27, 15, 42, 6, 36, 12, 18, 9, 54, 6, 30, 30, 24, 0, 30, 9, 60, 30, 36, 6, 42, 12, 30, 6, 6, 30, 60, 0, 18, 0, 24, 9, 51, 18, 24, 33, 30, 0, 42, 12, 60, 18, 18, 36, 18, 0, 24, 0, 18, 9, 78, 12, 48, 24, 12, 0, 48, 6, 12, 18, 42, 0, 48, 0, 30, 27, 18, 6, 48, 3, 66, 21, 18, 18, 33, 12, 48, 0, 30, 6, 63, 21, 18, 36, 24, 15, 60, 6, 36, 30, 36, 0, 48, 0, 48, 3, 36, 30, 42, 18, 24, 24, 12, 6, 21, 6, 72, 12, 36, 0, 60, 6, 12, 18, 15, 24, 60, 9, 30, 0, 39, 30, 54, 12, 18, 0, 18, 3, 60, 9, 57, 24, 6, 18, 48, 6, 60, 18, 18, 9, 48, 0, 24, 12, 18, 18, 39, 6, 42, 15, 36, 6, 36, 18, 18, 30, 18, 0, 42, 6, 39, 27, 27, 18, 48, 12, 42, 12, 24, 18, 27, 9, 30, 0, 24, 9, 81, 12, 72, 12, 30, 6, 36, 0, 33, 42, 39, 30, 42, 0, 12, 3, 12, 6, 24, 18, 48, 12, 48, 3, 63, 24, 24, 27, 30, 0, 78, 6, 36, 18, 36, 30, 30, 12, 36, 12, 30, 6, 60, 12, 48, 0, 24, 0, 36, 21, 30, 24, 30, 12, 48, 0, 36, 12, 24, 27, 36, 0, 42, 12, 27, 24, 54, 6, 18, 12, 48, 0, 30, 6, 72, 24, 12, 0, 30, 3, 45, 24, 0, 18, 78, 15, 18, 18, 39, 18, 39, 9, 36, 0, 24, 6, 39, 12, 30, 18, 30, 16, 48, 0, 36, 30, 12, 12, 60, 0, 42, 3, 24, 21, 84, 33, 30, 12, 18, 18, 48, 12, 36, 12, 30, 0, 48, 9, 42, 36, 42, 6, 48, 3, 42, 0, 33, 24, 30, 12, 36, 0, 36, 6, 54, 12, 30, 30, 6, 21, 66, 0, 39, 24, 36, 24, 36, 0, 24, 12, 30, 15, 54, 12, 78, 30, 6, 0, 33, 12, 27, 30, 30, 0, 36, 6, 18, 36, 36, 6, 66, 3, 60, 6, 18, 30, 42, 0, 12, 0, 36, 6, 54, 6, 33, 24, 24, 12, 54, 0, 42, 12, 15, 12, 60, 0, 30, 0, 21, 18, 75, 18, 48, 18, 18, 15, 30, 24, 42, 33, 36, 0, 30, 6, 45, 24, 9, 30, 36, 3, 54, 15, 24, 18, 63, 18, 42, 0, 24, 0, 75, 6, 30, 9, 30, 15, 42, 12, 33, 36, 21, 24, 60, 0, 54, 9, 30, 30, 48, 12, 18, 12, 24, 0, 66, 12, 24, 18, 36, 0, 72, 6, 36, 15, 27, 27, 30, 6, 12, 18, 24, 6, 78, 15, 42, 0, 12, 6, 27, 24, 51, 18, 36, 12, 60, 3, 51, 30, 12, 24, 36, 0, 30, 0, 48, 12, 21, 6, 36, 24, 54, 6, 42, 6, 36, 36, 6, 0, 54, 12, 27, 15, 18, 18, 66, 6, 42, 0, 15, 30, 63, 12, 48, 0, 36, 3, 63, 12, 36, 30, 18, 9, 48, 3, 48, 36, 30, 12, 42, 0, 72, 6, 36, 30, 30, 12, 24, 12, 6, 15, 75, 18, 30, 6, 36, 0, 24, 0, 18, 36, 48, 18, 60, 18, 60, 12, 33, 12, 33, 15, 72, 0, 18, 9, 54, 15, 21, 30, 36, 12, 30, 0, 42, 24, 48, 18, 36, 0, 24, 6, 18, 15, 81, 12, 12, 27, 36, 12, 30, 6, 36, 18, 24, 0, 48, 6, 36, 36, 27, 6, 48, 9, 36, 3, 36, 36, 36, 24, 30, 0, 24, 1, 42, 6, 66, 27, 24, 18, 48, 12, 51, 18, 24, 18, 84, 0, 24, 6, 12, 9, 63, 18, 48, 9, 30, 0, 36, 12, 33, 24, 30, 0, 72, 0, 42, 48, 36, 18, 42, 12, 42, 15, 24, 12, 60, 15, 24, 0, 12, 21, 72, 3, 42, 30, 24, 18, 36, 6, 42, 18, 30, 12, 42, 0, 48, 12, 12, 24, 24, 18, 66, 6, 24, 0, 93, 12, 51, 30, 12, 0, 54, 6, 18, 27, 24, 24, 36, 12, 30, 0, 45, 18, 60, 6, 54, 0, 24, 0, 51, 24, 21, 18, 30, 6, 72, 6, 6, 18, 21, 36, 42, 0, 48, 12, 27, 24, 36, 6, 30, 27, 30, 6, 39, 18, 51, 36, 30, 0, 42, 0, 66, 18, 36, 6, 66, 9, 24, 12, 24, 24, 78, 12, 36, 0, 36, 12, 60, 15, 42, 24, 6, 15, 54, 0, 33, 30, 21, 30, 42, 0, 54, 0, 24, 9, 60, 9, 36, 24, 24, 6, 66, 12, 48, 18, 54, 0, 30, 0, 30, 39, 30, 18, 48, 6, 42, 12, 33, 24, 33, 12, 60, 0, 18, 6, 42, 24, 42, 24, 6, 12, 72, 6, 42, 30, 18, 9, 30, 0, 24, 15, 30, 18, 60, 12, 54, 15, 24, 0, 48, 24, 33, 12, 36, 0, 66, 6, 36, 18, 21, 30, 72, 3, 24, 9, 27, 30, 30, 18, 42, 0, 42, 0, 72, 6, 39, 42, 24, 18, 60, 3, 24, 18, 36, 18, 30, 0, 54, 6, 27, 33, 60, 12, 24, 24, 18, 18, 30, 12, 21, 33, 48, 0, 78, 12, 78, 12, 30, 12, 42, 12, 48, 0, 24, 12, 75, 18, 24, 0, 18, 0, 33, 24, 30, 21, 42, 15, 30, 12, 39, 30, 51, 12, 54, 0, 36, 12, 18, 12, 48, 24, 78, 18, 18, 6, 78, 6, 24, 30, 12, 0, 42, 0, 45, 18, 15, 27, 42, 0, 54, 18, 36, 18, 36, 6, 48, 0, 30, 12, 36, 21, 45, 6, 24, 7, 54, 0, 27, 42, 33, 24, 72, 0, 42, 0, 48, 24, 45, 18, 18, 15, 36, 15, 66, 6, 66, 30, 18, 0, 48, 0, 27, 39, 30, 18, 66, 27, 12, 12, 18, 24, 60, 6, 66, 0, 42, 0, 42, 6, 33, 21, 36, 12, 42, 6, 21, 36, 33, 21, 48, 0, 66, 12, 6, 18, 75, 24, 36, 12, 18, 0, 81, 12, 42, 30, 36, 0, 24, 0, 30, 30, 30, 6, 60, 9, 60, 6, 24, 30, 30, 6, 30, 0, 30, 12, 75, 18, 30, 24, 24, 15, 78, 0, 42, 24, 18, 30, 42, 0, 30, 12, 21, 12, 48, 9, 60, 21, 30, 12, 24, 24, 39, 21, 24, 0, 54, 3, 39, 30, 33, 24, 72, 12, 60, 0, 18, 24, 57, 12, 24, 0, 24, 3, 90, 9, 12, 21, 36, 12, 30, 18, 84, 24, 30, 9, 60, 0, 36, 18, 18, 24, 78, 18, 24, 18, 48, 6, 24, 0, 45, 30, 24, 0, 66, 3, 60, 36, 21, 42, 42, 6, 30, 6, 33, 12, 60, 21, 36, 0, 6, 6, 36, 15, 36, 30, 48, 21, 48, 0, 39, 36, 36, 6, 54, 0, 66, 3, 18, 18, 33, 24, 36, 18, 30, 9, 66, 6, 15, 36, 24, 0, 96, 6, 30, 12, 42, 6, 36, 6, 36, 9, 27, 36, 42, 12, 42, 0, 18, 6, 51, 12, 78, 18, 30, 9, 54, 12, 39, 24, 24, 33, 66, 0, 36, 9, 45, 33, 36, 12, 18, 27, 36, 0, 78, 12, 48, 24, 30, 0, 42, 9, 48, 21, 18, 9, 60, 12, 54, 6, 21, 24, 72, 3, 66, 0, 18, 18, 33, 12, 21, 36, 36, 6, 36, 6, 60, 36, 36, 18, 48, 0, 24, 0, 30, 24, 87, 24, 24, 27, 42, 6, 60, 18, 66, 6, 18, 0, 36, 6, 39, 36, 30, 18, 36, 9, 30, 0, 18, 18, 51, 12, 48, 0, 54, 0, 48, 18, 36, 30, 36, 30, 66, 3, 12, 18, 15, 39, 60, 0, 24, 12, 66, 6, 54, 12, 48, 6, 18, 7, 30, 24, 48, 18, 30, 0, 84, 0, 30, 48, 12, 15, 60, 9, 42, 18, 42, 18, 42, 18, 48, 0, 30, 9, 48, 21, 69, 36, 12, 12, 48, 0, 57, 18, 24, 24, 66, 0, 36, 6, 24, 21, 69, 6, 54, 12, 30, 18, 72, 18, 30, 30, 18, 0, 42, 0, 42, 42, 12, 18, 42, 6, 54, 9, 42, 12, 72, 18, 24, 0, 24, 3, 78, 0, 24, 24, 30, 15, 60, 6, 42, 30, 39, 21, 36, 0, 54, 12, 27, 24, 42, 24, 72, 21, 30, 0, 48, 18, 24, 30, 12, 0, 30, 3, 24, 15, 72, 33, 42, 6, 24, 24, 12, 24, 66, 12, 60, 0, 24, 6, 63, 12, 42, 18, 24, 18, 84, 6, 30, 24, 24, 6, 90, 0, 72, 6, 21, 24, 30, 18, 18, 30, 24, 6, 66, 18, 54, 18, 36, 0, 36, 12, 60, 27, 30, 18, 90, 18, 18, 0, 18, 24, 48, 24, 30, 0, 36, 6, 36, 18, 66, 36, 30, 3, 66, 3, 57, 48, 12, 18, 36, 0, 48, 6, 36, 21, 48, 0, 60, 12, 36, 12, 72, 0, 36, 30, 30, 0, 48, 0, 33, 30, 48, 9, 54, 9, 36, 24, 18, 30, 42, 18, 54, 0, 12, 0, 54, 12, 21, 24, 30, 21, 72, 0, 66, 24, 27, 18, 36, 0, 24, 0, 45, 24, 78, 0, 42, 21, 24, 12, 39, 30, 54, 30, 24, 0, 84, 15, 24, 24, 9, 30, 54, 9, 48, 6, 33, 18, 57, 18, 30, 0, 60, 3, 54, 27, 33, 30, 36, 24, 42, 0, 54, 18, 39, 24, 54, 0, 60, 18, 24, 15, 75, 12, 24, 12, 42, 0, 39, 12, 36, 36, 36, 0, 30, 3, 66, 42, 15, 24, 72, 12, 48, 12, 42, 12, 48, 15, 24, 0, 18, 18, 60, 6, 60, 18, 36, 9, 24, 6, 27, 36, 30, 24, 90, 0, 60, 3, 21, 18, 54, 24, 48, 18, 18, 12, 51, 24, 39, 18, 18, 0, 72, 12, 42, 21, 36, 24, 36, 6, 36, 0, 33, 18, 42, 0, 60, 0, 18, 6, 42, 21, 39, 39, 36, 13, 84, 6, 24, 18, 30, 24, 78, 0, 36, 3, 54, 39, 51, 18, 30, 21, 24, 3, 60, 12, 87, 42, 30, 0, 36, 6, 30, 15, 36, 12, 54, 18, 42, 12, 27, 24, 84, 15, 42, 0, 18, 9, 54, 18, 30, 30, 48, 12, 72, 0, 54, 42, 9, 12, 36, 0, 60, 0, 27, 21, 78, 18, 42, 30, 30, 6, 54, 6, 30, 18, 24, 0, 60, 12, 42, 36, 48, 24, 54, 6, 36, 15, 12, 48, 21, 12, 30, 0, 36, 0, 102, 6, 18, 12, 24, 9, 60, 12, 48, 24, 33, 30, 66, 0, 30, 12, 30, 15, 60, 12, 54, 36, 30, 0, 36, 6, 72, 18, 36, 0, 54, 0, 30, 36, 9, 15, 60, 0, 60, 15, 39, 12, 63, 18, 42, 0, 30, 18, 60, 21, 57, 30, 0, 18, 54, 3, 75, 30, 48, 24, 42, 0, 24, 12, 36, 42, 57, 9, 48, 9, 36, 6, 45, 12, 24, 48, 54, 0, 66, 0, 45, 33, 30, 18, 54, 18, 36, 0, 36, 6, 54, 30, 54, 0, 36, 0, 66, 12, 42, 21, 24, 18, 48, 6, 21, 48, 42, 12, 60, 0, 84, 12, 0, 12, 54, 24, 36, 18, 18, 12, 81, 18, 33, 18, 12, 0, 66, 3, 66, 6, 33, 48, 48, 6, 24, 24, 36, 18, 60, 6, 36, 0, 24, 6, 39, 21, 42, 18, 42, 12, 60, 0, 24, 30, 33, 36, 72, 0, 30, 0, 36, 36, 42, 12, 36, 15, 24, 15, 75, 30, 63, 27, 24, 0, 42, 6, 63, 30, 18, 12, 108, 9, 48, 12, 24, 12, 72, 18, 30, 0, 54, 6, 30, 9, 63, 27, 48, 15, 36, 6, 48, 36, 18, 12, 54, 0, 42, 9, 36, 36, 63, 18, 36, 24, 36, 0, 75, 6, 63, 24, 36, 0, 48, 6, 27, 39, 30, 18, 30, 9, 54, 18, 36, 18, 39, 21, 66, 0, 30, 0, 54, 18, 42, 36, 12, 24, 108, 0, 30, 24, 42, 12, 48, 0, 24, 0, 15, 9, 48, 18, 66, 24, 24, 12, 54, 12, 36, 21, 54, 0, 54, 18, 45, 42, 36, 24, 42, 3, 36, 0, 42, 48, 42, 12, 36, 0, 36, 1, 60, 18, 36, 18, 36, 15, 54, 9, 60, 30, 24, 21, 48, 0, 24, 18, 24, 18, 90, 6, 72, 15, 36, 9, 48, 6, 36, 42, 48, 0, 78, 3, 54, 27, 18, 36, 48, 15, 54, 12, 30, 24, 84, 12, 18, 0, 18, 12, 105, 12, 24, 30, 30, 18, 36, 0, 60, 30, 27, 12, 48, 0, 90, 6, 18, 18, 33, 21, 42, 24, 24, 12, 45, 24, 60, 36, 36, 0, 66, 6, 27, 15, 42, 24, 60, 12, 18, 9, 30, 18, 84, 12, 72, 0, 12, 6, 42, 21, 45, 12, 18, 9, 96, 12, 21, 30, 30, 24, 66, 0, 48, 12, 42, 18, 36, 18, 24, 24, 24, 0, 30, 12, 27, 42, 18, 0, 72, 0, 84, 27, 54, 15, 102, 12, 36, 6, 39, 36, 36, 15, 36, 0, 30, 15, 57, 12, 57, 42, 30, 9, 60, 6, 27, 42, 27, 30, 36, 0, 54, 6, 24, 21, 78, 12, 42, 18, 18, 12, 84, 18, 54, 18, 48, 0, 66, 12, 15, 36, 30, 18, 72, 9, 66, 0, 27, 18, 24, 6, 78, 0, 42, 6, 81, 27, 27, 36, 24, 24, 48, 0, 72, 18, 39, 30, 42, 0, 18, 18, 30, 24, 78, 6, 18, 18, 36, 0, 48, 30, 84, 6, 18, 0, 54, 0, 42, 36, 12, 30, 90, 12, 48, 18, 24, 18, 21, 18, 48, 0, 60, 0, 60, 6, 30, 42, 24, 18, 66, 0, 27, 36, 24, 18, 54, 0, 48, 6, 30, 18, 90, 15, 42, 9, 48, 18, 42, 6, 45, 24, 36, 0, 48, 0, 78, 39, 27, 12, 42, 27, 48, 6, 45, 18, 72, 36, 48, 0, 18, 9, 66, 9, 54, 33, 18, 18, 66, 12, 39, 36, 45, 12, 72, 0, 48, 12, 21, 39, 33, 18, 60, 18, 36, 0, 78, 18, 39, 36, 24, 0, 30, 0, 30, 30, 54, 21, 66, 6, 30, 21, 39, 18, 60, 15, 72, 0, 30, 18, 45, 12, 39, 18, 60, 6, 66, 15, 36, 30, 12, 18, 60, 0, 60, 0, 18, 33, 57, 18, 24, 24, 42, 6, 66, 12, 81, 42, 18, 0, 36, 6, 42, 18, 24, 24, 72, 0, 18, 0, 30, 30, 87, 18, 36, 0, 42, 3, 45, 12, 36, 42, 24, 25, 30, 6, 72, 24, 18, 18, 60, 0, 102, 12, 42, 12, 90, 12, 24, 27, 24, 12, 69, 24, 30, 18, 42, 0, 48, 0, 42, 45, 39, 15, 60, 18, 30, 12, 33, 24, 72, 18, 36, 0, 24, 12, 51, 24, 39, 36, 24, 6, 120, 0, 72, 24, 30, 30, 30, 0, 24, 12, 72, 18, 54, 3, 84, 30, 30, 21, 42, 24, 30, 18, 30, 0, 54, 0, 36, 30, 24, 30, 72, 9, 72, 6, 30, 24, 36, 24, 30, 0, 30, 0, 90, 12, 48, 27, 24, 6, 54, 12, 39, 36, 18, 18, 78, 0, 36, 12, 18, 39, 66, 6, 54, 18, 36, 0, 54, 18, 42, 12, 30, 0, 78, 0, 48, 45, 27, 36, 36, 9, 54, 15, 6, 12, 99, 15, 48, 0, 24, 3, 60, 12, 45, 36, 36, 30, 24, 12, 57, 30, 42, 18, 54, 0, 36, 6, 45, 24, 63, 30, 60, 12, 42, 6, 102, 18, 30, 33, 18, 0, 84, 12, 54, 24, 39, 12, 42, 0, 36, 0, 54, 24, 60, 12, 42, 0, 48, 6, 30, 9, 93, 24, 18, 21, 60, 6, 21, 36, 18, 54, 102, 0, 30, 18, 36, 21, 48, 12, 30, 27, 42, 3, 54, 12, 66, 36, 36, 0, 48, 9, 45, 33, 30, 9, 84, 18, 30, 12, 33, 36, 51, 12, 54, 0, 36, 18, 42, 12, 30, 36, 24, 9, 72, 0, 48, 30, 36, 6, 78, 0, 42, 0, 18, 24, 63, 21, 36, 18, 24, 15, 66, 0, 42, 27, 54, 0, 30, 9, 51, 45, 45, 24, 48, 12, 72, 12, 33, 24, 39, 30, 66, 0, 18, 6, 69, 12, 36, 24, 36, 18, 90, 6, 60, 24, 36, 27, 36, 0, 60, 18, 33, 21, 84, 12, 36, 30, 18, 0, 33, 24, 51, 30, 24, 0, 84, 0, 57, 33, 36, 21, 84, 12, 30, 12, 33, 36, 63, 18, 24, 0, 30, 6, 90, 21, 66, 30, 30, 24, 36, 0, 54, 12, 51, 18, 78, 0, 36, 0, 18, 18, 54, 21, 48, 12, 66, 18, 21, 18, 33, 21, 42, 0, 66, 6, 48, 54, 21, 30, 66, 12, 66, 0, 24, 24, 63, 24, 36, 0, 42, 3, 60, 18, 30, 6, 36, 9, 54, 6, 72, 48, 36, 15, 54, 0, 30, 27, 12, 18, 60, 12, 66, 15, 48, 10, 84, 12, 39, 42, 12, 0, 66, 6, 24, 18, 21, 36, 54, 24, 24, 12, 51, 18, 66, 12, 90, 0, 18, 6, 87, 15, 75, 24, 30, 15, 60, 0, 24, 42, 24, 24, 48, 0, 84, 6, 51, 39, 60, 12, 18, 30, 36, 12, 60, 12, 60, 48, 36, 0, 54, 6, 42, 12, 6, 18, 78, 6, 48, 12, 12, 36, 84, 0, 48, 0, 54, 3, 48, 18, 45, 51, 54, 6, 72, 6, 51, 30, 45, 30, 48, 0, 36, 6, 36, 15, 78, 24, 42, 24, 24, 0, 90, 18, 36, 24, 24, 0, 36, 0, 36, 30, 30, 30, 66, 6, 78, 21, 30, 12, 21, 15, 60, 0, 36, 12, 66, 21, 36, 24, 30, 18, 60, 9, 54, 48, 24, 18, 48, 0, 30, 6, 42, 18, 81, 18, 54, 27, 24, 12, 30, 18, 84, 30, 24, 0, 102, 9, 42, 42, 36, 24, 90, 3, 30, 0, 60, 30, 42, 18, 24, 0, 18, 0, 78, 12, 42, 27, 42, 18, 66, 18, 45, 18, 42, 9, 84, 0, 54, 6, 15, 54, 63, 18, 54, 24, 24, 9, 57, 24, 45, 54, 36, 0, 60, 0, 66, 27, 33, 18, 30, 9, 60, 24, 30, 12, 54, 21, 24, 0, 12, 18, 108, 15, 66, 12, 30, 27, 66, 0, 36, 30, 36, 24, 66, 0, 60, 0, 9, 24, 54, 12, 90, 15, 42, 0, 51, 30, 18, 30, 48, 0, 84, 9, 48, 21, 54, 30, 24, 18, 36, 12, 45, 18, 96, 6, 30, 0, 30, 9, 30, 24, 42, 24, 24, 15, 66, 6, 69, 36, 15, 15, 84, 0, 36, 15, 48, 27, 45, 18, 42, 30, 36, 0, 66, 6, 72, 30, 48, 0, 42, 3, 51, 39, 30, 33, 78, 12, 24, 18, 30, 18, 105, 21, 72, 0, 42, 12, 39, 18, 27, 42, 24, 6, 66, 3, 60, 42, 30, 30, 60, 0, 54, 6, 54, 24, 57, 6, 54, 6, 24, 24, 54, 12, 57, 27, 42, 0, 48, 6, 36, 27, 57, 12, 84, 12, 60, 0, 12, 30, 54, 24, 48, 0, 18, 3, 105, 36, 48, 42, 24, 18, 48, 6, 30, 36, 45, 42, 42, 0, 54, 9, 36, 12, 48, 12, 54, 30, 30, 6, 48, 6, 51, 18, 36, 0, 102, 6, 18, 30, 33, 24, 48, 18, 60, 12, 60, 30, 45, 12, 36, 0, 54, 12, 60, 6, 48, 54, 12, 13, 60, 0, 72, 18, 24, 6, 90, 0, 48, 12, 15, 42, 96, 18, 36, 18, 36, 6, 78, 24, 48, 18, 30, 0, 48, 18, 78, 42, 24, 30, 60, 6, 60, 12, 18, 12, 42, 30, 42, 0, 24, 0, 81, 9, 54, 18, 60, 33, 48, 0, 27, 54, 51, 27, 90, 0, 60, 18, 24, 18, 54, 24, 36, 12, 42, 0, 87, 24, 33, 18, 24, 0, 96, 0, 87, 36, 30, 15, 42, 12, 36, 24, 24, 36, 42, 21, 48, 0, 30, 6, 42, 18, 48, 24, 24, 18, 84, 3, 36, 42, 42, 36, 72, 0, 54, 6, 30, 15, 60, 6, 78, 30, 24, 6, 72, 6, 66, 45, 24, 0, 42, 21, 36, 30, 36, 18, 48, 12, 30, 0, 39, 24, 102, 18, 36, 0, 12, 6, 54, 6, 30, 33, 66, 21, 90, 3, 78, 36, 9, 18, 36, 0, 84, 0, 30, 30, 93, 24, 30, 24, 30, 15, 63, 12, 48, 30, 54, 0, 48, 0, 54, 42, 42, 30, 78, 0, 36, 24, 39, 24, 60, 12, 78, 0, 60, 6, 51, 30, 36, 36, 30, 18, 60, 0, 30, 30, 51, 24, 60, 0, 42, 3, 24, 9, 54, 21, 24, 33, 30, 24, 66, 24, 69, 18, 30, 0, 102, 15, 54, 24, 15, 30, 120, 6, 30, 3, 51, 24, 54, 12, 30, 0, 36, 6, 36, 12, 90, 42, 12, 12, 60, 12, 60, 24, 42, 12, 90, 0, 24, 12, 42, 30, 30, 6, 78, 21, 42, 0, 54, 24, 27, 54, 24, 0, 66, 6, 45, 30, 12, 30, 42, 12, 84, 15, 36, 18, 84, 24, 36, 0, 30, 18, 72, 18, 60, 24, 48, 12, 54, 6, 36, 54, 42, 12, 42, 0, 60, 0, 51, 48, 54, 9, 36, 27, 24, 6, 84, 18, 48, 30, 42, 0, 78, 0, 48, 27, 27, 48, 42, 18, 36, 0, 39, 18, 99, 24, 102, 0, 18, 0, 48, 18, 72, 15, 36, 12, 84, 12, 24, 12, 30, 39, 84, 0, 36, 12, 39, 39, 63, 24, 42, 24, 66, 6, 72, 18, 18, 24, 30, 0, 60, 6, 48, 42, 36, 15, 78, 6, 48, 30, 12, 36, 54, 12, 36, 0, 42, 6, 45, 6, 69, 24, 72, 21, 48, 0, 57, 48, 12, 24, 48, 0, 48, 3, 48, 15, 78, 24, 60, 18, 12, 12, 111, 24, 54, 24, 24, 0, 48, 6, 36, 33, 42, 6, 54, 9, 72, 18, 27, 30, 30, 12, 54, 0, 66, 4, 78, 21, 24, 54, 18, 24, 54, 6, 60, 24, 54, 21, 78, 0, 36, 18, 54, 30, 66, 18, 48, 30, 24, 0, 42, 12, 99, 36, 30, 0, 90, 6, 18, 30, 30, 24, 78, 6, 66, 9, 24, 42, 78, 30, 42, 0, 18, 12, 102, 6, 33, 24, 18, 12, 66, 9, 54, 24, 24, 36, 84, 0, 60, 6, 39, 15, 78, 12, 42, 21, 42, 18, 42, 18, 18, 42, 24, 0, 48, 3, 105, 51, 42, 30, 42, 18, 72, 0, 24, 24, 102, 6, 36, 0, 36, 9, 99, 12, 48, 21, 48, 18, 42, 6, 36, 42, 18, 12, 78, 0, 48, 30, 30, 18, 36, 30, 42, 9, 42, 6, 60, 12, 39, 30, 24, 0, 78, 0, 48, 30, 39, 27, 102, 24, 30, 12, 51, 12, 66, 9, 48, 0, 30, 18, 45, 39, 87, 30, 36, 9, 72, 0, 60, 24, 30, 36, 54, 0, 48, 0, 45, 36, 45, 18, 42, 27, 60, 9, 66, 12, 78, 42, 18, 0, 60, 6, 60, 33, 36, 24, 96, 12, 18, 12, 12, 36, 72, 0, 78, 0, 36, 6, 60, 24, 27, 51, 42, 24, 84, 12, 57, 48, 30, 24, 42, 0, 60, 12, 24, 18, 96, 12, 30, 30, 30, 0, 93, 18, 48, 18, 60, 0, 48, 6, 54, 36, 30, 12, 42, 9, 60, 18, 12, 24, 69, 6, 60, 0, 54, 6, 33, 15, 60, 36, 30, 18, 90, 3, 72, 24, 54, 54, 42, 0, 18, 9, 60, 30, 84, 18, 48, 24, 12, 6, 66, 36, 24, 27, 24, 0, 42, 12, 39, 42, 27, 18, 108, 9, 78, 0, 48, 12, 54, 30, 30, 0, 36, 0, 48, 12, 75, 39, 30, 6, 42, 9, 66, 30, 33, 18, 96, 0, 48, 18, 39, 36, 102, 12, 54, 18, 24, 9, 45, 24, 72, 30, 36, 0, 78, 6, 63, 36, 36, 21, 60, 9, 36, 12, 54, 24, 78, 27, 42, 0, 42, 18, 60, 9, 24, 24, 54, 39, 84, 0, 27, 36, 39, 12, 84, 0, 66, 0, 21, 30, 30, 42, 66, 18, 18, 18, 78, 12, 48, 42, 36, 0, 90, 6, 48, 33, 39, 24, 48, 15, 54, 15, 54, 24, 48, 18, 60, 0, 24, 0, 48, 24, 78, 24, 36, 9, 90, 12, 42, 24, 30, 45, 54, 0, 66, 12, 24, 12, 60, 6, 48, 33, 48, 0, 60, 6, 51, 54, 12, 0, 30, 0, 69, 21, 42, 15, 72, 15, 48, 21, 33, 36, 96, 6, 30, 0, 54, 6, 87, 30, 42, 30, 36, 13, 42, 6, 84, 48, 18, 18, 72, 0, 54, 12, 30, 30, 75, 24, 36, 24, 42, 18, 78, 12, 36, 30, 72, 0, 48, 6, 33, 36, 57, 36, 66, 6, 54, 0, 27, 36, 66, 12, 90, 0, 24, 3, 96, 24, 27, 24, 18, 24, 108, 12, 42, 48, 24, 18, 30, 0, 54, 18, 48, 12, 75, 18, 90, 21, 36, 12, 72, 12, 45, 24, 24, 0, 114, 0, 27, 30, 39, 33, 48, 12, 54, 12, 18, 42, 45, 27, 48, 0, 48, 6, 90, 9, 60, 42, 36, 12, 48, 0, 36, 42, 42, 18, 78, 0, 30, 6, 24, 33, 78, 9, 84, 30, 18, 15, 63, 18, 51, 30, 48, 0, 72, 6, 36, 51, 24, 30, 48, 21, 96, 6, 24, 6, 93, 12, 48, 0, 18, 6, 69, 18, 36, 18, 24, 18, 24, 6, 54, 36, 51, 33, 96, 0, 36, 15, 27, 30, 54, 30, 42, 12, 36, 0, 117, 36, 54, 36, 24, 0, 96, 3, 72, 36, 57, 27, 54, 6, 54, 21, 36, 12, 66, 33, 60, 0, 30, 24, 24, 15, 63, 30, 42, 24, 78, 9, 39, 30, 24, 24, 138, 0, 42, 0, 54, 24, 57, 12, 30, 24, 42, 18, 54, 6, 60, 33, 24, 0, 72, 6, 84, 24, 42, 6, 66, 15, 36, 0, 42, 48, 51, 18, 66, 0, 60, 3, 60, 12, 60, 57, 42, 9, 72, 12, 60, 42, 27, 24, 60, 0, 42, 18, 24, 30, 48, 30, 36, 18, 30, 9, 78, 12, 51, 18, 30, 0, 60, 0, 12, 57, 51, 18, 78, 6, 102, 12, 30, 24, 48, 27, 36, 0, 30, 12, 126, 6, 27, 36, 30, 18, 66, 0, 60, 30, 48, 36, 48, 0, 24, 6, 39, 24, 96, 12, 90, 33, 36, 6, 39, 6, 90, 27, 36, 0, 60, 12, 45, 42, 30, 30, 72, 12, 36, 9, 39, 36, 69, 24, 48, 0, 36, 6, 66, 15, 72, 39, 36, 27, 54, 18, 57, 30, 42, 12, 60, 0, 84, 24, 36, 27, 72, 12, 48, 21, 60, 0, 51, 30, 27, 30, 90, 0, 78, 0, 42, 57, 12, 30, 48, 18, 42, 6, 48, 24, 90, 15, 42, 0, 12, 15, 84, 24, 72, 18, 48, 21, 66, 3, 54, 42, 30, 24, 48, 0, 36, 18, 27, 12, 42, 9, 108, 18, 36, 12, 96, 24, 21, 30, 24, 0, 96, 9, 54, 18, 75, 30, 54, 18, 36, 0, 39, 18, 84, 18, 42, 0, 24, 6, 54, 18, 57, 42, 24, 9, 84, 18, 48, 42, 27, 30, 78, 0, 60, 0, 30, 48, 36, 6, 30, 36, 6, 10, 78, 12, 51, 48, 48, 0, 90, 0, 75, 9, 42, 24, 48, 15, 72, 12, 33, 42, 108, 12, 54, 0, 54, 18, 51, 42, 36, 48, 48, 12, 72, 0, 42, 18, 45, 30, 66, 0, 78, 3, 36, 15, 78, 30, 30, 30, 30, 15, 102, 12, 54, 18, 30, 0, 36, 6, 81, 48, 12, 24, 108, 6, 78, 18, 24, 36, 33, 18, 30, 0, 30, 0, 108, 21, 54, 42, 18, 18, 90, 6, 30, 48, 69, 36, 48, 0, 24, 15, 24, 15, 84, 24, 114, 6, 30, 0, 48, 6, 60, 42, 24, 0, 102, 12, 42, 42, 27, 21, 78, 9, 42, 24, 51, 24, 42, 12, 48, 0, 60, 12, 66, 6, 42, 24, 30, 24, 42, 0, 78, 24, 54, 12, 66, 0, 30, 6, 24, 51, 99, 18, 60, 24, 42, 18, 54, 6, 45, 60, 36, 0, 54, 6, 39, 39, 39, 30, 66, 18, 72, 0, 51, 24, 102, 12, 54, 0, 24, 0, 102, 12, 48, 24, 42, 36, 60, 0, 12, 48, 18, 12, 54, 0, 84, 18, 39, 9, 84, 30, 66, 18, 48, 15, 72, 48, 39, 42, 48, 0, 60, 0, 84, 30, 45, 33, 54, 6, 54, 30, 33, 30, 90, 6, 54, 0, 24, 6, 72, 27, 78, 12, 24, 15, 66, 0, 54, 36, 21, 42, 114, 0, 60, 3, 30, 33, 54, 27, 30, 33, 60, 6, 54, 12, 48, 33, 36, 0, 42, 12, 45, 39, 24, 36, 96, 18, 24, 12, 33, 18, 99, 18, 66, 0, 36, 0, 51, 24, 30, 30, 36, 15, 84, 6, 102, 48, 48, 18, 60, 0, 72, 12, 36, 42, 60, 12, 24, 21, 30, 0, 54, 18, 60, 18, 42, 0, 66, 6, 24, 24, 54, 15, 78, 12, 42, 27, 27, 30, 51, 27, 78, 0, 48, 6, 120, 27, 48, 42, 24, 12, 54, 6, 54, 24, 48, 36, 66, 0, 78, 9, 57, 21, 48, 18, 54, 33, 24, 30, 84, 18, 45, 33, 30, 0, 126, 9, 36, 30, 27, 30, 66, 18, 54, 0, 36, 42, 48, 6, 42, 0, 54, 6, 57, 12, 84, 54, 48, 6, 60, 6, 63, 18, 42, 36, 78, 0, 24, 24, 33, 24, 105, 24, 66, 27, 48, 0, 48, 30, 60, 30, 54, 0, 42, 3, 75, 48, 24, 12, 66, 12, 96, 6, 30, 12, 87, 21, 36, 0, 30, 24, 69, 12, 57, 30, 48, 24, 54, 0, 42, 54, 24, 24, 72, 0, 60, 0, 48, 24, 69, 24, 42, 18, 36, 12, 66, 24, 36, 42, 18, 0, 78, 9, 48, 36, 42, 42, 36, 12, 36, 21, 78, 18, 48, 12, 102, 0, 18, 12, 54, 24, 45, 27, 42, 13, 108, 12, 39, 24, 42, 27, 102, 0, 60, 6, 39, 24, 54, 12, 54, 24, 24, 0, 114, 24, 63, 48, 30, 0, 48, 6, 69, 36, 18, 12, 72, 6, 48, 18, 33, 54, 117, 12, 42, 0, 66, 12, 48, 6, 54, 36, 42, 21, 102, 6, 48, 54, 33, 30, 48, 0, 72, 0, 30, 24, 75, 24, 84, 30, 30, 0, 72, 18, 30, 42, 54, 0, 60, 12, 36, 45, 42, 12, 96, 6, 66, 0, 12, 36, 78, 36, 42, 0, 36, 0, 78, 24, 48, 24, 18, 30, 90, 15, 96, 18, 27, 21, 54, 0, 24, 21, 48, 27, 84, 18, 48, 42, 36, 6, 66, 12, 108, 12, 42, 0, 48, 9, 27, 60, 21, 36, 84, 6, 36, 18, 42, 18, 54, 18, 60, 0, 60, 15, 72, 9, 99, 42, 12, 12, 60, 0, 57, 42, 18, 18, 78, 0, 42, 6, 36, 36, 63, 9, 42, 15, 30, 18, 78, 6, 24, 48, 42, 0, 102, 12, 75, 45, 42, 30, 84, 24, 66, 9, 24, 30, 90, 24, 42, 0, 24, 3, 84, 21, 84, 33, 66, 24, 36, 6, 36, 48, 51, 18, 72, 0, 66, 18, 54, 30, 24, 18, 48, 18, 30, 0, 102, 12, 45, 36, 24, 0, 102, 3, 42, 15, 42, 54, 54, 21, 66, 24, 66, 30, 102, 3, 66, 0, 48, 12, 24, 30, 45, 36, 54, 6, 78, 9, 48, 24, 39, 36, 96, 0, 66, 6, 27, 27, 60, 30, 18, 30, 48, 12, 90, 24, 60, 36, 6, 0, 42, 12, 78, 36, 36, 24, 114, 6, 60, 0, 18, 6, 69, 18, 84, 0, 36, 6, 48, 6, 39, 24, 42, 24, 54, 6, 72, 48, 36, 42, 60, 0, 48, 0, 36, 18, 138, 24, 30, 30, 42, 18, 75, 18, 48, 18, 24, 0, 78, 0, 78, 57, 60, 9, 48, 9, 36, 30, 30, 42, 42, 39, 84, 0, 24, 12, 87, 27, 30, 42, 24, 24, 90, 0, 36, 24, 60, 36, 84, 0, 42, 0, 30, 21, 87, 12, 72, 24, 42, 12, 60, 30, 72, 21, 60, 0, 96, 12, 30, 42, 39, 18, 66, 12, 84, 12, 63, 42, 42, 24, 42, 0, 18, 6, 78, 15, 75, 45, 54, 12, 54, 6, 84, 30, 30, 18, 54, 0, 42, 24, 39, 27, 96, 18, 42, 21, 48, 0, 54, 18, 33, 36, 66, 0, 84, 0, 75, 48, 30, 42, 54, 12, 54, 15, 42, 30, 96, 18, 42, 0, 18, 6, 123, 15, 48, 24, 48, 39, 42, 6, 21, 54, 45, 12, 60, 0, 90, 12, 30, 36, 45, 18, 72, 21, 78, 12, 30, 12, 60, 30, 18, 0, 78, 6, 60, 36, 33, 18, 60, 12, 30, 0, 60, 18, 90, 30, 54, 0, 36, 1, 78, 27, 84, 30, 18, 15, 102, 9, 27, 30, 24, 57, 90, 0, 42, 9, 48, 42, 42, 12, 72, 27, 48, 9, 108, 18, 48, 48, 18, 0, 84, 6, 66, 24, 48, 21, 114, 6, 78, 24, 30, 30, 42, 18, 60, 0, 18, 12, 63, 9, 51, 66, 48, 15, 54, 0, 66, 60, 36, 18, 48, 0, 66, 6, 36, 30, 96, 9, 36, 30, 30, 24, 93, 24, 72, 24, 66, 0, 60, 24, 48, 30, 24, 30, 72, 6, 60, 12, 30, 12, 93, 18, 72, 0, 30, 0, 81, 30, 36, 48, 36, 30, 90, 6, 54, 24, 57, 24, 36, 0, 54, 18, 36, 24, 78, 18, 72, 33, 12, 0, 51, 30, 48, 24, 42, 0, 90, 3, 78, 30, 30, 27, 138, 6, 30, 18, 36, 24, 75, 24, 12, 0, 54, 12, 42, 18, 84, 36, 30, 18, 66, 6, 45, 36, 36, 48, 114, 0, 24, 6, 30, 21, 108, 15, 48, 18, 36, 18, 57, 24, 63, 42, 54, 0, 78, 6, 81, 36, 18, 24, 42, 18, 120, 0, 24, 24, 66, 12, 54, 0, 48, 12, 66, 18, 42, 36, 48, 18, 72, 6, 48, 48, 33, 6, 102, 0, 54, 24, 39, 54, 60, 12, 90, 18, 36, 3, 111, 24, 51, 48, 42, 0, 90, 0, 45, 36, 54, 48, 54, 24, 18, 18, 51, 18, 72, 0, 54, 0, 18, 12, 54, 36, 57, 18, 42, 18, 120, 0, 63, 42, 27, 36, 48, 0, 54, 6, 39, 30, 81, 18, 72, 33, 54, 9, 72, 12, 54, 54, 24, 0, 54, 15, 75, 24, 60, 12, 78, 6, 30, 12, 39, 54, 72, 6, 54, 0, 72, 6, 78, 12, 54, 39, 30, 15, 48, 6, 57, 48, 18, 24, 90, 0, 90, 18, 42, 24, 39, 42, 24, 30, 42, 0, 84, 6, 66, 30, 30, 0, 30, 0, 27, 42, 39, 33, 90, 24, 84, 18, 51, 36, 69, 24, 54, 0, 42, 18, 87, 33, 51, 18, 42, 9, 126, 9, 84, 36, 66, 18, 54, 0, 36, 0, 66, 12, 48, 15, 54, 30, 18, 18, 60, 18, 96, 54, 42, 0, 102, 0, 27, 36, 30, 36, 108, 15, 54, 0, 24, 36, 60, 24, 66, 0, 30, 0, 54, 15, 75, 48, 36, 18, 48, 24, 36, 36, 54, 15, 108, 0, 84, 18}; rep(i, n) { out(vec[i]); } }
replace
77
91
77
705
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPr(i, n) for (int i = (n)-1; i >= 0; --i) #define FORq(i, m, n) for (int i = (m); i <= (n); ++i) #define FORqr(i, m, n) for (int i = (n); i >= (m); --i) #define MP make_pair #define SIN(x, S) (S.count(x) != 0) #define M0(x) memset(x, 0, sizeof(x)) #define FILL(x, y) memset(x, y, sizeof(x)) #define MM(x) memset(x, -1, sizeof(x)) #define ALL(x) (x).begin(), (x).end() #define DB(x) cerr << #x << " = " << x << endl #define DB2(x, y) \ cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n"; #define DEBUG \ int x12345; \ cin >> x12345; typedef pair<int, int> PII; typedef pair<long long, long long> PLL; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<long long> VL; typedef long long ll; typedef long long integer; const long long MOD = 1e9 + 7; /////////////////////////////////////////////// // for template template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } /////////////////////////////////////////////// /// 🍈( '-' 🍈 |AC| int main() { vector<int> ans(10002); int N; cin >> N; FORq(x, 1, N) { FORq(y, 1, N) { FORq(z, 1, N) { int K = x * x + y * y + z * z + x * y + y * z + z * x; if (K > N) continue; ans[K]++; } } } FORq(i, 1, N) { cout << ans[i] << "\n"; } }
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPr(i, n) for (int i = (n)-1; i >= 0; --i) #define FORq(i, m, n) for (int i = (m); i <= (n); ++i) #define FORqr(i, m, n) for (int i = (n); i >= (m); --i) #define MP make_pair #define SIN(x, S) (S.count(x) != 0) #define M0(x) memset(x, 0, sizeof(x)) #define FILL(x, y) memset(x, y, sizeof(x)) #define MM(x) memset(x, -1, sizeof(x)) #define ALL(x) (x).begin(), (x).end() #define DB(x) cerr << #x << " = " << x << endl #define DB2(x, y) \ cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n"; #define DEBUG \ int x12345; \ cin >> x12345; typedef pair<int, int> PII; typedef pair<long long, long long> PLL; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<long long> VL; typedef long long ll; typedef long long integer; const long long MOD = 1e9 + 7; /////////////////////////////////////////////// // for template template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } /////////////////////////////////////////////// /// 🍈( '-' 🍈 |AC| int main() { vector<int> ans(10002); int N; cin >> N; FORq(x, 1, 101) { FORq(y, 1, 101) { FORq(z, 1, 101) { int K = x * x + y * y + z * z + x * y + y * z + z * x; if (K > N) continue; ans[K]++; } } } FORq(i, 1, N) { cout << ans[i] << "\n"; } }
replace
50
53
50
53
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int t; t = 1; while (t--) { long long n, i, c = 0, x, j, k; map<long long, long long> m; cin >> n; for (i = 1; i <= 1000; i++) { for (j = 1; j <= 1000; j++) { for (k = 1; k <= 1000; k++) { x = i * i + j * j + k * k + (i * j) + (j * k) + (k * i); m[x]++; } } } for (i = 1; i <= n; i++) { cout << m[i] << endl; } } }
#include <bits/stdc++.h> using namespace std; int main() { int t; t = 1; while (t--) { long long n, i, c = 0, x, j, k; map<long long, long long> m; cin >> n; for (i = 1; i <= 1000; i++) { for (j = 1; j <= 1000; j++) { for (k = 1; k <= 1000; k++) { x = i * i + j * j + k * k + (i * j) + (j * k) + (k * i); if (x <= 10000) { m[x]++; } } } } for (i = 1; i <= n; i++) { cout << m[i] << endl; } } }
replace
13
15
13
16
TLE
p02608
C++
Time Limit Exceeded
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ███████████ // ██╬╬╬╬╬████╬╬████╬╬╬╬╬██ // █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██ // ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██ // ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██ // ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████ // █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ // ██████████████ // ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████ // ███████ █████ // ███████████████████ // #include "bits/stdc++.h" using namespace std; #define INF (1 << 30) #define LINF (1LL << 60) #define fs first #define sc second #define int long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define RFOR(i, a, b) for (int i = (b - 1); i >= (a); --i) #define REP(i, n) FOR(i, 0, (n)) #define RREP(i, n) RFOR(i, 0, (n)) #define ITR(itr, mp) for (auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define RITR(itr, mp) for (auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr) #define range(i, a, b) ((a) <= (i) && (i) < (b)) #define debug(x) cout << #x << " = " << (x) << endl #define SP << " " << template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return true; } else return false; } template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true; } else return false; } #define MSB(x) (63 - __builtin_clzll(x)) #define pcnt(x) (__builtin_popcountll(x)) #define parity(i, j) (i & (1LL << j)) typedef pair<int, int> P; typedef tuple<int, int, int> T; typedef vector<int> vec; typedef vector<vector<int>> mat; signed main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; FOR(x, 1, N + 1) { int ans = 0; FOR(i, 1, 2 * x) { if (i * i + i * i > x * 2) break; FOR(j, 1, 2 * x) { if ((i + j) * (i + j) + i * i + j * j > x * 2) break; FOR(k, 1, 2 * x) { if ((i + j) * (i + j) + (i + k) * (i + k) + (j + k) * (j + k) == x * 2) ans++; } } } cout << ans << endl; } return 0; }
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ███████████ // ██╬╬╬╬╬████╬╬████╬╬╬╬╬██ // █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██ // ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██ // ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██ // ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████ // █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████ // ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███ // ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████ // ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██ // ██████████████ // ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████ // ███████ █████ // ███████████████████ // #include "bits/stdc++.h" using namespace std; #define INF (1 << 30) #define LINF (1LL << 60) #define fs first #define sc second #define int long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define RFOR(i, a, b) for (int i = (b - 1); i >= (a); --i) #define REP(i, n) FOR(i, 0, (n)) #define RREP(i, n) RFOR(i, 0, (n)) #define ITR(itr, mp) for (auto itr = (mp).begin(); itr != (mp).end(); ++itr) #define RITR(itr, mp) for (auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr) #define range(i, a, b) ((a) <= (i) && (i) < (b)) #define debug(x) cout << #x << " = " << (x) << endl #define SP << " " << template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return true; } else return false; } template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true; } else return false; } #define MSB(x) (63 - __builtin_clzll(x)) #define pcnt(x) (__builtin_popcountll(x)) #define parity(i, j) (i & (1LL << j)) typedef pair<int, int> P; typedef tuple<int, int, int> T; typedef vector<int> vec; typedef vector<vector<int>> mat; signed main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; FOR(x, 1, N + 1) { int ans = 0; FOR(i, 1, 2 * x) { if (i * i + i * i > x * 2) break; FOR(j, 1, 2 * x) { if ((i + j) * (i + j) + i * i + j * j > x * 2) break; FOR(k, 1, 2 * x) { if ((i + j) * (i + j) + (i + k) * (i + k) + (j + k) * (j + k) == x * 2) ans++; if ((i + j) * (i + j) + (i + k) * (i + k) + (j + k) * (j + k) > x * 2) break; } } } cout << ans << endl; } return 0; }
insert
83
83
83
85
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool f(int val, int rhs) { bool ok = false; for (int i = 1; i < 100; i++) { if (i * (i + val) == rhs) ok = true; } return ok; } int main() { int N; cin >> N; vector<int> ans(N); vector<vector<bool>> table(200, vector<bool>(10000)); for (int i = 0; i < 300; i++) { for (int j = 0; j < 1000; j++) { table[i][j] = f(i, j); } } for (int x = 1; x <= N; x++) { int num = 0; for (int i = 1; i * i < x; i++) { for (int j = 1; j * j < x; j++) { int rhs = x - i * i - j * j - i * j; if (rhs <= 0) continue; else { int val = i + j; if (table[val][rhs]) num++; } } } ans[x - 1] = num; } for (int i = 0; i < N; i++) { cout << ans[i] << endl; } }
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool f(int val, int rhs) { bool ok = false; for (int i = 1; i < 100; i++) { if (i * (i + val) == rhs) ok = true; } return ok; } int main() { int N; cin >> N; vector<int> ans(N); vector<vector<bool>> table(200, vector<bool>(10000)); for (int i = 0; i < 200; i++) { for (int j = 0; j < 10000; j++) { table[i][j] = f(i, j); } } for (int x = 1; x <= N; x++) { int num = 0; for (int i = 1; i * i < x; i++) { for (int j = 1; j * j < x; j++) { int rhs = x - i * i - j * j - i * j; if (rhs <= 0) continue; else { int val = i + j; if (table[val][rhs]) num++; } } } ans[x - 1] = num; } for (int i = 0; i < N; i++) { cout << ans[i] << endl; } }
replace
18
20
18
20
-11
p02608
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (int i = m; i < n; ++i) #define FORR(i, m, n) for (int i = m; i >= n; --i) #define ALL(v) (v).begin(), (v).end() template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } const ll INF = 1LL << 60; const int inf = (1 << 30) - 1; const int mod = 1e9 + 7; int dx[8] = {1, 0, -1, 0, -1, -1, 1, 1}; int dy[8] = {0, 1, 0, -1, -1, 1, -1, 1}; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<ll> res(n + 1); FOR(i, 1, 101) { FOR(j, 1, 101) { FOR(k, 1, 101) { if (i * i + j * j + k * k > n) { continue; } res[i * i + j * j + k * k + i * j + j * k + k * i]++; } } } FOR(i, 1, n + 1) { cout << res[i] << endl; } }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (int i = m; i < n; ++i) #define FORR(i, m, n) for (int i = m; i >= n; --i) #define ALL(v) (v).begin(), (v).end() template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } const ll INF = 1LL << 60; const int inf = (1 << 30) - 1; const int mod = 1e9 + 7; int dx[8] = {1, 0, -1, 0, -1, -1, 1, 1}; int dy[8] = {0, 1, 0, -1, -1, 1, -1, 1}; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<ll> res(n + 1); FOR(i, 1, 101) { FOR(j, 1, 101) { FOR(k, 1, 101) { if (i * i + j * j + k * k + i * j + j * k + k * i > n) { continue; } res[i * i + j * j + k * k + i * j + j * k + k * i]++; } } } FOR(i, 1, n + 1) { cout << res[i] << endl; } }
replace
37
38
37
38
0
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; // #define int long long #define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i) #define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i) #define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--) #define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--) #define irep(i, m, n) \ for (long long i = (long long)(m); i < (long long)(n); ++i) #define ireps(i, m, n) \ for (long long i = (long long)(m); i <= (long long)(n); ++i) #define SORT(v, n) sort(v, v + n); #define REVERSE(v, n) reverse(v, v + n); #define vsort(v) sort(v.begin(), v.end()); #define all(v) v.begin(), v.end() #define mp(n, m) make_pair(n, m); #define cout(d) cout << d << endl; #define coutd(d) cout << std::setprecision(10) << d << endl; #define cinline(n) getline(cin, n); #define replace_all(s, b, a) replace(s.begin(), s.end(), b, a); #define PI (acos(-1)) #define FILL(v, n, x) fill(v, v + n, x); #define sz(x) long long(x.size()) using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vll = vector<ll>; using vvll = vector<vll>; using pii = pair<int, int>; using pll = pair<ll, ll>; using vs = vector<string>; using vpll = vector<pair<ll, ll>>; using vtp = vector<tuple<ll, ll, ll>>; using vb = vector<bool>; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } const ll INF = 1e9 + 10; const ll MOD = 1e9 + 7; const ll LINF = 1e18; void solve(ll n) { ll m = sqrt(n); ll ans = 0; for (ll x = 1; x <= m; x++) { for (ll y = 1; y <= m; y++) { for (ll z = 1; z <= m; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == n) ans++; } } } cout << ans << endl; } signed main() { cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; for (ll i = 1; i <= n; i++) { solve(i); } }
#include <bits/stdc++.h> using namespace std; // #define int long long #define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i) #define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i) #define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--) #define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--) #define irep(i, m, n) \ for (long long i = (long long)(m); i < (long long)(n); ++i) #define ireps(i, m, n) \ for (long long i = (long long)(m); i <= (long long)(n); ++i) #define SORT(v, n) sort(v, v + n); #define REVERSE(v, n) reverse(v, v + n); #define vsort(v) sort(v.begin(), v.end()); #define all(v) v.begin(), v.end() #define mp(n, m) make_pair(n, m); #define cout(d) cout << d << endl; #define coutd(d) cout << std::setprecision(10) << d << endl; #define cinline(n) getline(cin, n); #define replace_all(s, b, a) replace(s.begin(), s.end(), b, a); #define PI (acos(-1)) #define FILL(v, n, x) fill(v, v + n, x); #define sz(x) long long(x.size()) using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vll = vector<ll>; using vvll = vector<vll>; using pii = pair<int, int>; using pll = pair<ll, ll>; using vs = vector<string>; using vpll = vector<pair<ll, ll>>; using vtp = vector<tuple<ll, ll, ll>>; using vb = vector<bool>; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } const ll INF = 1e9 + 10; const ll MOD = 1e9 + 7; const ll LINF = 1e18; void solve(ll n) { ll m = sqrt(n); ll ans = 0; for (ll x = 1; x <= m; x++) { for (ll y = 1; y <= m; y++) { for (ll z = 1; z <= m; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x > n) break; if (x * x + y * y + z * z + x * y + y * z + z * x == n) ans++; } } } cout << ans << endl; } signed main() { cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; for (ll i = 1; i <= n; i++) { solve(i); } }
insert
63
63
63
65
TLE
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll fact(int x) { if (x == 1) return 1; else return x * fact(x - 1); } int main() { int n; cin >> n; int rt = sqrt(n) + 1; for (int i = 1; i <= n; i++) { int cnt = 0; for (int x = 1; x <= rt; x++) { for (int y = 1; y <= rt; y++) { for (int z = 1; z <= rt; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) { cnt++; } } } } cout << cnt << endl; } }
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll fact(int x) { if (x == 1) return 1; else return x * fact(x - 1); } int main() { int n; cin >> n; int rt = sqrt(n) + 1; for (int i = 1; i <= n; i++) { int cnt = 0; for (int x = 1; x <= rt; x++) { for (int y = 1; y <= rt; y++) { for (int z = 1; z <= rt; z++) { if (x * x + y * y + z * z + x * y + y * z + z * x == i) { cnt++; } else if (x * x + y * y + z * z + x * y + y * z + z * x > i) break; } } } cout << cnt << endl; } }
replace
22
23
22
24
TLE
p02608
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define dd double #define scl(n) scanf("%lld", &n) #define scd(n) scanf("%lf", &n) #define ptl(n) printf("%lld", n) #define ptd(n) printf("%lf", n) #define nline printf("\n") #define vld vector<ll> #define vbd vector<bool> #define eb emplace_back #define FOR(i, n) for (ll i = 0; i < n; i++) #define FOR1(i, n) for (ll i = 1; i <= n; i++) #define pi 2 * acos(0.0) using namespace std; int main() { ll n, l, i, j, k, eq[10004] = {0}, cnt = 0; scl(n); for (i = 1; i * i + 2 * i + 3 <= n; i++) { for (j = 1; j * j + 2 * j + 3 <= n; j++) { for (k = 1; k * k + 2 * k + 3 <= n; k++) { eq[i * i + j * j + k * k + i * j + j * k + k * i]++; } } } FOR1(i, n) { ptl(eq[i]); nline; } return 0; }
#include <bits/stdc++.h> #define ll long long #define dd double #define scl(n) scanf("%lld", &n) #define scd(n) scanf("%lf", &n) #define ptl(n) printf("%lld", n) #define ptd(n) printf("%lf", n) #define nline printf("\n") #define vld vector<ll> #define vbd vector<bool> #define eb emplace_back #define FOR(i, n) for (ll i = 0; i < n; i++) #define FOR1(i, n) for (ll i = 1; i <= n; i++) #define pi 2 * acos(0.0) using namespace std; int main() { ll n, l, i, j, k, eq[100000] = {0}, cnt = 0; scl(n); for (i = 1; i * i + 2 * i + 3 <= n; i++) { for (j = 1; j * j + 2 * j + 3 <= n; j++) { for (k = 1; k * k + 2 * k + 3 <= n; k++) { eq[i * i + j * j + k * k + i * j + j * k + k * i]++; } } } FOR1(i, n) { ptl(eq[i]); nline; } return 0; }
replace
19
20
19
20
0
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0)->sync_with_stdio(false); int n; cin >> n; for (int i = 1; i <= n; i++) { int cnt = 0; for (int x = 1; x <= sqrt(n); x++) { for (int y = 1; y <= sqrt(n); y++) { for (int z = 1; z <= sqrt(n); z++) { if (pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x == i) cnt++; } } } cout << cnt << '\n'; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0)->sync_with_stdio(false); int n; cin >> n; for (int i = 1; i <= n; i++) { int cnt = 0; for (int x = 1; x <= sqrt(n); x++) { for (int y = 1; y <= sqrt(n); y++) { double d = sqrt(-2 * x * y - 3 * pow(x, 2) - 3 * pow(y, 2) + 4 * i); if (floor(d) == d) { double z = (-x - y + d) / 2; if (floor(z) == z && z > 0) { if (pow(x, 2) + pow(y, 2) + pow(z, 2) + x * y + y * z + z * x == i) cnt++; } } } } cout << cnt << '\n'; } return 0; }
replace
13
16
13
20
TLE
p02608
C++
Runtime Error
#include <algorithm> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <vector> using ll = long long int; const int INF = (1 << 30); const ll INFLL = (1ll << 60); const ll MOD = (ll)(1e9 + 7); #define l_ength size void mul_mod(ll &a, ll b) { a *= b; a %= MOD; } void add_mod(ll &a, ll b) { a = (a < MOD) ? a : (a - MOD); b = (b < MOD) ? b : (b - MOD); a += b; a = (a < MOD) ? a : (a - MOD); } ll ans[1111]; int main(void) { ll n, x, y, z, i; std::cin >> n; for (x = 1ll; x <= 200ll; ++x) { for (y = 1ll; y <= 200ll; ++y) { for (z = 1ll; z <= 200ll; ++z) { i = x * x + y * y + z * z + x * y + y * z + z * x; if (i <= n) { ++ans[i]; } } } } for (i = 1ll; i <= n; ++i) { std::cout << ans[i] << std::endl; } return 0; }
#include <algorithm> #include <iostream> #include <queue> #include <stack> #include <stdio.h> #include <vector> using ll = long long int; const int INF = (1 << 30); const ll INFLL = (1ll << 60); const ll MOD = (ll)(1e9 + 7); #define l_ength size void mul_mod(ll &a, ll b) { a *= b; a %= MOD; } void add_mod(ll &a, ll b) { a = (a < MOD) ? a : (a - MOD); b = (b < MOD) ? b : (b - MOD); a += b; a = (a < MOD) ? a : (a - MOD); } ll ans[11111]; int main(void) { ll n, x, y, z, i; std::cin >> n; for (x = 1ll; x <= 200ll; ++x) { for (y = 1ll; y <= 200ll; ++y) { for (z = 1ll; z <= 200ll; ++z) { i = x * x + y * y + z * z + x * y + y * z + z * x; if (i <= n) { ++ans[i]; } } } } for (i = 1ll; i <= n; ++i) { std::cout << ans[i] << std::endl; } return 0; }
replace
26
27
26
27
0
p02608
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <climits> #include <cmath> #include <iostream> #include <queue> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; constexpr int64_t MOD = 1e9 + 7; int main() { std::cin.tie(0); std::ios::sync_with_stdio(false); int32_t x, y, z; int32_t N; cin >> N; vector<int32_t> cnt(N, 0); for (x = 1; x * x < N; x++) { if (x * x + x + 4 > N) continue; for (y = 1; y * y < N; y++) { if (x * x + y * y + x + y + x * y + 1 > N) continue; for (z = 1; z * z < N; z++) { int32_t sum = x * x + y * y + z * z + x * y + y * z + z * x; cnt[sum - 1]++; } } } for (auto c : cnt) { cout << c << endl; } return 0; }
#include <algorithm> #include <assert.h> #include <climits> #include <cmath> #include <iostream> #include <queue> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; constexpr int64_t MOD = 1e9 + 7; int main() { std::cin.tie(0); std::ios::sync_with_stdio(false); int32_t x, y, z; int32_t N; cin >> N; vector<int32_t> cnt(N, 0); for (x = 1; x * x < N; x++) { if (x * x + x + 4 > N) continue; for (y = 1; y * y < N; y++) { if (x * x + y * y + x + y + x * y + 1 > N) continue; for (z = 1; z * z < N; z++) { int32_t sum = x * x + y * y + z * z + x * y + y * z + z * x; if (sum > N) continue; cnt[sum - 1]++; } } } for (auto c : cnt) { cout << c << endl; } return 0; }
insert
28
28
28
30
0
p02608
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; for (int n = 1; n <= N; ++n) { int ans = 0; for (int x = 1; x <= N; ++x) { if (x * x > n) break; for (int y = 1; y <= N; ++y) { if (y * y > n) break; for (int z = 1; z <= N; ++z) { if (z * z > n) break; int64_t a = x * x + y * y + z * z + x * y + y * z + z * x; if (a == n) ans++; } } } cout << ans << '\n'; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; for (int n = 1; n <= N; ++n) { int ans = 0; for (int x = 1; x <= N; ++x) { if (x * x > n) break; for (int y = 1; y <= N; ++y) { if (y * y > n) break; int b = x + y; int c = x * x + y * y + x * y - n; double z = (-b + sqrt((b * b) - 4 * c)) / 2.0; if (z < 1) continue; if (floor(z) == z) ans++; } } cout << ans << '\n'; } return 0; }
replace
14
21
14
21
TLE