Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n, cnt62, cnt2, cnt31, a, i;
- cnt62 = 0;
- cnt2 = 0;
- cnt31 = 0;
- cin >> n;
- for (i = 0; i < n; i++) {
- cin >> a;
- if ( a % 31 == 0 && a % 2 != 0)
- cnt31++;
- if ( a % 2 == 0 && a % 31 != 0)
- cnt2++;
- if ( a % 62 == 0)
- cnt62++;
- }
- cout << cnt2*cnt31 + cnt62*(n-1) - cnt62*(cnt62-1)/2;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement