DATE1 - Editorial (LUNCHTIME)

/*PROBLEM LINK:-DATE1 Problem - CodeChef */

#include “bits/stdc++.h”
using namespace std;
#define MAXN 100001
#define MOD 1000000007
#define lli long long int
// driver program for above function
int main()
{
#ifndef ONLINE_JUDGE
//for getting input from input.txt
freopen(“input1.txt”, “r”, stdin);
//for writing output to output.txt
freopen(“output1.txt”, “w”, stdout);
#endif
int t;
cin >> t;
while (t–)
{

	lli a,y,x,ans;
	cin >> a>>y>>x ;
    if(a>=y)
	ans=y*x;
	else 
	ans=1+a*x;
	cout << ans << endl;
}
return 0;

}