fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define user333 meow
  4.  
  5. int main() {
  6. ios::sync_with_stdio(0), cin.tie(0);
  7. int t;
  8. cin >> t;
  9. while(t--) {
  10. int g, a, h, w;
  11. cin >> g >> a >> h >> w;
  12. cout << fixed << setprecision(2) << (g == 1 ? 13.7 * w + 5.0 * h - 6.8 * a + 66 : 9.6 * w + 1.8 * h - 4.7 * a + 655) << '\n';
  13. }
  14. }
Success #stdin #stdout 0.01s 5300KB
stdin
5
1 55 178 89
0 20 157 48
1 33 162 50
1 10 150 31
0 29 159 51
stdout
1801.30
1304.40
1336.60
1172.70
1294.50