artemgf

Спираль

Mar 18th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <string>
  4. #include <set>
  5. #include <map>
  6. #include <algorithm>
  7. #include <string>
  8. #include <math.h>
  9. #include <vector>
  10.  
  11. using namespace std;
  12.  
  13. long long M, N;
  14.  
  15. int main()
  16. {
  17.         cin >> N >> M;
  18.  
  19.         if (N <= M)
  20.             cout << N * 2 - 2 << endl;
  21.         else
  22.             cout << M * 2 - 1 << endl;
  23.     _getch();
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment