- C20250089's blog
P1368 容斥原理
- 2023-3-6 10:13:00 @
#include<bits/stdc++.h>
using namespace std;
int main(){
long long n;
while(cin>>n){
long long ans=n;
ans-=n/2+n/5+n/11+n/13;
ans+=n/(2*5)+n/(2*11)+n/(2*13)+n/(5*11)+n/(5*13)+n/(11*13);
ans-=n/(2*5*11)+n/(2*5*13)+n/(2*11*13)+n/(5*11*13);
ans+=n/(2*5*11*13);
cout<<ans<<endl;
}
return 0;
}