fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, m, k, a, MIN, MAX;
  6. unsigned long rez = 1;
  7. cin >> n >> m >> k;
  8. MIN = min(m, k);
  9. MAX = max(m, k);
  10. for (int i = 1; i <= MAX; i++) {
  11. cin >> a;
  12. if (i >= MIN) rez *= a;
  13. }
  14. cout << rez;
  15. return 0;
  16. }
Success #stdin #stdout 0s 15232KB
stdin
5 3 2 1 2 3 4 5 6 7 8 9 10
stdout
6