eolymp
bolt
Try our new interface for solving problems
Problems

Числа

published at 11/23/17, 2:29:45 pm

привет

published at 2/13/24, 4:31:31 pm

include "bits/stdc++.h"

// by aydin_thebest

define intt long long

define F first

define S second

define vs vector <string>

define vi vector <int>

define vil vector <intt>

define fast_io ios_base::syncwithstdio(0);cin.tie(0);cout.tie(0);

define pb push_back

define endl "\n"

define pii pair<int,int>

define pss pair<string, string>

define all(v) (v).begin(), (v).end()

define rall(v) (v).rbegin(), (v).rend()

const int sz = 2e5 + 5; const int mod = 1e9 + 7; const int MAXN = 1e5 + 5; const int INF = 1e9 + 5; const double PI = acos(-1.0); using namespace std; multiset <int> ms; stack <int> st; queue <int> q; int i, j; void solve(){ int n; cin >> n; int cnt = 0; for(i = 1; i <= n; i++){ if(i%2!=0 and i%3!=0 and i%5!=0) cnt++; } cout << cnt << endl; } signed main() { fast_io; int t = 1; while(t--) { solve(); } cerr << "\nTime elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n"; return 0; }