Advertisement
Guest User

Untitled

a guest
May 19th, 2019
97
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. using namespace std;
  3. int max(int a, int b) {
  4.     return a > b;
  5. }
  6. int main() {
  7.     float N, M;
  8.     cin >> N >> M;
  9.     float med = (N + M) / 2 + 1;
  10.     int dif = max(N - M, M - N);
  11.     dif = dif / 2;
  12.     cout << med << " " << dif << endl;
  13.     for (int i = med - dif; i <= med + dif; ++i) {
  14.         cout << i << " ";
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement