Experimental educational round:volbit formulas Blitz K

Source: Internet
Author: User

Description

IT developing computer games decided to upgrade its-to-reward its employees. Now it looks the following. After a new game release users start buying it actively, and the company tracks the number of sales with precision to each Transaction. Every time when the next number of sales are not divisible by any number from 2 to Ten every developer of this game Gets a small bonus.

A game designer Petya knows that's the company is just on to release a new game This was partly developed by him. On the basis's experience he predicts that n people would buy the game during the first month. Now Petya wants to determine how many times he'll get the bonus. Help him to know it.

Input

The only line of the input contains one integer n (1≤ n ≤10)-the prediction on the NUM ber of people who'll buy the game.

Output

Output One integer showing how many numbers from 1 to n is not divisible by any number from 2 to .

Examples input
12
Output
2
Principle of tolerance and repulsion
#include <iostream> #include <algorithm> #include <cstdio>using namespace std;typedef long Long ll;int Num[20];int N; ll sum;//n is the number of elements of num[] ll m; ll GCD (ll A,ll b) {    if (b==0) return A;    return gcd (b,a%b);} ll LCM (ll A,ll b) {    return a*b/gcd (b);//This is the least common multiple method}ll DFS (ll lcmn,int ID)    //LCMN Here is a long long!!! {    if (id<n-1) return Dfs (lcmn,id+1)-dfs (LCM (lcmn,num[id+1]), id+1);    return M/LCMN;} int main () {    int t;    n=9;    cin>>m;    for (int i=0; i<n; i++)    {        num[i]=i+2;    }    Sort (num,num+n);    sum=0;    for (int i=0; i<n; i++)        Sum+=dfs (num[i],i);    cout<<m-sum<<endl;    return 0;}

  

Experimental educational round:volbit formulas Blitz K

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.