akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

int main(){
    string s;
    cin>>s;
    int n=s.length();
    int k;
    cin>>k;
    vector<string> st;
    for(int i=0;i<n;i++){
        for(int j=1;j<=min(k,n-i);j++){
            st.push_back(s.substr(i,j));
        }
    }
    sort(st.begin(),st.end());
    st.erase(unique(st.begin(),st.end()),st.end());
    cout<<st[k-1]<<endl;
    return 0;
}

Measured memory_bytes: 4296
#include <iostream>
#include <vector>
//#include <fstream>

using namespace std;

int main(int argc, const char * argv[]) {
//    ifstream in("input.txt");
//    cin.rdbuf(in.rdbuf());
    
    int N;
    cin >> N;
    
    int max = 0;
    vector<int> V, C;
    int v, c;
    for (int i=0; i<N; i++)
    {
        cin >> v;
        V.push_back(v);
    }
    for (int i=0; i<N; i++)
    {
        cin >> c;
        C.push_back(c);
    }
    for (int i=0; i<N; i++)
    {
        if (V[i] > C[i]) max += V[i] - C[i];
    }
    
    cout << max << endl;
    
    
    return 0;
}


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

int main(){
    long long n;
    cin >> n;
    long long min = n-1;
    long long t;
    for(long long i = 1; i <= sqrt(n); i++){
        if((n%i) == 0){
            t = (i-1) + ((n/i)-1);
            if(min > t){
                min = t;
            }
        }
    }
    cout << min << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<algorithm>
#include<functional>
#include<bits/stdc++.h>
using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    long long int n, x;
	double t1, t2; 
	priority_queue<double>pq;
    cin>>n;
    while(n--)
    {
    	cin>>x;
    	pq.push(x*-1);
	}
	while(pq.size()!=1)
	{
		t1=pq.top()*-1;
		pq.pop();
		t2=pq.top()*-1;
		pq.pop();
		t2=(t2+t1)/2;
		pq.push(t2*-1);
	}
	printf("%.5lf\n", pq.top()*-1);
    
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using P = pair<int, int>;

template <class T> inline T chmax(T &a, T &b) {a = max(a, b);}
template <class T> inline T chmin(T &a, T &b) {a = min(a, b);}

constexpr int MOD = 1e9 + 7;
constexpr ll INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

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

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

    ll sum = accumulate(a.begin(), a.end(), 0LL);

    vector<ll> ans(n);
    ans[0] = sum;
    for(int i=1; i<n; i+=2){
        ans[0] -= 2 * a[i];
    }

    for(int i=0; i<n-1; i++){
        ans[i+1] = 2 * a[i] - ans[i];
    }

    for(int i=0; i<n; i++){
        cout << ans[i] << " \n"[i == n-1];
    }
}

Measured memory_bytes: 2944
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := NewIo()
	defer io.Flush()
	for {
		n := io.NextInt()
		if n == 0 {
			break
		}
		a := make([]int, n)
		sum := 0
		for i := 0; i < n; i++ {
			a[i] = io.NextInt()
			sum += a[i]
		}
		cnt := 0
		for i := 0; i < n; i++ {
			if a[i] <= sum/n {
				cnt++
			}
		}
		io.Println(cnt)
	}
}

// I/O template
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buff []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buff = append(buff, line...)
		if !isPrefix {
			break
		}
	}
	return string(buff)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	s := io.tokens[io.nextToken]
	io.nextToken++
	return s
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntSlice(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func (io *Io) PrintStringSlice(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func Log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}

func ExampleIo() {
	io := NewIo()
	defer io.Flush()
	a := make([]int, 0, 3)
	a[0], a[1], a[2] = io.NextInt(), io.NextInt(), io.NextInt()
	io.Println(a)
	io.PrintIntSlice(a)
	Log("io", a)
}



Measured memory_bytes: 2844
#include<stdio.h>
int N, m, q;
int vector[100000][100];
int count[100000];
int group[100000];
int ID = 1;
  
void dfs(int s){
    int i;
    group[s]=ID;
    for(i = 0; i < count[s]; i++ ) {
        if ( group[vector[s][i]] == 0 ) dfs(vector[s][i]);
    }
}
  
int main() {
    int i, j, a, b; 
    scanf("%d%d", &N, &m);
    for ( i = 0; i < m; i++ ) {
        scanf("%d%d", &a, &b);
        vector[a][count[a]++] = b;
        vector[b][count[b]++] = a;
    }
    for ( i = 0; i < N; i++ ) {
        if ( group[i] == 0 ) {
            dfs(i);
            ID++;
        }
    } 
    scanf("%d",&q);
    for ( i = 0; i < q; i++ ) {
        scanf("%d%d", &a, &b);
        if ( group[a] == group[b] ) printf("yes\n");
        else printf("no\n");
    }
  
    return 0;
}


Measured memory_bytes: 44620
import java.io.InputStreamReader
import java.io.BufferedReader

fun main(args: Array<String>) {
  val br = BufferedReader(InputStreamReader(System.`in`))

  val map = mapOf( "A" to "T", "C" to "G", "T" to "A", "G" to "C")
  val ans = map[br.readLine()]
  println(ans)
}

Measured memory_bytes: 29472
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	double r,p = 3.14159265359;
	cin >> r;
	cout << fixed << setprecision(6) << r*r*p << ' ' << setprecision(6) << (r+r)*p << endl;
	return 0;
}

Measured memory_bytes: 1284
#include <iostream>
#include <map>
#include <vector>
#include <queue>

using namespace std;

map < vector <int>, int > memo;
vector <int> puzzle;
vector <int> dist[8];
int a;

bool check(vector <int> vi)
{
	for (int i = 0; i < vi.size(); i++){
		if (vi[i] != i) return false;
	}
	return true;
}

void calc(void)
{
	for (int i = 0; i < 8; i++){
		puzzle.push_back(i);
	}

	queue < pair < vector <int>, int> > q;
	q.push(make_pair(puzzle, 0));

	while (!q.empty()){
		pair <vector <int>, int> now = q.front();
		vector <int> __puzzle = now.first;
		q.pop();
		memo[__puzzle] = now.second;

		// for (int k = 0; k < 8; k++) cout << __puzzle[k] << " ";
		// cout << "  memo! " << now.second << " " << endl;
		// cout << q.size() << endl;
		// cin >> a;

		for (int i = 0; i < 8; i++){
			if (__puzzle[i] == 0){
				for (int j = 0; j < dist[i].size(); j++){
					swap(__puzzle[i], __puzzle[dist[i][j]]);
					if (memo.count(__puzzle) == 0){
						q.push(make_pair(__puzzle, now.second + 1));
					}
					swap(__puzzle[i], __puzzle[dist[i][j]]);
				}
			}
		}
	}

	return;
}

void init(void)
{
	dist[0].push_back(1);
	dist[0].push_back(4);
	
	dist[1].push_back(0);
	dist[1].push_back(2);
	dist[1].push_back(5);
	
	dist[2].push_back(1);
	dist[2].push_back(3);
	dist[2].push_back(6);
	
	dist[3].push_back(2);
	dist[3].push_back(7);

	dist[4].push_back(0);
	dist[4].push_back(5);

	dist[5].push_back(1);
	dist[5].push_back(4);
	dist[5].push_back(6);

	dist[6].push_back(2);
	dist[6].push_back(5);
	dist[6].push_back(7);

	dist[7].push_back(3);
	dist[7].push_back(6);
}

int main(void)
{
	init();
	calc();
	while (1){
		puzzle.clear();
		for (int i = 0; i < 8; i++){
			cin >> a;
			puzzle.push_back(a);
		}
		if (cin.eof()) return 0;

		// cout << memo.count(puzzle) << endl;
		cout << memo[puzzle] << endl;
	}

	return 0;
}

Measured memory_bytes: 3868
a = gets.chomp.split
stack = []
for i in 0..a.size
  if a[i] == '+'
    x1 = stack.pop
    x2 = stack.pop
    stack << x1 + x2
  elsif a[i] == '*'
    x1 = stack.pop
    x2 = stack.pop
    stack << x1*x2
  elsif a[i] == '-'
    x1 = stack.pop
    x2 = stack.pop
    stack << x2 - x1
  else
    stack << a[i].to_i
  end
end
puts stack[0]

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

void solve(long long x) {
  ll tmp = x % 11;
  ll res = 2*(x/11);
  if (tmp <= 6 and tmp) {
    res++;
  }
  if (tmp > 6) {
    res += 2;
  }
  cout << res << endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  long long x;
  scanf("%lld", &x);
  solve(x);
  return 0;
}


Measured memory_bytes: 256
// Problem : E - Red Scarf
// Contest : AtCoder - AtCoder Beginner Contest 171
// URL : https://atcoder.jp/contests/abc171/tasks/abc171_e
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <iostream>
using namespace std;
int n,a[200005];
int main()
{
 int n,sum=0;
 cin>>n;
 for(int i=1;i<=n;i++)
 {
  cin>>a[i];
  sum^=a[i];
 }
 for(int i=1;i<=n;i++)
  cout<<(sum^a[i])<<' ';
 return 0;
}

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

#define mod 1000000007
#define int long long int
#define vi vector<int>
#define pii pair<int,int>
#define vpii vector<pii>
#define vs vector<string>
#define fi first
#define se second
#define psb push_back
#define ppb pop_back
#define fio ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL)
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define all(v) v.begin(),v.end()
#define endl "\n"

const int maxn=2e5+5;
int ar[maxn];

int32_t main()
{
	int n,g;
	cin>>n>>g;
	for(int i=0;i<n;i++)
		cin>>ar[i];
	sort(ar,ar+n);
	int ans=0;
	for(int i=n-1-g;i>=0;i--)
		ans+=ar[i];
	cout<<ans<<endl;
}

Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;

// #define size 200001
// bool isprime[200001];
// vector<int> primes;

bool primechk(LL n){
  for(int i=2; i*i<=n; i++){
    if(n%i==0){
      return false;
    }
  }
  return true;
}
int main(){
  LL n;
  cin>>n;
  // memset(isprime, true, sizeof(isprime));
  // for(int i=0; i<size; i++) isprime[i]=true;
  // for(int i=2; i*i<size; i++){
  //   if(isprime[i]){
  //     primes.push_back(i);
  //     for(int j=2*i; j<size; j+=i){
  //       isprime[j]=false;
  //     }
  //   }
  // }
  // int val = primes[lower_bound(primes.begin(), primes.end(), n) - primes.begin()];
  // cout<<val;
  if(n==2){
    cout<<2<<"\n";
    return 0;
  }
  if(n%2==0){
    n++;
  }
  while(!primechk(n)){
    n+=2;
  }
  cout<<n<<"\n";
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int n,t=0;

int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		if(x!=i+1) t++;
	}
	cout<<(t<=2?"YES":"NO")<<endl;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = input()

    for i in n:
        if i == "7":
            print("Yes")
            exit()
    print("No")


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 9036
#include<iostream>
using namespace std;
int main(){
    int h,w;
    cin >> h >> w;
    while(h!=0){
        int i,j;
        for(i=0;i<h;i++){
            if(0<i&&i<h-1){
                for(j=0;j<w;j++){
                    if(0<j&&j<w-1){
                        cout << ".";
                    }else{
                        cout << "#";
                    }
                    
                }
            }else{
                for(j=0;j<w;j++){
                    cout << "#";
                }
            }
            
            cout << endl;
        }
        cout << endl;
        cin >> h >> w;
    }
    return 0;
}


Measured memory_bytes: 3092
from collections import defaultdict
from itertools import combinations
N = int(input())
cnt = defaultdict(int)

for _ in range(N):
    S = input()
    if S[0] in ["M","A","R","C","H"]:
        cnt[S[0]] += 1

if len(cnt) < 3:
    print(0)
    exit()

ans = 0
comb = list(combinations(["M","A","R","C","H"], 3))
for i in range(len(comb)):
    tmp = 1
    for c in comb[i]:
        tmp *= cnt[c]
    ans += tmp

print(ans)

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int inf = 0x3f3f3f3f;
#define Rep(i,a,b) for(register int i=(a);i<=int(b);++i)
#define Dep(i,a,b) for(register int i=(a);i>=int(b);--i)
#define rep(i,a,b) for(register int i=(a);i<int(b);++i)
#define mem(x,v) memset(x,v,sizeof(x))
#define pc putchar
#define gc getchar
inline ll read(){
	register ll x=0,f=1;register char c=gc();
	for(;!isdigit(c);c=gc())if(c=='-')f=-1;
	for(;isdigit(c);c=gc())x=(x<<1)+(x<<3)+(c^48);
	return x*f;
}
void write(ll x){if(x<0)x=-x,pc('-');if(x>=10)write(x/10);putchar(x%10+'0');}
void wri(ll x){write(x),pc(' ');}
void writeln(ll x){write(x);pc('\n');}
const int maxn = 3005;
const int mod = 1e9 + 7;
int f[maxn][maxn][2],n,m;
void add(int &x,int v){
	x+=v;
	if(x>=mod) x-=mod;
}
int main(){
	n = read(),m = read();
	f[0][0][1] = 1;
	Rep(i,1,n) f[0][i][0] = 1;
	Rep(i,0,m-1){
		Rep(j,0,n){
			Rep(k,0,1){
				if(j) add(f[i+1][j-1][k|(j-1==0)],f[i][j][k]);
				if (j) add(f[i+1][j][k|(j==1)],f[i][j][k]);
				if (n-j) add(f[i+1][j][k],f[i][j][k]);
				if (n-j) add(f[i+1][j+1][k],f[i][j][k]);
			}
		}
	}int ans = 0;
	Rep(i,0,n) add(ans,f[m][i][1]);
	writeln(ans);
}

Measured memory_bytes: 70656
s = input()

if s == 'SUN':
    print(7)
elif s == 'SAT':
    print(1)
elif s == 'FRI':
    print(2)
elif s == 'THU':
    print(3)
elif s == 'WED':
    print(4)
elif s == 'TUE':
    print(5)
else:
    print(6)


Measured memory_bytes: 2940
fun main(args: Array<String>) {
    solve(java.util.Scanner(System.`in`))
}

fun check(str: String, s: Int, e: Int): Boolean {
    var ss = s
    var ee = e - 1
    while (ss < ee) {
        if (str[ss] != str[ee]) {
            return false
        }
        ss++
        ee--
    }
    return true
}

fun solve(sc: java.util.Scanner) {
    val S = sc.next()
    val N = S.length

    if (check(S, 0, N) &&
        check(S, 0, (N - 1) / 2) &&
        check(S, (N + 3) / 2 - 1, N)
    ) {
        println("Yes")
    } else println("No")
}


Measured memory_bytes: 31652
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <deque>
using namespace std;


int main() {
	long long N;
	long long ai;
	set<long long> in;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> ai;
		if (in.count(ai) == 0)
			in.insert(ai);
		else
			in.erase(ai);
	}
	cout << in.size() << endl;

	return 0;
}

Measured memory_bytes: 4864
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N, K = MAP()
A = LIST()

cnt = 0
for i in range(1, N):
    # 減らす必要のある数
    tmp = (A[i-1]+A[i]) - K
    if tmp > 0:
        cnt += tmp
        # 右から引けるだけ引く
        A[i] -= min(A[i], tmp)
print(cnt)


