-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYoga_Class.cpp
41 lines (34 loc) · 1.51 KB
/
Yoga_Class.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// ░░████████╗░██████╗███████╗░████████╗███████╗███╗░░██╗
// ░░╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝██╔════╝████╗░██║
// ░░░░░██║░░░╚█████╗░█████╗░░░░░██║░░░█████╗░░██╔██╗██║
// ░░░░░██║░░░░╚═══██╗██╔══╝░░░░░██║░░░██╔══╝░░██║╚████║
// ░░░░░██║░░░██████╔╝███████╗░░░██║░░░███████╗██║░╚███║
// ░░░░░╚═╝░░░╚═════╝░╚══════╝░░░╚═╝░░░╚══════╝╚═╝░░╚══╝
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int _;
cin >> _;
while (_--)
{
int n, x, y;
cin >> n >> x >> y;
int ans = 0;
for (int i = 0; i <= n; ++i)
{
int rem = n - i;
if (rem % 2 == 0)
{
int j = rem / 2;
int ern = (i * x) + (j * y);
ans = max(ans, ern);
}
}
cout << ans << endl;
}
return 0;
}