akhauriyash/Code-Regression huggingface dataset:
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <iomanip> //setprecision
#include <limits>
using namespace std;
typedef long long ll;
typedef string str;
int main(){
    int a,b,k,ans,count=0;
    cin >> a >> b >> k;
    for(int i=min(a,b); i>0; i--){
        if(a%i==0 && b%i==0){
            count++;
            if(count==k){
                cout << i << endl;
                break;
            }
        }
    }
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main()
{
	int k,a,b;
	cin>>k>>a>>b;
	for(int i=k; i<=b; i+=k)
	{
		if(i>=a)
		{
			cout<<"OK";
			return 0;
		}
	}
	cout<<"NG";
	return 0;
}


Measured memory_bytes: 3580
//
//  main.cpp
//  A-Frog_1
//
//  Created by david chong on 10/30/19.
//  Copyright © 2019 david chong. All rights reserved.
//

#include <iostream>
#include <vector>

using namespace std;

int solve(vector<int> & inVec) {
    
    vector<int> dp(inVec.size());
    dp[0] = 0;
    
    for(int i = 1; i < inVec.size(); i++) {
        
        if(i >= 2) {
            int oneHop = abs(inVec[i] - inVec[i-1]) + dp[i-1];
            int twoHop = abs(inVec[i] - inVec[i-2]) + dp[i-2];
            dp[i] = min(oneHop, twoHop);
        } else {
            dp[i] =  abs(inVec[i] - inVec[i-1]);
        }
        
    }
    
    return dp.back();
    
}

int main(int argc, const char * argv[]) {
    
//    freopen("input.in", "r", stdin);
    
    int n;
    
    cin >> n;
    
    vector<int> inVec(n);
    
    for(int i = 0; i < n; i++) {
        cin >> inVec[i];
    }
    
    printf("%i\n", solve(inVec));
    
    
    return 0;
}


Measured memory_bytes: 1024
//#include <bits/stdc++.h>

//def
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

//array
#include <vector>
#include <set>
#include <stack>
#include <map>

using namespace std;

typedef long long ll;
typedef pair<int,int> Paint;

bool Pairsecond(const Paint& pf,Paint&ps){//sortCompare
  return pf.second < ps.second;
}

#define anyfill(n,s) setw(n) << setfill(s)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define pb push_back
#define MAX 1000000000
#define MOD 1000000007


/*
確認ポイント
to_string() はC++11以降の実装;
cout<< (char)数値 //数値にあった文字に置き換えられる
cout<< (double)int型/(2など)//小数になる
length(),size()に括弧をつけ忘れてないか;
sort()が使える型//vector,string...
大文字小文字間違えてないか
cout << fixed << 小数計算//正しい小数表記になる(基本6桁)(e記法回避にも使える)
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる
sqrt(数値型)でrootが取れる
vector.unique()は隣接した同じ要素を削除するので先にソートをする
*/
int main() { 
  int w,h,x,y;cin>>w>>h>>x>>y;
  cout << fixed << setprecision(9) <<(double)w*h/2 << " ";
  if(w%2==0 && h%2==0){
    if(w/2==x && h/2==y){
      cout << 1 << endl;
      return 0;
    }
  }
  cout << 0 << endl;

}




Measured memory_bytes: 256
#include<stdio.h>
int main(){
    int a,b,o;
    while(1){
        scanf("%d %c%d",&a,&o,&b);
        if (o=='?')break;
        else if (o=='+'){
            printf("%d",a+b);
        }
        else if (o=='-'){
            printf("%d",a-b);
        }
        else if (o=='*'){
            printf("%d",a*b);
        }
        else if (o=='/'){
            printf("%d",a/b);
        }
        printf("\n");
    }
    return 0;
}

Measured memory_bytes: 2696
#include <stdio.h>
#include <bits/stdc++.h>

using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,n,m) for(ll i=n; i>(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define VEC2(x,a,b) vector<vector<ll>> x = vector<vector<ll>>(a,vector<ll>(b,0))
#define sortAl(v) sort(v.begin(),v.end())
#define sortAlr(v) sort(v.begin(),v.end()); reverse(v.begin(),v.end())
#define cinv(v,n,m) FOR(i,n,m) cin>>v.at(i)
#define coutv(v,n,m) FOR(i,n,m) cout<<v.at(i) <<" "; cout<<endl
#define cout(n) cout<<fixed<<setprecision(n)

// a>b なら 1 a=B なら 0 a<b なら-1
int strint_cmp(string a, string b){
  if(a == b){
    return 0;
  }
  else{
    ll siz = a.size();
    FOR(i,0,siz){
      if(a[i]<b[i]) return -1;
      if(a[i]>b[i]) return 1;
    }
  }
  return 0;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  ll w,h;
  cin>>w>>h;

  while(w!=0){
    vector<string> sv(h+1,"");
    FOR(i,0,w+1){
      sv[0].push_back('.');
    }
    FOR(i,1,h+1){
      string s;
      cin>>s;
      sv[i].push_back('.');
      FOR(j,0,w){
        sv[i].push_back(s[j]);
      }
    }
    vector<vector<pair<ll,string>>> dp = vector<vector<pair<ll,string>>>(h+1,vector<pair<ll,string>>(w+1,pair<ll,string>(0,"")));

    FOR(i,1,h+1){
      FOR(j,1,w+1){
        if('0' <= sv[i][j] && sv[i][j] <= '9'){
          pair<ll,string> p;
          if(dp[i-1][j].first<dp[i][j-1].first){
            p = dp[i][j-1];
          }
          else if(dp[i][j-1].first<dp[i-1][j].first){
            p = dp[i-1][j];
          }
          else if(dp[i-1][j].first == 0){
            p = make_pair(0,"");
          }
          else{
            string a = dp[i-1][j].second;
            string b = dp[i][j-1].second;
            if(strint_cmp(a,b) > 0) p = dp[i-1][j];
            else p = dp[i][j-1];
          }
          if(sv[i][j] == '0' && dp[i][j-1].first == 0 && dp[i-1][j].first == 0){

          }
          else{
            p.first++;
            p.second += sv[i][j];
          }
          dp[i][j] = p;
        }
      }
    }

    ll max_size = 0;
    FOR(i,0,h+1){
      FOR(j,0,w+1){
        max_size = max(max_size,dp[i][j].first);
      }
    }

    vector<string> ans;
    FOR(i,0,h+1){
      FOR(j,0,w+1){
        if(dp[i][j].first == max_size){
          ans.push_back(dp[i][j].second);
        }
      }
    }

    sortAlr(ans);
    cout<<ans[0]<<endl;
    cin>>w>>h;
  }


}



Measured memory_bytes: 3160
#include<bits/stdc++.h>
using namespace std;

#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define uniq(x) (x).erase(unique(all(x)), (x).end())
#define bit(n) (1LL << (n))
#define dump(x) cerr << #x " = " << (x) << endl
using vint=vector<int>;
using vvint=vector<vint>;
using pint=pair<int, int>;
using vpint=vector<pint>;
template<typename T> using priority_queue_rev=priority_queue<T, vector<T>, greater<T>>;
constexpr double pi = 3.1415926535897932384626433832795028L;
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<typename T> void fin(T mes) {
    cout << mes << endl;
    exit(0);
}
template<typename T1, typename T2> bool chmax(T1 &a, const T2 &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> bool chmin(T1 &a, const T2 &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct setup {
    static constexpr int PREC = 20;
    setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

template<typename T>
struct fenwick_tree {
    int n;
    T ZERO;
    std::vector<T> data;
    fenwick_tree(int n, T ZERO = T()) : n(n), ZERO(ZERO), data(n + 1, ZERO) {}
    void add(int i, T x) { for (i++; i <= n; i += i & -i) { data[i] += x; }}
    T get_sum(int i) const {
        if (i > n) { i = n; }
        T ret = ZERO;
        for (; i > 0; i -= i & -i) { ret += data[i]; }
        return ret;
    }
    T get_sum(int l, int r) const {
        if (l < r) { return get_sum(r) - get_sum(l); }
        else { return ZERO; }
    }
};

int N, M;
int L[110000], R[1100000];
signed main() {
    cin >> N >> M;
    fenwick_tree<int> ft(N + 2);
    rep(i, M) {
        cin >> L[i] >> R[i];
        ft.add(L[i], 1), ft.add(R[i] + 1, -1);
    }
    int ans = 0;
    for (int i = 2; i <= N + 1; i++) { if (ft.get_sum(i) == M) { ans++; }}
    cout << ans << endl;
}


Measured memory_bytes: 2560
A,B,C,D=map(int, input().split())

# 最大公約数を求める
ans = 0
tmp1, tmp2 = C, D
while 1:
  if tmp1 % tmp2 == 0:
    ans = tmp2
    break
  else:
    tmp = tmp1 % tmp2
    tmp1 = tmp2
    tmp2 = tmp
ans = int(C*D/ans)
#print(ans)

num1 = B//C
num2 = (A-1)//C
num_C = num1-num2

num1 = B//D
num2 = (A-1)//D
num_D = num1-num2

num1 = B//ans
num2 = (A-1)//ans
num_CD = num1-num2

print(B-A+1-num_C-num_D+num_CD)

Measured memory_bytes: 9076
#include <bits/stdc++.h>
using namespace std;

const int MOD = 1000000007;
const int INF = 1e9;

int n,m;
const int MAX = 2 * 1e5;
vector<vector<int>> fre(MAX + 1);

vector<int> tree(MAX + 1, 0);
vector<int> seen(MAX+1, 0);

void dfs(int i, int j){
  if(seen[i] != 0) return;

  tree[j]++;
  seen[i] = 1;
  
  for(auto next : fre[i]){
    if(seen[next] != 0) continue;
    // seen[next] = 1;
    // tree[j]++;
    dfs(next, j);
  }

  return;
}

int main(){
  cin >> n >> m;
  for(int i = 0; i < m; i++){
    int a,b;
    cin >> a >> b;
    a--;
    b--;
    fre[a].push_back(b);
    fre[b].push_back(a);
  }

  int j = 0;
  for(int i = 0; i < n; i++){
    dfs(i, j);
    j++;
  }

  int ans = 0;
  for(int i = 0; i < n; i++){
    ans = max(ans, tree[i]);
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 21852
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007
#define INF (1 << 30)
#define REP(i, m, n) for(int i = (int)m; i < (int)n; ++i)
#define rep(i, n) REP(i, 0, n)


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n; cin >> n;
    bool flag = false;
    REP(i, 1, 10) {
        if(n%i == 0 && 0 < n/i && n/i < 10) flag = true;
    }
    cout << (flag ? "Yes" : "No") << '\n';
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <typeinfo>
#include <set>
#include <bitset>
#include <string>
#include <map>
#include <algorithm>
#include <iomanip>
#include <numeric>
using namespace std;
typedef long long ll;

int main(){
  int a, b, x;
  cin >> a >> b>> x;
  long double z;
  z = b*a*a/2;
  long double m;
  if(x >= z){
    m = (2*b*1.0-2.0*x/a/a)/a;
    cout << setprecision(12) << atan(m)/3.14159265358979*180 << endl;
  }else{
    m = a*b*b*1.0/(2*x);
    cout << setprecision(12) << atan(m)/3.14159265358979*180<< endl;
  }
} 

Measured memory_bytes: 256
N=int(input())
A=[int(i) for i in input().split()]
B=sorted([A[j]-j-1 for j in range(N)])

def median(seq):
    s = sorted(seq)
    if len(s) % 2 == 0:          # 要素が偶数個なら2つの平均
        return (s[len(s) // 2] + s[(len(s) // 2) - 1]) / 2
    else:
        return s[len(s) // 2]    # 要素が奇数個なら中央の値

b=median(B)

ans=0
for i in range(N):
    ans+=abs(A[i]-(b+i+1))

print(int(ans))

Measured memory_bytes: 26180
//Relive your past life.
//Face your demons.
//The past is never dead,it is not even past.
//The memories are not only the key to the past but...also to the future.
//coded in Rusty Lake
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define ll   long long
#define pb   push_back
#define mp   make_pair
#define orz  1000000007
using namespace std;
int n,ans=orz;
string s,t;
int main(){
    cin>>s;
    for(char c='a';c<='z';++c){
        t=s+c;
        int res=0,k;
        for(int i=t.size()-1;i>=0;--i){
            if(t[i]==c)k=i;
            res=max(res,k-i);
        }
        ans=min(ans,res);
    }
    printf("%d\n",ans);
    //system("pause");
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(void)
{
	string apple = "apple";
	string peach = "peach";
	string target;

	vector<int> pos1;
	vector<int> pos2;

	getline( cin, target );
	pos1.push_back( -5 );

	for( int i = 0;pos1[i] != string::npos;i++ ){
		pos1.push_back( target.find( apple, pos1[i] + 5 ) );
	}
	pos2.push_back( -5 );

	for( int i = 0;pos2[i] != string::npos;i++ ){
		pos2.push_back( target.find( peach, pos2[i] + 5 ) );
	}

	for( int i = 1;pos1[i] != string::npos;i++ ){
		target.replace( pos1[i], peach.size(), peach );
	}
	for( int i = 1;pos2[i] != string::npos;i++ ){
		target.replace( pos2[i], apple.size(), apple );
	}
	
	cout << target << endl;

	return 0;
}

Measured memory_bytes: 0
#include <algorithm>
#include <string>
#include <vector>
#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> d;
    for (int i=0;i<n;i++){
        int a;
        cin >> a;
        d.push_back(a);
    }
    sort(d.begin(),d.end());
    int ans = d[n/2] - d[n/2 -1];
    if(ans < 0){
        ans = 0;
    }
    cout << ans;
}



Measured memory_bytes: 892
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let n: usize = sc.read();
    let k: usize = sc.read();
    let modulo: usize = sc.read();

    let mut dp = vec![vec![0; 1 << k]; 2 * n + 1];
    dp[0][0] = 1;
    for i in 0..(2 * n) {
        for mask in 0..(1 << k) {
            if mask == (1 << k) - 1 {
                continue;
            }
            if mask & (1 << (k - 1)) == 0 {
                let next = (mask << 1) | 1;
                dp[i + 1][next] += dp[i][mask];
                dp[i + 1][next] %= modulo;
            }
            if mask > 0 {
                let next = (mask - mask.highest_one_bit()) << 1;
                dp[i + 1][next] += dp[i][mask];
                dp[i + 1][next] %= modulo;
            }
        }
    }

    let mut ans = dp[2 * n][0];
    if n == k {
        ans += 1;
    }
    println!("{}", ans % modulo);
}

trait HighestOneBit {
    fn highest_one_bit(self) -> usize;
}

impl HighestOneBit for usize {
    fn highest_one_bit(self) -> usize {
        (self + 1).next_power_of_two() >> 1
    }
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}



Measured memory_bytes: 5048
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
using ll = long long;
using pii = pair<int,int>;

const int INF = 2e9;

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    ll ans = 0;
    ll b = 0;
    rep(i,n){
        if(b > a[i]){
            ans += (b - a[i]);
            a[i] = b;
        }
        else b = a[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 4004
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  int N;
  cin >> N;
  vector<int> v;
  int sum = 0;
  rep(i,N){
    int a;
    cin >> a;
    sum ^= a;
    v.push_back(a);
  }

  rep(i,N){
    if(i>0) cout << " ";
    cout << (sum ^ v[i]);
  }
  cout << endl;
  
  return 0;
}


Measured memory_bytes: 4244
#include <bits/stdc++.h>

using namespace std;

int n,cnt,a[100005],s[100005];
vector <int> v;

int main (){
	cin >> n;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		s[a[i]] = i;
	}
	for (int i = 1;i <= n; i++){
		cout << s[i] << " ";	
	}
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int a[3010];
ll dp[3010][3010][2]; /// dp table

ll go(int l, int r, bool turn) {
    if(r < l) return 0;

    if(dp[l][r][turn] != -1) return dp[l][r][turn];

    ll op1 = (turn ? -a[l] : a[l]) + go(l + 1, r, !turn);
    ll op2 = (turn ? -a[r] : a[r]) + go(l, r - 1, !turn);

    if(!turn) return dp[l][r][turn] = max(op1, op2);
    else return dp[l][r][turn] = min(op1, op2);
}

int main() {
    ios_base::sync_with_stdio(false);

    int n;
    cin >> n;

    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }

    memset(dp, -1, sizeof dp);

    cout << go(0, n - 1, 0) << endl;
}

/*
 * L
**/


Measured memory_bytes: 141952
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace D
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var nk = Console.ReadLine().Trim().Split(' ').Select(long.Parse).ToArray();
            var ai = Console.ReadLine().Trim().Split(' ').Select(long.Parse).ToArray();
            if (nk[1] == 0)
            {
                Console.WriteLine(ai.Sum());
                return;
            }

            var maxBit = 0;
            var tmp = nk[1];
            while (tmp > 1)
            {
                tmp >>= 1;
                maxBit++;
            }

            var x = 0L;
            for (var b = maxBit; b >= 0; b--)
            {
                if ((x | (1L << b)) > nk[1]) continue;
                var bit1 = 0;
                for (var i = 0; i < ai.Length; i++)
                {
                    if (((ai[i] >> b) & 1) == 1) bit1++;
                }
                if (bit1 < (ai.Length + 1) / 2) x |= (1L << b);
            }
            Console.WriteLine(ai.Select(a => x ^ a).Sum());
        }
    }
}


Measured memory_bytes: 33244
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;

int tab[300000];

int main()
{



long long n;
cin>>n;

long long x = 2;
long long z = 1;
long long a = 0;

for(int i = 0; i < n; i++)
{

    a = x + z;
    x = z;
    z = a;

}
cout<<x;



    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main()
{
    int n,k;
    cin>>n>>k;
    int count=0;
    while (n>=k)
    {
        n/=k;
        count++;
    }
    
    
    cout<<count+1<<endl;

    return 0;
}

Measured memory_bytes: 256
<?php
$L=(int)trim(fgets(STDIN));

$p=[0,0];
for($i=0;$i<$L;$i++){
  $C=explode(' ',trim(fgets(STDIN)));
  $c=strcmp($C[0],$C[1]);

  if($c<0) $p[1]+=3;
  elseif($c>0) $p[0]+=3;
  else{
    ++$p[0];
    ++$p[1];
  }
}

echo $p[0],' ',$p[1];
?>

Measured memory_bytes: 15532
def get_primes(n):
    numbers = set(range(n, 1, -1))
    primes = []
    while numbers:
        p = numbers.pop()
        primes.append(p)
        numbers.difference_update(set(range(p*2, n+1, p)))
    return primes
N=int(input())
primes=get_primes(N)
numbers=[]
for i in primes:
  temp=0
  j=1
  while i**j<=N:
    temp+=N//(i**j)
    j+=1
  numbers.append(temp)
counter3=0
counter5=0
counter15=0
counter25=0
counter75=0
for i in numbers:
  if i>1:
    counter3+=1
  if i>3:
    counter5+=1
  if i>13:
    counter15+=1
  if i>23:
    counter25+=1
  if i>73:
    counter75+=1
print(counter75+(counter5-1)*counter15+(counter3-1)*counter25+(counter3-2)*(counter5-1)*counter5//2)

Measured memory_bytes: 3064
#include <stdio.h>

int main(void)
{
	char N[3];
	int count=0;
	int i;
	scanf("%s",&N);
	
	for(i=0;i<4;i++){
	if(N[i]=='2'){
	    count=count+1;}
	}
	
	printf("%d\n",count);
}

Measured memory_bytes: 128
#define _CRT_SECURE_NO_WARNINGS
//#define _USE_MATH_DEFINES
#include<stdio.h>
//#include<stdlib.h>
//#include<math.h>
//#include<string.h>
//#include<time.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)

int main() {
	int in, ans;
	char op[2];
	fscanf(stdin, "%d", &ans),getchar();
	for (; fscanf(stdin, "%c", &op), op[0] != '=';) {
		getchar();
		fscanf(stdin, "%d", &in),getchar();
		switch (op[0]) {
		case '+': ans += in; break;
		case '-': ans -= in; break;
		case '*': ans *= in; break;
		case '/': ans /= in; break;
		}
	}
	P(d, ans);
	return 0;
}

Measured memory_bytes: 604
h,w=map(int,input().split())
s=["?"*(w+2)]+["?"+input()+"?" for _ in [0]*h]+["?"*(w+2)]
memo=[[None for _ in range(w)] for _ in range(h)]
cnt=0
for i in range(1,h+1):
    for j in range(1,w+1):
        if memo[i-1][j-1]==None:
            memo[i-1][j-1]=True
            maru=(s[i][j]==".")
            batsu=1-maru
            q=[(i,j)]
            while(q):
                qq=[]
                for k,l in q:
                    if s[k-1][l]!="?":
                        if memo[k-2][l-1]==None:
                            if s[k-1][l]!=s[k][l]:
                                memo[k-2][l-1]=True
                                qq.append((k-1,l))
                                if s[k-1][l]==".":
                                    maru+=1
                                else:
                                    batsu+=1
                    if s[k+1][l]!="?":
                        if memo[k][l-1]==None:
                            if s[k+1][l]!=s[k][l]:
                                memo[k][l-1]=True
                                qq.append((k+1,l))
                                if s[k+1][l]==".":
                                    maru+=1
                                else:
                                    batsu+=1
                    if s[k][l-1]!="?":
                        if memo[k-1][l-2]==None:
                            if s[k][l-1]!=s[k][l]:
                                memo[k-1][l-2]=True
                                qq.append((k,l-1))
                                if s[k][l-1]==".":
                                    maru+=1
                                else:
                                    batsu+=1
                    if s[k][l+1]!="?":
                        if memo[k-1][l]==None:
                            if s[k][l+1]!=s[k][l]:
                                memo[k-1][l]=True
                                qq.append((k,l+1))
                                if s[k][l+1]==".":
                                    maru+=1
                                else:
                                    batsu+=1
                q=qq
            cnt+=maru*batsu
print(cnt)

Measured memory_bytes: 4592
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)n - 1; i > -1; i--)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ld long double
typedef pair<ll, ll> pll;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int x;
    cin >> x;
    cout << 1 - x << endl;

    return 0;
}

Measured memory_bytes: 3636
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<queue>
#include<set>
using namespace std;

int main(void){
    int n, tmp;cin>>n;
    set<int> s;
    for(int i=0;i<n;i++){
        cin>>tmp;s.insert(tmp);
    }
    cout<<s.size()<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define DUMP(x)  cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define IFOR(i, m, n) for(int i = n - 1; i >= m; i-- )
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
/* テンプレートここまで */
const int MOD = 1e9+7;

int main() {
  int H, W, K; cin >> H >> W >> K;

  vector<vector<ll>> dp(H+1, vector<ll>(W+1, 0));
  vector<ll> fib(W+1, 0);

  fib[0] = fib[1] = 1;
  FOR(i, 2, W){
    (fib[i] = fib[i-1] + fib[i-2]) %= MOD;
  }

  dp[0][1] = 1;

  REP(h, H) FOR(k, 1, W+1){
    ll tmp = dp[h][k];
    (dp[h+1][k] += fib[k-1] * fib[W-k] % MOD * tmp % MOD) %= MOD;
    if(k >= 2) (dp[h+1][k-1] += fib[k-2] * fib[W-k] % MOD * tmp % MOD) %= MOD;
    if(k <= W-1) (dp[h+1][k+1] += fib[k-1] * fib[W-k-1] % MOD * tmp % MOD) %= MOD;
  }

  cout << dp[H][K] << endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
double tenchoku(double x1, double y1 , double x2 , double y2, double x, double y) {
double a = (y1-y2)/(x1-x2);
double b = -1;
double c = y1-a*x1;
double k = abs(a*x+b*y+c)/sqrt(a*a+b*b);
return k;}
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);}
return res;}
int main(){
cout << fixed << setprecision(10);
ll counter=0;
ll f=0;
ll n;
cin>>n;
ll a[100005]={};
ll ca=0;
ll cb=0;
for(ll i=0; i<100001; i++){
cin>>f;
a[f]++;}
for(ll i=0; i<100001; i++){
if(a[i]>2){
if(a[i]%2==0){
a[i]=2;}
else{
a[i]=1;}}}
for(ll i=0; i<100001; i++){
if(a[i]==2){
counter++;}
if(a[i]==1){
ca++;}}
if(counter%2==0){
cout<<counter+ca<<endl;}
else{
cout<<counter+ca-1<<endl;}}


Measured memory_bytes: 4444
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);
//cin.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
int main(){
    int n,x;cin>>n>>x;
    int l[n];rep(i,0,n)cin>>l[i];
    int ans=1;
    int now=0;
    rep(i,0,n){
        now+=l[i];
        if(now<=x)ans++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
    string n;
    int sum = 0;
    cin >> n;
    for(int i=0; i<n.length(); i++)
    {
        char c = n[i];
        int num = atoi(&c);
        sum += num;
    }
    if(sum % 9) cout << "No" << endl;
    else cout << "Yes" << endl;

    return 0;
}



Measured memory_bytes: 3736
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
using namespace std;

ll dp[3005][3005];

int main(int argc, char* argv[])
{
    int n;
    scanf("%d", &n);

    int i,j;
    for(i=0; i<n; i++) {
        scanf("%d", &dp[i][1]);
    }
    for(j=2; j<=n; j++) {
        for(i=0; i<=n-j; i++) {
            dp[i][j]=MAX(-dp[i][j-1]+dp[i+j-1][1], -dp[i+1][j-1]+dp[i][1]);
        }
    }
    printf("%lld\n", dp[0][n]);

    return 0;
}


Measured memory_bytes: 69888
#include <bits/stdc++.h>
using namespace std;

int f(int i,string s){
  int count=0;
  for(int j=i;j<s.size();j++){
    if(s.at(j)=='A' || s.at(j)=='C'){
      count++;
      continue;
    }else if(s.at(j)=='G' || s.at(j)=='T'){
      count++;
      continue;
    }else{
      break;
    }
  }
  return count;
}

int main(){
  string s;
  cin >> s;
  int n;
  n=f(0,s);
  for(int i=1;i<s.size();i++)
    n=max(n,f(i,s));
  cout << n;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int main(){
	int N; cin >> N;
	string S; cin >> S;
	for(int i=0; i<S.size(); i++){
		int aa = S[i] - 'A';
		aa += N;
		aa %= 26;
		S[i] = 'A' + aa;
	}
	for(int i=0; i<S.size(); i++) cout << S[i];
	cout << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

class Solution {
public:
	void solve() {
		int n;
		cin >> n;
		long long m = 1000;
		vector<int> a(n, 0);
		for (int i = 0; i < n; i++) cin >> a[i];
		for (int i = 0; i < n - 1; i++) {
			if (a[i] < a[i + 1]) {
				m += (a[i + 1] - a[i]) * (m / a[i]);
			}
		}
		cout << m << endl;

		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

Measured memory_bytes: 3616
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define REP(i, start, end) for (ll i = start, i##Len = (end); i < i##Len; ++i)
#define REPR(i, start, end) for (ll i = start, i##Len = (end); i > i##Len; --i)
using ll = long long;
using namespace std;

int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);

    string s, t;
    cin >> s >> t;
    int n = s.size(), m = t.size();
    ll ans = m;

    REP(i, 0, n - m + 1)
    {
        ll cnt = 0;
        REP(j, 0, m)
        if (s[i + j] != t[j])++ cnt;
        ans = min(ans, cnt);
    }

    cout << ans << endl;
}

Measured memory_bytes: 3652
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
string S;

int main()
{
    cin >> S;
    if (S[0] == S[1] && S[1] == S[2])
    {
        cout << "No" << endl;
    }
    else
    {
        cout << "Yes" << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <algorithm>
#include <bitset>
#include <tuple>
#include <set>
#include <map>
#define range(i, r) for(int i=0;i<r;i++)
#define ranges(i, l, r) for(int i=l;i<r;i++)
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi std::vector<std::vector<int> >
#define vvl std::vector<std::vector<ll> >
#define MODs 1000000007;
#define MODn 1000000009;
typedef long long int ll;
using namespace std;

struct tree{
  int x;
  std::vector<tree*> child;
};
int main(int argc, char const *argv[]) {
  int N;
  std::cin >> N;
  std::vector<tree*> trees;
  if(N == 3){
    std::cout << 2 << '\n';
    std::cout << 1 << " " << 3 << '\n';
    std::cout << 2 << " " << 3 << '\n';
  }else{
    //case 4
    tree a, b, c, d;
    a.x = 1, b.x = 2, c.x = 3, d.x = 4;
    a.child.push_back(&b), a.child.push_back(&c);
    b.child.push_back(&a), b.child.push_back(&d);
    c.child.push_back(&a), c.child.push_back(&d);
    d.child.push_back(&b), d.child.push_back(&c);
    trees.push_back(&a);
    trees.push_back(&b);
    trees.push_back(&c);
    trees.push_back(&d);
    tree check[101];
    for(int i=5;i<=N;i++){
      if(i%2==1){
        check[i].x = i;
        for(int j = 0;j<trees.size();j++){
          check[i].child.push_back(trees[j]);
          (*trees[j]).child.push_back(&check[i]);
        }
        trees.push_back(&check[i]);
      }else{
        check[i].x = 1;
        for(int j=0;j<trees.size();j++){
          (*trees[j]).x ++;
          if((*trees[j]).x==i) continue;
          (*trees[j]).child.push_back(&check[i]);
          check[i].child.push_back(trees[j]);
        }
        trees.push_back(&check[i]);
      }
    }
    //push_ans
    vvi ans = vector<vector<int> >();
    for(int i=0;i<trees.size();i++){
      for(int j=0;j<(*trees[i]).child.size();j++) ans.push_back(std::vector<int> {(*trees[i]).x, (*trees[i]).child[j]->x});
    }
    for(int i=0;i<ans.size();i++){
      if(ans[i][0]>=ans[i][1]) swap(ans[i][0], ans[i][1]);
    }
    sort(ans.begin(), ans.end());
    std::cout << ans.size()/2 << '\n';
    for(int i=0;i<ans.size();i+=2) std::cout << ans[i][0] << " " << ans[i][1] << '\n';
  }
  return 0;
}


Measured memory_bytes: 1024
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int d = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int result = Math.max(a * b, c * d);

        // 出力
        System.out.println(result);
    }
}


Measured memory_bytes: 21716
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<pair<int, int>> ab(m);
    for (int i = 0; i < m; i++) cin >> ab[i].first >> ab[i].second;
    sort(ab.rbegin(), ab.rend());

    int div_point = 0, ans = 0;
    for (int i = 0; i < m; i++) {
        if (div_point < ab[i].first || ab[i].second <= div_point) {
            div_point = ab[i].first;
            ans++;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 1024
($a,$b,$c,$d,$e,$f)=glob<>;$_=$a;
sub f{
	my($x,$y)=@_;
	$h{"@_"}//=$x*100+$y>$f||$x*$e<$y?-1:(f($x+$a,$y),f($x+$b,$y),f($x,$y+$c),f($x,$y+$d),$y/$x);
	$_="@_"if$h{"@_"}>$h{$_};
}
f($a,0);
f($b,0);
($a,$b)=glob;
print$a*100+$b,$",0+$b;

Measured memory_bytes: 2944
#include <bits/stdc++.h> 

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
 
#define nl '\n'
 
#define y1 aza_ibagaliev
 
#define f first
#define s second
	
#define ed end()
#define bg begin()
#define rbg rbegin()
 
#define rv reverse
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define ppf pop_front
 
#define sz size()
#define all(x) x.bg, x.ed
 
#define pll pair < ll, ll >
#define pii pair < int, int >
 
#define sqr(x) ((x) * 1ll * (x))
#define sqrd(x) ((x) * 1.0 * (x))
 
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
 
#define rnl cout << "----------------------------------------" << nl
 
#define bit __builtin_popcount
 
inline ll bip(ll x, ll n, ll mod){ll res=1;while(n){if(n & 1){res=(res*x)%mod;}x=(x*x)%mod;n>>=1;}return res;}
        	
const int ppr = 257;
const ll INF = 2e18;
const int inf = 2e9;
const int mod = 1e9 + 7;
const int N = 1e5 + 123;
const ld pi = 3.1741592653589793238462643;
 
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};

int n, W, w[N], v[N];
ll dp[N];
bool ok[N];

main() {             	
//  freopen(".in", "r", stdin);
//  freopen(".out", "w", stdout);

//	srand(time(NULL));

	cin >> n >> W;

	for(int i = 1; i <= n; i++)
		cin >> w[i] >> v[i];

	ok[0] = 1;

	for(int i = 1; i <= n; i++) 
		for(int j = W; j >= 0; j--) 
			if(j - w[i] >= 0 && ok[j - w[i]]) {
				ok[j] |= 1;
				dp[j] = max(dp[j], dp[j - w[i]] + v[i]);
			}

	ll ans = 0;
	for(int i = 0; i <= W; i++)
		ans = max(ans, dp[i]);

	cout << ans;
	   
    return 0;                                        
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using Graph = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Rep(i, k, n) for (int i = k; i < (int)(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
long long h[100010];

int main()
{
    int N; cin >> N;
    rep(i, N) cin >> h[i];

    vector<ll> dp(100010, INF);
    dp[0] = 0;

    rep(i, N)
    {
        chmin(dp[i + 1], dp[i] + abs(h[i] - h[i + 1]));
        chmin(dp[i + 2], dp[i] + abs(h[i] - h[i + 2]));
    }
    cout << dp[N - 1] << endl;
}


Measured memory_bytes: 1792
/*
Created on Fri Aug 25 16:34:06 2020

@author: roastedcoder

*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long int ull;
const int mod = 1e9+7;
#define endl "\n"
#define append push_back
#define roastedcoder ios_base::sync_with_stdio(false); cin.tie(NULL);
//__________________________________________________________________

int a[101];
int wt[101];
ll dp[101][100001];
ll weird(int n, int w) {
	if(n == 0 || w == 0) return 0;
	if(dp[n][w] != -1) return dp[n][w];
	
	if(wt[n-1] <= w)
		return dp[n][w] = max(a[n-1] + weird(n-1, w-wt[n-1]), weird(n-1, w));
	
	return dp[n][w] = weird(n-1, w);
}

int main() {
	roastedcoder
	memset(dp, -1, sizeof(dp));
	int n, w; cin>>n>>w;
	for(int i = 0; i<n; i++) {
		cin>>wt[i]>>a[i];
	}
	
	cout<<weird(n, w);
}

//__________________________________________________________________
/*
Sample Input:
500 1000 20 30


Sample Output:
Vasya

*/

Measured memory_bytes: 82584
N = int(input())
balls = [
    [int(s) for s in input().split(' ')]
    for i in range(N)
]
balls.sort(key=lambda p: p[1])
balls.sort(key=lambda p: p[0])
d = {}
d_max = 0
for i in range(N):
    for j in range(i + 1, N):
        p = balls[j][0] - balls[i][0]
        q = balls[j][1] - balls[i][1]
        if not p in d:
            d[p] = {}
        d[p][q] = (d[p][q] if q in d[p] else 0) + 1
        d_max = max([d_max, d[p][q]])
print(N - d_max)

Measured memory_bytes: 3444
#pragma GCC optimize("Ofast")   //Comment optimisations for interactive problems (use endl)
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define  foo(i,a,n)     for(ll i = (a); i <= n; i++)
#define  frr(i,a,n)     for(ll i = (a); i >= n; i--)
#define  fo(i,n)        for(ll i = 0; i < n; i++)
#define  all(x)         (x).begin(),(x).end()
#define  mset(x,val)    memset(x,val,sizeof(x))
#define  newl           cout<<"\n"
#define  pb             push_back
#define  mp             make_pair
#define  s              second
#define  f              first
#define  dline          cerr<<"///REACHED///\n";
#define  deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define  deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define  deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  vector<pll>           vpll;

const ll   MOD   =  1e+9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;
const ll   MAXN  =  1e+5+7;

vll adj[MAXN];ll visit[MAXN]={};
int dx8[]={0,1,1,1,0,-1,-1,-1}, dy8[]={1,1,0,-1,-1,-1,0,1};
int dx4[]={0,1,0,-1}, dy4[]={1,0,-1,0};

//<<-----Declare Variable Here------->>//
int t=1;
ll n;
//<<-----Implement Functions Here---->>//


//<<-----Start of Main--------------->>//
void MAIN(){
		ll l,r,d;
		cin>>l>>r>>d;
		cout<<r/d-(l-1)/d<<endl;
}

int main(){
	fastio;randomINIT;

	//cin>>t;
	while(t--){
		MAIN();
	}

    #ifndef ONLINE_JUDGE
    cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
}

Measured memory_bytes: 5960
#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int main() {
    long long n;
    cin >> n;
    long long dp[n + 1];
    dp[0] = 1;
    for (long long i = 1; i <= n; i++) dp[i] = 0;
    for (long long i = 3; i <= n; i++)
        for (long long j = 0; j < i - 2; j++)
            dp[i] = (dp[i] + dp[j]) % mod;
    cout << dp[n];
}


Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll

typedef vector<int> vi;
typedef vector<bool> vb;
typedef pair<int,int> pii;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<bool> > vvb;
typedef map<int, bool> mib;

typedef long long ll;
typedef vector<long long> vl;
typedef pair<long long,long long> pll;
typedef vector<pair<long long,long long> > vpll;

typedef vector<string> vs;

typedef long double ld;

#define _GLIBCXX_DEBUG

#define REP(i,n) for (int i = 0; i < (n); ++i)
#define REPD(i,n) for (int i = (n-1); i >= 0; --i)
#define FORE(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORED(i, s, n) for (int i = (s); i >= (int)(n); i--)
#define debug(x) cerr << #x << ": " << x << '\n'
#define debug2(x, y) cerr << #x << ": " << x << ", " << #y << ": " << y << '\n'
#define debug3(x, y, z) cerr << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << '\n'
#define debugs(s) cerr << s << "\n"
#define hyphen() cerr << "--\n"

#define ALL(vec) (vec).begin(), (vec).end()
#define REVALL(vec) (vec).rbegin(), (vec).rend()

static const int dy[4] = {0,1,0,-1}, dx[4] = {1,0,-1,0};

#define fst first
#define snd second
#define pb push_back
#define mk(x,y) make_pair((x),(y))

// http://ehafib.hatenablog.com/entry/2015/12/23/164137
int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a;a=1ll*a*a;}while(b>>=1);return ans;}
int qpm(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
// gcd : O(logN)
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a, int b) { return a / gcd(a, b) * b; }

#define sz(v) int(v.size())

// x1, x2ライブラリとの被りを避ける
#define x1 x192837465
#define x2 x123456789
#define y1 y192837465
#define y2 y123456789

// typo
#define itn int
#define reutrn return
#define reutnr return
#define srting string

#define make(type, x) type x; cin>>x;
#define make2(type, x, y) type x, y; cin>>x>>y;
#define make3(type, x, y, z) type x, y, z; cin>>x>>y>>z;
#define make4(type, x, y, z, t) type x, y, z, t; cin>>x>>y>>z>>t;

int ctoi(const char c){
    if('0' <= c && c <= '9') return (c-'0');
    return -1;
}

#define uniq(v) (v).erase(unique(ALL((v))), (v).end());

// area of (0, 0)(a, b)(c, d)
double area(double a, double b, double c, double d){
    return abs(a * d - b * c) / 2.0;
}

const int PREC = 10;
#define coutf(val) cout << fixed << setprecision(PREC) << (val) << endl;

const int MOD = (int)1e9 + 7;
const int INF = numeric_limits<int>::max();

signed main() {
    make(int, N);

    int sum = 0;

    vector<int> As(N);
    REP(i, N) {
        make(int, A);
        As.at(i) = A;

        sum = (sum ^ A);
    }

    REP(i, N) {
        int n = sum ^ As.at(i);
        cout << n << " ";
    }
    cout << endl;

}


Measured memory_bytes: 4844
import sys
if sys.version[0] == '2':
    range, input = xrange, raw_input

class HeavyLightDecomposition:
    def __init__(self, g, root=0):
        self.g = g
        self.vid, self.head, self.heavy, self.parent = [0] * len(g), [-1] * len(g), [-1] * len(g), [-1] * len(g)
        self.dfs(root)
        self.bfs(root)
 
    def dfs(self, root):
        stack = [(root, -1)]
        sub, max_sub = [1] * len(self.g), [(0, -1)] * len(self.g)
        used = [False] * len(self.g)
 
        while stack:
            v, par = stack.pop()
            if not used[v]:
                used[v] = True
                self.parent[v] = par
                stack.append((v, par))
                stack.extend((c, v) for c in self.g[v] if c != par)
            else:
                if par != -1:
                    sub[par] += sub[v]
                    max_sub[par] = max(max_sub[par], (sub[v], v))
                self.heavy[v] = max_sub[v][1]
 
    def bfs(self, root=0):
        from collections import deque
        k, que = 0, deque([root])
        while que:
            r = v = que.popleft()
            while v != -1:
                self.vid[v], self.head[v] = k, r
                for c in self.g[v]:
                    if c != self.parent[v] and c != self.heavy[v]:
                        que.append(c)
                k += 1
                v = self.heavy[v]
 
    def lca(self, u, v):
        while self.head[u] != self.head[v]:
            if self.vid[u] > self.vid[v]:
                u, v = v, u
            v = self.parent[self.head[v]]
        else:
            if self.vid[u] > self.vid[v]:
                u, v = v, u
        return u
 
N = int(input())
g = [[] for _ in range(N)]
for i in range(N):
    for c in map(int, input().split()[1:]):
        g[i].append(c)
        g[c].append(i)
hld = HeavyLightDecomposition(g)
Q = int(input())
for _ in range(Q):
    u, v = map(int, input().split())
    print(hld.lca(u, v))

Measured memory_bytes: 38688
#include <iomanip>
#include <iostream>
using namespace std;
int main()
{
 int n;
 float k;
 cin >> n;
 if(n%2==0)
 cout << "0.5000000000";
 else
 {
  k=(float)n;
  cout << std::fixed << std::setprecision(10) << (k+1)/(2*n);
 }
 return 0;
}

Measured memory_bytes: 256
import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)

    val n = scanner.nextLong()

    var ret = n
    (1L..1000000L).forEach { i ->
        if (n % i != 0L) return@forEach
        ret = Math.min(ret, i + n / i - 2)
    }

    println(ret)
}

Measured memory_bytes: 33560
process = []
n, q = [int(i) for i in input().split(" ")]
for i in range(n):
    name, time = input().split(" ")
    time = int(time)
    process.append([name, time])

time = 0
while len(process) > 0:
    p = process.pop(0)
    if p[1] <= q:
        time += p[1]
        print(p[0], time)
    else:
        p[1] -= q
        time += q
        process.append(p)



Measured memory_bytes: 13020
#include<bits/stdc++.h>
using namespace std;

enum {LOW, GOOD, HIGH, NAUGHT};

using V = tuple<int, int, int>;         // elapsed time, body heat, room id
struct E {int from, to, weight;};
using Graph = vector<vector<E>>;

using Node = tuple<int, int, int, int>; // cost & Vertex

const Node NIL(-1, -1, NAUGHT, -1);

int main() {
  int N, M, X;
  cin >> N >> M >> X;

  vector<int> T(N);
  for(auto& i: T) cin >> i;

  Graph G(N);
  for(auto i = 0; i < M; ++i) {
    int A, B, D;
    cin >> A >> B >> D;
    --A; --B;
    G[A].push_back({A, B, D});
    G[B].push_back({B, A, D});
  }

  auto next = [&](int cost, int time, int heat, int room, E e) {
    if(T[e.to] != GOOD && T[e.to] != heat && time + e.weight < X) return NIL;
    if(T[e.to] != GOOD) return Node(cost + e.weight, 0, T[e.to], e.to);
    else                return Node(cost + e.weight, min(time + e.weight, X), heat, e.to);
  };

  map<V, int> d;
  priority_queue<Node, vector<Node>, greater<Node>> q;
  q.emplace(0, 0, LOW, 0);
  while(!q.empty()) {
    int cost, time, heat, room;
    tie(cost, time, heat, room) = q.top();
    q.pop();
    if(d.count(V(time, heat, room))) continue;
    d[V(time, heat, room)] = cost;
    if(room == N-1) {cout << cost << endl; return 0;}
    for(auto e: G[room]) {
      int c, t, h, r;
      tie(c, t, h, r) = next(cost, time, heat, room, e);
      if(h == NAUGHT) continue;
      if(d.count(V(t, h, r))) continue;
      q.emplace(c, t, h, r);
    }
  }

  assert(0);
}

Measured memory_bytes: 7720