Вот в двоичной системе: 110010001100110111010100110011101101000011001100110000001101001011001000110010101100000000100000100101110010000011011101110100101100111000100000110011011100000011010011110010101100000000100000110011100010000011010001110011111100111011010001110011101100000111000000110101010010000011001111110011101100101111010011110101111100010111001101110010001101111100101100001000001100110111000000110010101100111011001111110010111100010111001101110010001101111100101100001000001100111011000001110100001100000011000001110011101101001011001010110010000010110000100000110011111100010111010000110001011100010011000000110101111100100000100000110010000010000011001111110100001100010111000100110100011101001011000000110000101100101111000101110011011100100011011111001000001100100011001101110101001100111011010000110011001100000011010110110010001100100000101110
#include <iostream>
typedef long long ll;
using namespace std;
bool ll_is_valid(ll t, ll N, ll x, ll y)
{
return t / x + (t - x) / y >= N;
}
ll f(ll N, ll x, ll y)
{
ll R = 1;
while (!ll_is_valid(R,N,x,y)) R *= 2;
ll L = R / 2;
while(R - L > 1)
{
ll M = (L + R) / 2;
if (!ll_is_valid(M,N,x,y)) {L = M;}
else {R = M;}
}
return R;
}
int main()
{
ll N,x,y;
cin >> N >> x >> y;
if(x > y) swap( x, y );
cout << f(N, x, y) << std::endl;
}
110010001100110111010100110011101101000011001100110000001101001011001000110010101100000000100000100101110010000011011101110100101100111000100000110011011100000011010011110010101100000000100000110011100010000011010001110011111100111011010001110011101100000111000000110101010010000011001111110011101100101111010011110101111100010111001101110010001101111100101100001000001100110111000000110010101100111011001111110010111100010111001101110010001101111100101100001000001100111011000001110100001100000011000001110011101101001011001010110010000010110000100000110011111100010111010000110001011100010011000000110101111100100000100000110010000010000011001111110100001100010111000100110100011101001011000000110000101100101111000101110011011100100011011111001000001100100011001101110101001100111011010000110011001100000011010110110010001100100000101110