Measured memory_bytes: 14844
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            new Main().solve(sc);
        }
    }

    void solve(Scanner sc) {
        int n = sc.nextInt();
        int[] as = new int[3 * n];
        for (int i = 0; i < 3 * n; i++) {
            as[i] = sc.nextInt();
        }

        Arrays.sort(as);
        long ans = 0l;
        for (int i = 0; i < n; i++) {
            ans += as[3 * n - 2 - (i * 2)];
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 91344
#include<iostream>
using namespace std;

int main(){
    int x;
    cin >> x;

    int max = 1;
    for(int i = 2; i < x; i++){
        if(i * i > x){
            break;
        }
        int tmp = i;
        while(true){
            tmp *= i;
            if(tmp > x){
                tmp /= i;
                break;
            }
        }
        if(tmp > max){
            max = tmp;
        }
    }

    cout << max << endl;

    return 0;
}

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

using namespace std;
int main(){
	double n,k;
	double x,y;
	cin>>n>>k>>x>>y;
	printf("%.9lf ",n*k/2);
	if(x*2==n&&y*2==k)cout<<"1";
	else cout<<"0"; 
	return 0;
}

Measured memory_bytes: 256
N, D = map(int, input().split())
X = []
for i in range(N):
  X.append(list(map(int, input().split())))
#print(X)

ans = 0
for i in range(N):
  for j in range(i+1, N):
    dist_sq = 0
    for x, y in zip(X[i], X[j]):
      dist_sq += (x - y) ** 2

    dist = dist_sq ** 0.5
    #print(i, j, dist)

    if dist - int(dist) == 0:
      ans += 1

print(ans)

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
int main(){
    string a,b,c,d,e,f;
    cin>>a;
  	int n=a.length();
    b=a;
  	c=a;
  	e=a;
    reverse(b.begin(),b.end());
    c=c.substr(0,(n-1)/2);
    d=c;
    reverse(d.begin(),d.end());
    e=e.substr((n+3)/2-1,(n-1)/2);
    f=e;
    reverse(f.begin(),f.end());
    if(a!=b){
        cout<<"No"<<endl;
    }
    else if(c!=d){
        cout<<"No"<<endl;
    }
    else if(f!=e){
        cout<<"No"<<endl;
    }
    else cout<<"Yes"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repr(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<(int)(n);i++)
#define INF 99999999999999

    /*Solve*/

int main(){
    ld t,x;
    cin >> t >> x;
    ld ans;
    ans = t/x;
    cout << ans;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const long long mod = 1e9+7;
long long power(long long a, long long b, long long m = mod) {
    if(b < 0) {
        return power(power(a, -b), mod-2);
    }
    long long x = 1;
    while(b) {
        if(b & 1) {
            x = 1ll * x * a % m;
        }
        a = 1ll * a * a % m;
        b /= 2;
    }
    return x;
}
const int N = 3e5+9;
signed main() {  
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    
    ll a, b, n; cin >> a >> b >> n;
    n = min(n, b);
    cout << max(a*n/b - a*(n/b), a*(n-1)/b - a*((n-1)/b)) << endl;
    




    return 0;
    
}


Measured memory_bytes: 3652
use std::io;

fn gets() -> String {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).ok();
    buf
}

fn main() {
    let line = gets();
    let mut it = line
        .trim()
        .split_whitespace()
        .map(|x| x.parse::<i32>().unwrap());
    let a = it.next().unwrap();
    let b = it.next().unwrap();
    let c = it.next().unwrap();
    if b - a == c - b {
        println!("YES");
    } else {
        println!("NO");
    }
}


Measured memory_bytes: 4352
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.LinkedHashSet;
import java.util.Set;

public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

        int n = Integer.parseInt(br.readLine());
        String s;
        Set<String> set = new LinkedHashSet<>();
        for (int i = 0; i < n; i++) {
            s = br.readLine();
            set.add(s);
        }

        br.close();

        bw.write(String.valueOf(set.size()));

        bw.flush();

    }
}

Measured memory_bytes: 66928
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#define int long long
#define mod 1000000007
#define for0(i, n) for(int i = 0; i < (n); i++)
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
signed main() {
	int a, b, c; cin >> a >> b >> c;
	cout << (a + b + c >= 22 ? "bust\n" : "win\n");
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int a,b,c,f;
    scanf("%d %d",&a,&b);
    c=a+b;
    f=b-a;
    if(b%a==0)
    {
        printf("%d",c);
    }
    else
    {
        printf("%d",f);
    }
    return 0;









}


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

int main(){
    int n,x,ans=0;
    cin>> n >> x;
    vector<int> a(n),b(n+1,0);
    for(int i=0; i<n; i++){
        cin >> a[i];
        b[i+1]=b[i]+a[i];
    }
    for(int i=0; i<=n; i++){
        if(b[i]<=x){
            ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 1000000007;

vector<pair<ll, ll>> factorize(ll n) {
  vector<pair<ll, ll>> res;
  for( ll i = 2; i * i <= n; ++i){
    if(n % i) continue;
    res.emplace_back(i, 0);
    while(n%i == 0) {
      n /= i;
      res.back().second++;
    }
  }
  if(n != 1) res.emplace_back(n, 1);
  return res;
}

ll getKaisu(ll x) {
  ll res = 0;
  ll cur = 1;
  while (x >= cur) {
    x -= cur;
    cur++;
    res++;
  }
  return res;
}


int main() {
  ll n; 
  cin >> n;
  auto primes = factorize(n);
  ll ans = 0;
  for (auto p : primes) {
    // cout << p.first << " " << p.second << endl;
    // cout << getKaisu(p.second) << endl;;
    ans += getKaisu(p.second);
  }
  cout << ans << endl;
}

Measured memory_bytes: 3628
using System;

class ITP1
{
    static void Main()
    {
        string str = Console.ReadLine().ToLower();
        int cnt = 0;
        while (true)
        {
            string[] str2 = Console.ReadLine().Split(' ');
            if (str2[0] == "END_OF_TEXT") { break; }
            for (int i = 0; i < str2.Length; i++)
            {
                str2[i]=str2[i].ToLower();
                if (str2[i] == str){
                            cnt++;
                        }
            }
        }
        Console.WriteLine(cnt);
    }
}

Measured memory_bytes: 5584
#include<bits/stdc++.h>
using namespace std;
int main(){
    
    string w;
    cin >> w;
    int cnt[30]={};
    for(int i=0; i<w.length();i++){
        cnt[w[i]-97]++;
    }
    for(int i=0; i<26;i++){
        if(cnt[i]%2!=0){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>       // printf,scanf
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>  //sort,binarySearch
#include <functional> 
#include <iomanip>    // setprecision
#include <utility>    // c+11 Array
#include <set>
#include <sstream>
#include <map>
#include <bits/stdc++.h>
#define MOD 1000000007
#define PI 3.141592653589793238462643383279
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define DFOR(i,a,b) for(int i=(a);i>=(b);--i)
#define DREP(i,n)  DFOR(i,n,0)
#define pb(x) push_back(x)
#define debug(x) cout << #x << " = " << x << endl;
#define debret(x) debug(x) ; return 0;

using namespace std;
vector<string> split(string& input, char delimiter)
{
  istringstream stream(input);

  string field;
  vector<string> result;
  while (getline(stream, field, delimiter)) {
      if(field != "")
          result.push_back(field);
  }
  return result;
}

int main(){

    string str;

    cin >> str;
    string rev = "";
    DREP(i,str.size()-1){
        rev += str[i];
    }
    
    int cnt = 0;
    while(cnt < str.size()-1){
        string d =  (str.size() >= cnt+5) ? rev.substr(cnt,5): "";
        string er = (str.size() >= cnt+6) ? rev.substr(cnt,6): "";
        string de = (str.size() >= cnt+7) ? rev.substr(cnt,7): "";
        if(d == "maerd" || d == "esare"){
            cnt += 5;
        }else if(er == "resare"){
            cnt += 6;
        }else if(de == "remaerd"){
            cnt += 7;
        }else{
            cout << "NO" << endl;
            return 0;
        }
        //debug(cnt)
    }
    cout << "YES" << endl;
    return 0;
}


Measured memory_bytes: 512
#include <stdio.h>


int area[10][10];

void search(int x, int y)
{
	int i;
	area[y][x] = 0;
	for (i = 1; i <= 3; i++){
		if (x + i < 8 && area[y][x + i]) search(x + i, y);
		if (x - i >= 0 && area[y][x - i]) search(x - i, y);
		if (y + i < 8 && area[y + i][x]) search(x, y + i);
		if (y - i >= 0 && area[y - i][x]) search(x, y - i);
	}
}


int main(void)
{
	int i, j, n, k;
	int grox, groy;
	
	scanf("%d", &n);
	for (k = 0; k < n; k++){
		for (i = 0; i < 8; i++){
			char S[16];
			scanf("%s", S);
			for (j = 0; j < 8; j++){
				area[i][j] = S[j] - '0';
			}
		}
		scanf("%d %d", &grox, &groy);
		search(grox - 1, groy - 1);
		printf("Data %d:\n", k + 1);
		for (i = 0; i < 8; i++){
			for (j = 0; j < 8; j++)printf("%d", area[i][j]);
			puts("");
		}
	}
	return 0;
}

Measured memory_bytes: 608
#coding:utf-8
import sys
import bisect
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]


    n = II()

    a = set()
    for i in range(1, 10):
        for j in range(1, 10):
            a.add(i*j)

    if n in a:
        print("Yes")
    else:
        print("No")



if __name__ == '__main__':
    main()


Measured memory_bytes: 3188
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
int n, k, t;
int head[2010], to[4010], nxt[4010], cnt;
inline void addedge (int u, int v) { cnt++, to[cnt] = v, nxt[cnt] = head[u], head[u] = cnt; }
inline void dfs (int u, int p, int d, int md) {
	t++;
	if (d == md) return;
	for (int e = head[u]; e; e = nxt[e]) {
		int v = to[e];
		if (v == p) continue;
		dfs (v, u, d + 1, md);
	}
}
int main () {
	scanf ("%d%d", &n, &k);
	for (int i = 1; i < n; i++) {
		int u, v;
		scanf ("%d%d", &u, &v);
		addedge (u, v);
		addedge (v, u);
	}
	if (k & 1) {
		int ans = n;
		for (int u = 1; u <= n; u++) {
			for (int e = head[u]; e; e = nxt[e]) {
				int v = to[e];
				t = 0;
				dfs (u, v, 0, k >> 1);
				dfs (v, u, 0, k >> 1);
				ans = min (ans, n - t);
			}
		}
		printf ("%d\n", ans);
	} else {
		int ans = n;
		for (int i = 1; i <= n; i++) {
			t = 0;
			dfs (i, 0, 0, k >> 1);
			ans = min (ans, n - t);
		}
		printf ("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;

int main() {
    int count[5][4][11] = {};
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int b, f, r, v;
        cin >> b >> f >> r >> v;
        count[b][f][r] += v;
    }

    for (int i = 1; i <= 4; i++) {
        for (int j = 1; j <= 3; j++) {
            for (int k = 1; k <= 10; k++) {
                cout << " " << count[i][j][k];
            }
            cout << endl;
        }
        if (i < 4) {
            cout << "####################" << endl;
        }
    }
    return 0;
}



Measured memory_bytes: 3076
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aajisaka
 */

#include<bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;

constexpr long double PI = 3.14159265358979323846264338327950288L;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

class CTaxIncrease {
public:
    void solve(istream& cin, ostream& cout) {
      SPEED;
      int a, b; cin >> a >> b;
      int t = 1;
      while(true) {
        if (t*8/100 == a && t*10/100 == b) {
          cout << t << endl;
          return;
        }
        if (t*8/100 > 100) {
          cout << -1 << endl;
          return;
        }
        t++;
      }
    }
};

signed main() {
  CTaxIncrease solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define PI 3.141592
#define all(a) (a).begin(), (a).end()
bool is_palindrome(string s){
    string t(s.rbegin(),s.rend());
    return s == t;
}


int main(){
    string S;
    cin >> S;
    int N = S.size();
    string s = S.substr(0, (N-1)/2);
    string t = S.substr((N+1)/2);
    if( is_palindrome(S) and is_palindrome(s) and is_palindrome(t)) puts("Yes");
    else puts("No");
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#include <numeric>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG true
#define LL long long
#define Dev 1000000007
// sort(a.begin(), a.end(), std::greater<int>());
using namespace std;

vector<LL> dp[3];
string s;

long long int eval(int i, int j)
{
    if (dp[j][i] != -1)
        return dp[j][i];
    if (i >= s.size() && j == 3)
        dp[j][i] = 1;
    else if (i >= s.size() && j < 3)
        dp[j][i] = 0;
    else if (i < s.size() && j == 3)
        dp[j][i] = ((s[i] == '?') ? 3 : 1) * eval(i + 1, j);
    else
        dp[j][i] = ((s[i] == '?') ? 3 : 1) * eval(i + 1, j) +
                   (((s[i] == (char)('A' + j) || s[i] == '?') ? 1 : 0)) * eval(i + 1, j + 1);
    dp[j][i] %= Dev;
    return dp[j][i] % Dev;
}

int main()
{
    cin >> s;
    rep(i, 4)
    {
        vector<LL> hoge(s.size() + 1, -1);
        dp[i] = hoge;
    }
    cout << eval(0, 0) << endl;
    return 0;
}

Measured memory_bytes: 12144
#pragma GCC optimize("O3")

#define _GLIBCXX_DEBUG
#include <iostream>
#include <vector>
#include <string>
#include <string_view>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
using namespace std;

/*----------macros----------*/

//output================
#define endl '\n'
#define fcout(a) cout << fixed << setprecision((int)(a))

//typedef===============
typedef long long       ll;
typedef long double     ld;
typedef vector<int>     Vi;
typedef vector<ll>      Vl;
typedef pair<int, int>  Pii;
typedef pair<ll, ll>    Pll;

//const number==========
constexpr ll INF9   = (ll)1e9 + 1;
constexpr ll INF18  = (ll)1e18 + 1;
constexpr ll MOD1    = 1000000007;
constexpr ll MOD2   = 998244353;
constexpr ld PI     = 3.141592653589793L;

//member================
#define psb push_back
#define epb emplace_back
#define psf push_front
#define mkp make_pair
#define fst first
#define scd second

//others================
#define all(x)          (x).begin(), (x).end()
#define rall(x)         (x).rbegin(), (x).rend()
#define rep(i, n)       for(int i = 0; (i) < (n); ++(i))
#define reps(i, n)      for(int i = 1; (i) <= (n); ++(i))
#define rrep(i, n)      for(int i = n - 1; (i) >= 0 ; --(i))
#define repbit(bit, n)  for(int bit = 0; (bit) < (1 << (n)); ++(bit))
#define ifbit(bit, i)   if((bit) & (1 << (i)))
#define CtoI(c)         int((c)) - int('0')
#define ItoC(c)         char((c) + '0')

//functions=============
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

//vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
//vector<int> dx2 = { 1,1,0,-1,-1,-1,0,1 }, dy2 = { 0,1,1,1,0,-1,-1,-1 };

/*--------additional--------*/



/*----------main------------*/

int main() {
/*----------fastio----------*/
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);
/*----------solve-----------*/

    int r; cin >> r;
    cout << 3 * r * r << endl;

return 0;
}

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

#define MP make_pair
#define F first
#define S second

using namespace std;

const int N = 1e6;
long long int a[N];

long long int wop(long long int x, long long int y) {
    long long int ret=1;
    for(;y>0;y/=2) {
        if(y&1)ret*=x;
        x*=x;
    }
    return ret;
}

int main () {
    long long int n, k, ans=0;
    cin >> n >> k;
    for(int i = 0 ; i < n ; i++ ) {
        cin >> a[i];
    }
    sort(a,a+n);
    if(n-k-1<0)return cout << 0,0;
    for(int i = n-k-1 ; i>=0 ; i--) {
        ans+=a[i];
    }
    cout << ans;
}


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

#define INF 0x3FFFFFFF

using namespace std;

int mat[201][201];

int main() {
  int n, m, r;
  scanf("%d %d %d", &n, &m, &r);
  vector<int> towns(r);
  for (int i = 0; i < r; i++) scanf("%d", &towns[i]);
  sort(towns.begin(), towns.end());
  
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      mat[i][j] = i == j ? 0 : INF;
    }
  }
  for (int i = 0; i < m; i++) {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    mat[a][b] = c;
    mat[b][a] = c;
  }
  for (int k = 1; k <= n; k++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if (mat[i][k] + mat[k][j] < mat[i][j]) {
          mat[i][j] = mat[i][k] + mat[k][j];
        }
      }
    }
  }
  int best = INF;
  do {
    int test = 0;
    for (int i = 1; i < r; i++) {
      test += mat[towns[i - 1]][towns[i]];
    }
    best = min(best, test);
  } while (next_permutation(towns.begin(), towns.end()));
  printf("%d\n", best);
  return 0;
}


Measured memory_bytes: 384
n = int(input())
a = list(map(int, input().split()))

ans = 1
flg = -1
for i in range(1, n):
    if a[i-1] == a[i]:
        continue
    
    elif a[i-1] < a[i]:
        if flg == 1 or flg == -1:
            flg = 1
            continue
        else:
            ans += 1
            flg = -1

    else:
        if flg == 0 or flg == -1:
            flg = 0
            continue
        else:
            ans += 1
            flg = -1

print(ans)


Measured memory_bytes: 19996
// This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
template<typename T> bool get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'&&t!=EOF; t=getchar());
	if(t=='-')neg=true,t=getchar();if(t==EOF)return false;
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;return true;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) (get1(a)&&get1(b))
#define get3(a,b,c) (get1(a)&&get2(b,c))
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

const int mod=1e9+7;
struct matrix
{
	int a[2][2];
	void clear(int x=0){a[0][1]=a[1][0]=0;a[0][0]=a[1][1]=x;}
	matrix(int x=0){clear(x);}
	void out(){printf("%d %d\n%d %d\n",a[0][0],a[0][1],a[1][0],a[1][1]);}
};
matrix operator *(const matrix&a,const matrix&b)
{
	matrix ret(0);
	for(int i=0;i<2;i++)for(int j=0;j<2;j++)for(int k=0;k<2;k++)
		ret.a[i][j]=(ret.a[i][j]+1ll*a.a[i][k]*b.a[k][j])%mod;
	return ret;
}
int power(int x,LL y){int ret=1;do{if(y&1)ret=1ll*ret*x%mod;x=1ll*x*x%mod;}while(y>>=1);return ret;}
matrix power(matrix x,LL y){matrix ret(1);do{if(y&1)ret=ret*x;x=x*x;}while(y>>=1);return ret;}
int n,m;
LL k;
char s[1111][1111];
int main()
{
	get3(n,m,k);
	if(k==0)
	{
		puts("1");
		return 0;
	}
	for(int i=1;i<=n;i++)
		scanf("%s",s[i]+1);
	int cn=0,cm=0,all=0;
	for(int i=1;i<=n;i++)for(int j=1;j<=m;j++)all+=(s[i][j]=='#');
	for(int i=1;i<=n;i++)cn+=(s[i][1]=='#'&&s[i][m]=='#');
	for(int j=1;j<=m;j++)cm+=(s[1][j]=='#'&&s[n][j]=='#');
	if(cn&&cm)puts("1");
	else if(!cn&&!cm)
		printf("%d\n",power(all,k-1));
	else
	{
		matrix tran;tran.a[0][0]=all;
		int c2=0;
		if(cn)
		{
			tran.a[1][1]=cn;
			for(int i=1;i<=n;i++)for(int j=1;j<m;j++)
				c2+=(s[i][j]=='#'&&s[i][j+1]=='#');
		}
		else
		{
			for(int i=1;i<n;i++)for(int j=1;j<=m;j++)
				c2+=(s[i][j]=='#'&&s[i+1][j]=='#');
			tran.a[1][1]=cm;
		}
		tran.a[0][1]=mod-c2;
		tran=power(tran,k-1);
		printf("%d\n",(tran.a[0][0]+tran.a[0][1])%mod);
	}
	return 0;
}

Measured memory_bytes: 1280
#include <stdio.h>
int main(void){
	int N;
	scanf("%d",&N);
	
	int A[100];
	int i;
	int t=0;
	
	for(i = 0;i < N;i++){
		scanf("%d",&A[i]);
	}
	
	for(i = 0;i < N; i++){
		if(A[i]%2 == 0 ){
			if(A[i]%3 != 0 && A[i]%5 != 0) {
				printf("DENIED\n");
				return 0;
			}
		}
	}
	
	printf("APPROVED\n");
	return 0;
}

Measured memory_bytes: 128
def main():
    s = input()
    l = ['A', 'G', 'T', 'C']
    ans = 0
    for j in range(len(s)):
        cnt = 0
        for i in range(j, len(s)):
            if s[i] in l:
                cnt += 1
            else:
              break
        ans = max(ans, cnt)
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> ii;
typedef pair<int, int> pii;
const int M = 1e5+7;
const ll MAX = 1e15;
const ll MOD = 1e9+7;


void solve() {
   int a;cin>>a;
   cout<<(a^1);
}

int main() {
    ios::sync_with_stdio(0);
   // freopen("input.txt","r",stdin);
    if(0) {
        int t;
        cin>>t;
        for(int i=1; i<=t; i++) {
            solve();
            cout<<"\n";
        }
    } else solve();
    return 0;
}


Measured memory_bytes: 3636
if __name__ == "__main__":
    N,A,B = map(int, input().split())
    T = []
    for x in range(N):
        x = int(input())
        T.append(x)
    res = 0
    for x in T:
        if (A <= x and x < B):
            continue
        res += 1
    print (res)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define ll long long int 
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mx *max_element
#define mn *min_element
#define fo(i,n) for(ll i=0;i<n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define rfo(i,n) for(ll i=n-1;i>=0;i--)
#define rloop(i,a,b) for(ll i=a;i>=b;i--)
#define all(x) x.begin(),x.end()
#define sortall(x) sort(all(x))
#define precision cout<<fixed<<setprecision(10)
#define mem(x,p) memset(x,p,sizeof(x))
#define w(t) ll t;cin>>t;while(t--)
#define kk "\n"
#define setbits(x) __builtin_popcountll(x)
const double pi=3.1415926535897932384626;
//const ll mod = 998244353;
const ll mod=1e9+7;
int main()
{
  IOS
  ll n,d;
  cin>>n>>d;
  ll c=0;
  fo(i,n){
      ll x,y;
      cin>>x>>y;
      if((x*x)+(y*y)<=d*d) c++;
  }
  cout<<c;
  return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
#define int long long
#define ull unsigned long long
#define ld long double
#define rep(a) rep1(i,a)
#define rep1(i,a) rep2(i,0,a)
#define rep2(i,b,a) for(int i=(b); i<((int)(a)); i++)
#define rep3(i,b,a) for(int i=(b); i>=((int)(a)); i--)
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define sz(a) ((int)a.size())
#define pow2(x) (1ll<<(x))
#define ceiling(a,b) (((a)+(b)-1)/(b))
#define print0(a) cout << (a) << ' '
#define print1(a) cout << (a) << '\n'
#define print2(a,b) cout << (a) << ' ',print1(b)
#define print3(a,b,c) cout << (a) << ' ',print2(b,c)
#define print4(a,b,c,d) cout << (a) << ' ',print3(b,c,d)
#ifdef i_am_noob
#define debug(a) print2(#a,a)
#else
#define debug(a) 
#endif
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
 
using namespace std;
using namespace __gnu_pbds;
 
const int Mod=1000000007,Mod2=998244353;
const int MOD=Mod2;
 
inline int add(int a, int b){return (a+b>=MOD?a+b-MOD:a+b);}
inline int sub(int a, int b){return (a+MOD-b>=MOD?a-b:a+MOD-b);}
int Pow(int a, int b){
	if(!b) return 1;
	int tmp=Pow(a*a%MOD,b>>1);
	return (b&1?tmp*a%MOD:tmp);
}
inline int inverse(int n){return Pow(n,MOD-2);}
 
const int maxn=100005;
//i_am_noob
int a,b;

signed main(){
	ios_base::sync_with_stdio(0),cin.tie(0);
	cin >> a >> b;
	if(a>=13) print1(b);
	else if(a>=6) print1(b/2);
	else print1(0);
	return 0;
}


Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
    b[i]=[a[i],i+1]
b=sorted(b, key=lambda x: x[0])
for i in range(n):
    if i!=n-1:
        print(b[i][1],end=" ")
    else:
        print(b[i][1])

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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< pii >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define in(x, a, b) ((a) <= (x) && (x) < (b))
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// cmd

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

    Int(n);
    vector<int> data(n);
    for (int i = 0; i < n; i++) {
        cin >> data[i];
    }
    
    map<int, int> funami, toshino;
    rep(i, n) {
        if (i % 2) {
            funami[data[i]]++;
        } else {
            toshino[data[i]]++;
        }
    }

    vp yui, kyoko;
    yui.pb({0, 0});
    kyoko.pb({0, 0});
    for (auto i : funami) {
        yui.pb({i.sec, i.fir});
    }
    for (auto i : toshino) {
        kyoko.pb({i.sec, i.fir});
    }

    sort(all(yui));
    reverse(all(yui));
    sort(all(kyoko));
    reverse(all(kyoko));

    /*
    cout << "yui : " << endl;
    rep(i, yui.size()) {
        cout << yui[i].fir << " " << yui[i].sec << endl;
    }

    cout << "kyoko : " << endl;
    rep(i, kyoko.size()) {
        cout << kyoko[i].fir << " " << kyoko[i].sec << endl;
    }
    */

    if (yui[0].sec == kyoko[0].sec) {
        cout << min(n - yui[0].fir - kyoko[1].fir, n - yui[1].fir - kyoko[0].fir) << endl;
    } else {
        cout << n - yui[0].fir - kyoko[0].fir << endl;
    }

    return 0;
}


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

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << "Line " << __LINE__ << ": " <<  #x << " = " << (x) << "\n";
#define spa << " " <<
#define fi first
#define se second
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()

using ld = long double;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;

template<typename T> using V = vector<T>;
template<typename T> using P = pair<T, T>;
template<typename T> vector<T> make_vec(size_t n, T a) { return vector<T>(n, a); }
template<typename... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec(ts...))>(n, make_vec(ts...)); }
template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){os << "(" << v.first << ", " << v.second << ")"; return os;}
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<class T> ostream& operator<<(ostream& os, const vector<vector<T>> &v){ for(auto &e : v){os << e << "\n";} return os;}
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;

template <class T> void UNIQUE(vector<T> &x) {sort(ALL(x));x.erase(unique(ALL(x)), x.end());}
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
void fail() { cout << -1 << '\n'; exit(0); }
inline int popcount(const int x) { return __builtin_popcount(x); }
inline int popcount(const ll x) { return __builtin_popcountll(x); }
template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<"\n";}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<"\n";};

