2 solutions
-
0
Guest MOD
- 1
Information
- ID
- 1449
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 6
- Tags
- (None)
- # Submissions
- 175
- Accepted
- 51
- Uploaded By
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
signed main()
{
int n, a, b;
std:: cin >> n >> a >> b;
if(2 * a <= b)
{
std:: cout << a * n << endl;
return 0;
}
else
{
int cnt1 = n / 2;
std:: cout << b * cnt1 + (n % 2) * a << endl;
}
}
By signing up a Hydro universal account, you can submit code and join discussions in all online judging services provided by us.