Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int mn_mul = 1000001;
  7. int mn = 1001;
  8. int n, i;
  9.  
  10. cin >> n;
  11. int a[7];
  12. for (i = 0; i < 6; i++)
  13. cin >> a[i % 7];
  14.  
  15. for (i = 6; i < n; i++) {
  16. cin >> a[i % 7];
  17. if (a[(i-6) % 7] < mn)
  18. mn = a[(i-6) % 7];
  19. if (a[i % 7] * mn < mn_mul)
  20. mn_mul = a[i % 7] * mn;
  21. }
  22.  
  23. cout << mn_mul << endl;
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement