func_code_string: #include <bits/stdc++.h>   int Pos(int a) {     if (a < 0) {       return 0;     }     return a;   }   int main() {     int n = 0, p1 = 0, t1 = 0, p2 = 0, t2 = 0, p3 = 0;     int energy = 0;     std::vector<int> timeDatal;     std::vector<int> timeDatar;     std::cin >> n >> p1 >> p2 >> p3 >> t1 >> t2;     for (int i = 0; i < n; i++) {       int input;       std::cin >> input;       timeDatal.push_back(input);       std::cin >> input;       timeDatar.push_back(input);       energy += p1 * (timeDatar[i] - timeDatal[i]);       if (i != 0) {         int delta = timeDatal[i] - timeDatar[i - 1];         if (delta - t1 >= 0) {           energy += t1 * p1;         } else if (delta >= 0) {           energy += delta * p1;         }         delta -= t1;         if (delta - t2 >= 0) {           energy += t2 * p2;         } else if (delta >= 0) {           energy += delta * p2;         }         delta -= t2;         if (delta > 0) {           energy += p3 * delta;         }       }     }     std::cout << energy;   }   