Skip to content

Instantly share code, notes, and snippets.

@Thiago4532
Created September 9, 2021 00:47
Show Gist options
  • Save Thiago4532/5f57fbd3a54a7fc5297af77fd61192a9 to your computer and use it in GitHub Desktop.
Save Thiago4532/5f57fbd3a54a7fc5297af77fd61192a9 to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
if (a > b)
swap(a, b); // 'a' vira o menor elemento
// Vamos fazer o elemento 'a' ser a mediana.
int c = a - (b - a); // c < a < b
cout << c << '\n';
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment