Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x;
- cin >> x;
- int y [x];
- int t [x-1];
- for(int u=0; u<=x-1; u++)
- {
- cin >> y [u];
- }
- for(int i=0; i<=x-2; i++)
- {
- t[i]=y [i+1]-y [i];
- }
- for(int o=0; o<=x-2; o++)
- {
- if(t [o]==t [o+1])
- {
- cout << y [o] << endl << y [o+1] << endl << y [o+2];
- return 0;
- }
- }
- cout << "-1";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement