fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. unsigned long long n, r;
  8. cin >> n >> r;
  9.  
  10. unsigned long long sum = 0;
  11. for (int i = 0; i < n; ++i) {
  12. unsigned long long a, b, c;
  13. cin >> a >> b >> c;
  14. sum += a * b * c;
  15. }
  16.  
  17. cout << sum * r << endl;
  18. }
Success #stdin #stdout 0s 4516KB
stdin
2 14
1 2 3
30 40 50
stdout
840084