Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
97
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 n, cnt62, cnt2, cnt31, a, i;
  7. cnt62 = 0;
  8. cnt2 = 0;
  9. cnt31 = 0;
  10.  
  11. cin >> n;
  12.  
  13. for (i = 0; i < n; i++) {
  14. cin >> a;
  15. if ( a % 31 == 0 && a % 2 != 0)
  16. cnt31++;
  17. if ( a % 2 == 0 && a % 31 != 0)
  18. cnt2++;
  19. if ( a % 62 == 0)
  20. cnt62++;
  21. }
  22. cout << cnt2*cnt31 + cnt62*(n-1) - cnt62*(cnt62-1)/2;
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement