Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- using namespace std;
- int main(){
- int n;
- scanf("%d", &n);
- int kr2, kr7, kr14, ans;
- kr2 = 0;
- kr7 = 0;
- kr14 = 0;
- ans = 0;
- for(int i = 0; i < n; i++){
- int x;
- scanf("%d", &x);
- if(x % 2 == 0 && x % 7 != 0){
- kr2++;
- ans += kr7 + kr14;
- }
- if(x % 7 == 0 && x % 2 != 0){
- kr7++;
- ans += kr2 + kr14;
- }
- if(x % 14 == 0){
- kr14++;
- ans += i;
- }
- if(x % 2 != 0 && x % 7 != 0) ans += kr14;
- }
- printf("%d", ans);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement