#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;
}
<h1>Таблица</h1>
<div style="margin-left: 30%;margin-bottom: 100px;">
<form action="" method="POST">
<table>
<tr><td>
<label for="surname">Фамилия:</td><td><input type="text" name="surname" id="name" value="<?php echo $surname; ?>"></label></td>
</tr><tr>
<td>
<label for="name">Имя:</td><td><input type="text" name="name" id="name" value="<?php echo $name; ?>"></label></td>
</tr><tr>
<td>
<label for="patronymic">Отчество:</td><td><input type="text" name="patronymic" id="patronymic" value="<?php echo $patronymic; ?>"></label></td>
</tr><tr>
<td>
<label for="age">Дата рождения:</td><td><input type="text" name="age" id="age" value="<?php echo $age; ?>"></label> </td>
</tr><tr>
<td>
<label for="phone">Телефон:</td><td><input type="text" name="phone" id="phone" value="<?php echo $phone; ?>"></label></td>
</tr><tr>
<td>
<label for="gender">Пол:</td><td><input type="text" name="gender" id="gender" value="<?php echo $gender; ?>"></label>
</tr><tr>
</td>
<label for="address">Баланс:</td><td><input type="text" name="balance" id="balance" value="<?php echo $balance; ?>"></label> </td>
</tr><tr>
<label for="address">Скидка:</td><td><input type="text" name="discount" id="discount" value="<?php echo $discount; ?>"></label></td>
</tr><tr>
<label for="address">Бонус:</td><td><input type="text" name="bonus" id="bonus" value="<?php echo $bonus; ?>"></label></td>
</table>
<input type="hidden" name="id" value="<?php echo($id);?>">
<input type="submit" value="<?php echo($button);?>">
</form>
Длина символов строки и маска для номера задается в SQL server.