#include <bits/stdc++.h>   using namespace std;   int main() {     int Q;     cin >> Q;     while (Q--) {       long long n, a, b, ans;       cin >> n >> a >> b;       double x = b / 2.0;       if (x > a) {         ans = a * n;         cout << ans << endl;       } else {         if (n % 2 == 0) {           ans = n / 2 * b;           cout << ans << endl;         } else {           ans = (n - 1) / 2 * b + a;           cout << ans << endl;         }       }     }   }   