fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int largest(int arr[], int n)
  5. {
  6. return *max_element(arr, arr+n);
  7. }
  8.  
  9. int main(){
  10. ios_base::sync_with_stdio(0);
  11. cin.tie(0);
  12. cout.tie(0);
  13. int T; cin >> T;
  14. while(T--){
  15. int N; cin >> N;
  16. for (int i=0; i<N; i++){
  17. int S[N], P[N], V[N];
  18. for (int i=0; i<N; i++){
  19. cin >> S[i] >> P[i] >> V[i];
  20. }
  21. int final[N];
  22. for (int i=0; i<N; i++){
  23. final[i] =(P[i]/S[i])* V[i];
  24. }
  25. cout << largest(final,N) << "\n";
  26. }
  27. }
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 4284KB
stdin
2
3
4 6 8
2 6 6
1 4 3
1
7 7 4
stdout
18
49
49
27951104
27951104
27951104