Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int i, n, x, a, b, c;
- cin >> n;
- for (i = 1; i <= n; i++) {
- cin >> x;
- a = x, b = x + 1, c = x + 2;
- if (a % 2 == 0)
- a /= 2;
- else if (b % 2 == 0)
- b /= 2;
- else c /= 2;
- if (a % 3 == 0)
- a /= 3;
- else if (b % 3 == 0)
- b /= 3;
- else c /= 3;
- cout << 1ULL * a * b * c << ' ';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment