fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin >> n;
  7. int k[100];
  8. for (int i = 0; i < n; i++) cin >> k[i];
  9.  
  10. int ans = 1e9;
  11. for (int i = 0; i < n; i++) {
  12. int t = 0, x;
  13. for (int j = 0; j < k[i]; j++) {
  14. cin >> x;
  15. t += x * 5 + 15;
  16. }
  17. ans = min(ans, t);
  18. }
  19.  
  20. cout << ans << endl;
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0.01s 5272KB
stdin
4
1 4 3 2
100
1 2 2 3
1 9 1
7 8
stdout
100