# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
244255 | 2020-07-03T11:49:50 Z | erray | Lutrija (COCI19_lutrija) | C++14 | 0 ms | 0 KB |
#include<bits/stdc++.h> using namespace std; int main () { ios_base::sync_with_stdio(0); cin.tie(0); auto isPrime = [&](long long num) { if (num < 2) return false; for (long long i = 2; i * i <= num; ++i) if (num % i == 0) return false; return true; }; long long a, b; cin >> a >> b; if (isPrime(abs(a - b))) cout << 2 << '\n' << a << ' ' << b; else if (isPrime(a - 2) && isPrime(b - 2)) cout << 3 << '\n' << a << " 2 " << b; else if (isPrime(a + b)) cout << 3 << '\n' << a << ' ' << a + b << ' ' b; else cout << -1; }