#include<iostream>
using namespace std;
int main(int argc, char** argv)
{
int test_case;
cin>> test_case;
for(int i = 1; i <= test_case; i++)
{
int P; // A사 리터당 요금
int Q; // B사 R리터 이하 요금
int R; // B사 기준 리터
int S; // B사 추가 요금
int W; // 한달간 사용하는 수도의 양
cin >> P >> Q >> R >> S >> W;
int A;
A = P * W;
int B;
if (R > W)
B = Q ;
else if (R < W)
B = Q + (S * (W-R));
if (A > B)
cout << "#" << i << " " << B << endl;
else if (B > A)
cout << "#" << i << " " << A << endl;
}
return 0;//정상종료시 반드시 0을 리턴해야합니다.
}```
1) A사와 B사의 수도 요금을 계산할 수 있는 식을 만든다.
2) 조건문을 활용한다.