Ankit_132

A

Apr 8th, 2024
1,255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define ll     long long
  6. #define _test   int _TEST; cin>>_TEST; while(_TEST--)
  7. #define pb     push_back
  8. #define ppb    pop_back
  9. #define pf     push_front
  10. #define ppf    pop_front
  11.  
  12. int main()
  13. {
  14.     _test
  15.     {
  16.         int n, a, b;
  17.         cin>>n>>a>>b;
  18.  
  19.         if(b < 2*a)
  20.             cout<<(n/2)*b + (n%2)*a<<"\n";
  21.         else
  22.             cout<<n*a<<"\n";
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment