#include #include #include #include #include using namespace std; int main() { vectorv; v.resize(10); vector> p; for (int i = 0; i < 10; i++) { cin >> v[i]; if (v[i] > 0) p.push_back(make_pair(i, v[i])); } /* Take care of the non-integer constant case */ if ((p[1].second - p[0].second) % (p[1].first - p[0].first) != 0) { cout << -1 << endl; return 0; } //find arithetic sequence int constant = (p[1].second - p[0].second) / (p[1].first - p[0].first); int first = p[0].second - p[0].first * constant; //generate sequence cout << first; for (int i = 1; i < 10; i++) cout << " " << first + i*constant; cout << endl; int k; cin >> k; return 0; }