Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
426 B
3
Indexable
Never
//C++ 
#include <bits/stdc++.h> 

int kq(int x){
	int res = 0;
	x=x/50000;
	for(int a = 0;a<=x;a++){
		for(int b=0;b<=x/2;b++){
			for(int c=0;c<=x/4;c++){
				for(int d = 0;d<=x/10;d++){
					if(a + b*2 + c*4 + d*10 == x) res++;
					}
				}
			}
		}
		return res;
		
	}


int main() {
  int n,res=0;
  scanf("%d",&n);
  if(n<50000 || n>5000000 || n%50000!=0) printf("0");
  else {
  	printf("%d",kq(n));
  }
    return 0;
}
Leave a Comment