const ll INF = (1ll<<62);
// const ld EPS   = 1e-10;
// const ld PI    = acos(-1.0);
const ll mod = (int)1e9 + 7;
//const ll mod = 998244353;

int main(){

    string S;
    cin >> S;
    ll N = S.size();

    auto sa  = suffix_array(S);
    auto lcp = lcp_array(S, sa);

    // dump(sa)
    // dump(lcp)

    ll res = (N+1)*N/2;
    REP(i, N-1) res -= lcp[i];

    cout << res << endl;


    return 0;
}

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

using namespace std;

int main(){

    int n;
    cin >> n;

    vector<int> a;

    for(int i = 0; i < n; i++){
	int a0;
	cin >> a0;
	a.push_back(a0);
    }

    int sum = 0;
    bool flag = true;
    for(;;){
	for(int i = 0; i < n; i++){
	    if(a[i] % 2 != 0){
		cout << sum << endl;
		return 0;
	    }else{
		a[i] /= 2;
	    }
	}
	sum++;
    }
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int i,j;
    char a[3][3];
    for(i=0;i<3;i++)
    {
        for(j=0;j<3;j++)
            scanf("%c",&a[i][j]);
        getchar();
    }
    printf("%c%c%c",a[0][0],a[1][1],a[2][2]);
    return 0;
}


Measured memory_bytes: 128