Advertisement
Ne-Biolog

Untitled

May 17th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <memory.h>
  4. #include <iterator>
  5. #include <cassert>
  6. #include <fstream>
  7. #include <iomanip>
  8. #include <cstdlib>
  9. #include <bitset>
  10. #include <vector>
  11. #include <cstdio>
  12. #include <string>
  13. #include <queue>
  14. #include <deque>
  15. #include <cmath>
  16. #include <ctime>
  17. #include <stack>
  18. #include <set>
  19. #include <map>
  20.  
  21. using namespace std;
  22.  
  23. const int N = (int)2e5 + 10;
  24.  
  25. int n;
  26. long long a[N];
  27.  
  28. int main ()
  29. {
  30. //freopen("input.txt" , "r" , stdin);
  31. //freopen("output.txt" , "w" , stdout);
  32. ios_base::sync_with_stdio(false);
  33.  
  34. cin >> n;
  35. long long timeD = -1;
  36. for(int i = 0; i < n; ++i) {
  37. cin >> a[i];
  38. }
  39. timeD = a[1] - a[0];
  40. for(int i = 1; i < n; ++i) {
  41. if(timeD != a[i] - a[i - 1]) {
  42. cout << "kukuha" << endl;
  43. return 0;
  44. }
  45. }
  46.  
  47. long double d = timeD * (n - 1) * 1.0;
  48. cout << (d - 1) / 2.0 << ' ' << (d + 1) / 2.0 << endl;
  49.  
  50.  
  51.  
  52.  
  53. return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement