fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b, c, d, e;
  6. cin >> a >> b >> c >> d >> e;
  7.  
  8. // Находим разности между числами
  9. int d1 = b - a;
  10. int d2 = c - b;
  11. int d3 = d - c;
  12. int d4 = e - d;
  13.  
  14. // Определяем закономерность роста разностей
  15. int step = (d4 - d3) - (d3 - d2); // Шаг изменения разностей
  16.  
  17. // Генерируем следующие три числа
  18. int next_d = d4 + (d4 - d3) + step;
  19. int f = e + next_d;
  20.  
  21. next_d += (next_d - d4) + step;
  22. int g = f + next_d;
  23.  
  24. next_d += (next_d - f) + step;
  25. int h = g + next_d;
  26.  
  27. cout << f << " " << g << " " << h << endl;
  28.  
  29. return 0;
  30. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
-455457240 -1518264140 -1268687674