# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
391235 |
2021-04-18T09:40:11 Z |
sad |
Lutrija (COCI19_lutrija) |
C++14 |
|
1 ms |
300 KB |
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
using namespace std;
int go (int x)
{
for(int i=2;i*i<=x;i++)
{
if((x%i)==0)return 0;
}
return 1;
}
int main()
{
ll l,r;cin>>l>>r;
if(go(abs(r-l)))
{
cout<<2<<endl<<l<<" "<<r;return 0;
}
if(r-2>1&&go(abs(r-2-l)))
{
cout<<3<<endl<<l<<" "<<r-2<<" "<<r;return 0;
}
if(l-2>1&&go(abs(l-2-r)))
{
cout<<3<<endl<<l<<" "<<l-2<<" "<<r;return 0;
}
if(go(abs(r+2-l)))
{
cout<<3<<endl<<l<<" "<<r+2<<" "<<r;return 0;
}
if(go(abs(l+2-r)))
{
cout<<3<<endl<<l<<" "<<l+2<<" "<<r;return 0;
}
cout<<-1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
292 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
300 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
292 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
296 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |