Language: C++

#include <iostream>
#include <stdio.h>
using namespace std;

int main(){
	int n; cin >> n;
	for(int i = 0; i < n; i++){
		int x, y, b, p;
		scanf("%d %d %d %d", &x, &y, &b, &p);
		if(b >= 5 && p >= 2){
			cout << 0.8 * (x * b + y * p) << endl;
		}else if(b < 5){
			(0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl;) : (cout << x * b + y * p << endl;);
		}else if(p < 2){
			(0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl;) : (cout << x * b + y * p << endl;);
		}else{
			(0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl;) : (cout << x * b + y * p << endl;);
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:105: error: expected ')' before ';' token
   13 |                         (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl;) : (cout << x * b + y * p << endl;);
      |                                                                   ~                                     ^
      |                                                                                                         )
a.cc:13:105: error: expected ':' before ';' token
   13 |                         (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl;) : (cout << x * b + y * p << endl;);
      |                                                                                                         ^
      |                                                                                                         :
a.cc:13:105: error: expected primary-expression before ';' token
a.cc:13:106: error: expected primary-expression before ')' token
   13 |                         (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl;) : (cout << x * b + y * p << endl;);
      |                                                                                                          ^
a.cc:13:141: error: expected primary-expression before ')' token
   13 |                         (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl;) : (cout << x * b + y * p << endl;);
      |                                                                                                                                             ^
a.cc:15:105: error: expected ')' before ';' token
   15 |                         (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl;) : (cout << x * b + y * p << endl;);
      |                                                                   ~                                     ^
      |                                                                                                         )
a.cc:15:105: error: expected ':' before ';' token
   15 |                         (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl;) : (cout << x * b + y * p << endl;);
      |                                                                                                         ^
      |                                                                                                         :
a.cc:15:105: error: expected primary-expression before ';' token
a.cc:15:106: error: expected primary-expression before ')' token
   15 |                         (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl;) : (cout << x * b + y * p << endl;);
      |                                                                                                          ^
a.cc:15:141: error: expected primary-expression before ')' token
   15 |                         (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl;) : (cout << x * b + y * p << endl;);
      |                                                                                                                                             ^
a.cc:17:105: error: expected ')' before ';' token
   17 |                         (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl;) : (cout << x * b + y * p << endl;);
      |                                                                   ~                                     ^
      |                                                                                                         )
a.cc:17:105: error: expected ':' before ';' token
   17 |                         (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl;) : (cout << x * b + y * p << endl;);
      |                                                                                                         ^
      |                                                                                                         :
a.cc:17:105: error: expected primary-expression before ';' token
a.cc:17:106: error: expected primary-expression before ')' token
   17 |                         (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl;) : (cout << x * b + y * p << endl;);
      |                                                                                                          ^
a.cc:17:141: error: expected primary-expression before ')' token
   17 |                         (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl;) : (cout << x * b + y * p << endl;);
      |                                                                                                                                             ^