akhauriyash/Code-Regression huggingface dataset:
n, a, b, c, d = map(int, input().split())
s = input().strip() + '#####'

a -= 1
b -= 1
c -= 1
d -= 1
is_arrive = True
for i in range(len(s)-1):
  if s[i]+s[i+1] == '##':
    if a < i < c-1:
      is_arrive = False
      break
    elif b < i < d-1:
      is_arrive = False
      break

if is_arrive:
  if (a < b and c < d) or (a > b and c > d):
    print('Yes')
  else:
    if c < d:
      while b < d:
        if s[b + 1] == '#':
          if b + 2 == a:
            if s[a + 1] == '#':
              a += 2
              b += 2
            else:
              a += 1
              b += 2
          else:
            b += 2
        elif s[b + 2] == '#':
          if b + 1 == a:
            a += 2
            b += 1
          else:
            b += 1
        elif b + 1 == a:
          if s[a + 1] == '#':
            a += 2
            b += 1
          else:
            b += 2
        else:
          b += 1
      if a > c:
        print('No')
      else:
        print('Yes')
    elif d < c:
      while a < c:
        if s[a + 1] == '#':
          if a + 2 == b:
            if s[b + 1] == '#':
              b += 2
              a += 2
            else:
              b += 1
              a += 2
          else:
            a += 2
        elif s[a + 2] == '#':
          if a + 1 == b:
            b += 2
            a += 1
          else:
            a += 1
        elif a + 1 == b:
          if s[b + 1] == '#':
            b += 2
            a += 1
          else:
            a += 2
        else:
          a += 1
      if b > d:
        print('No')
      else:
        print('Yes')
else:
  print('No')


Measured memory_bytes: 3700
#include<stdio.h>
int main()
{int a,b;
scanf("%d",&a);
scanf("%d",&b);
if(a==1)
	{if(b==2)
		{printf("3");}
	else
		{printf("2");}
    }
else if(a==2)
	{{if(b==1)
		{printf("3");}
	else
		{printf("1");}
    }
}
else if(a==3)
{if(b==2)
		{printf("1");}
	else
		{printf("2");}
    }
 return 0;
}

Measured memory_bytes: 128
import java.util.*;
import java.math.*;
import java.io.*;

public class Main{
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int s = in.nextInt();
		int w = in.nextInt();
		if(s>w){
			System.out.println("safe");
		}else{
			System.out.println("unsafe");		
		}
	}
}

Measured memory_bytes: 35812
#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<sstream>
#include<iomanip>
#include<limits>
#include<deque>
#include<map>
#include<list>
#include<set>
#include <unordered_set>
#include<vector>
#include<cmath>
#include<cstdio>
#include<memory>
#include<bitset>
#include<stack>
#include <functional>
#include <queue>
#include <regex>
#include<time.h>

using namespace std;

constexpr int MOD = 1000000007;
constexpr int INF = 1050000000;

#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl

#define Tof(x) (x) ? Yes : No
#define TOF(x) (x) ? YES : NO
#define tof(x) (x) ? yes : no

using ll = long long;


/*vectorの要素を全部確認するやつだよ。


for (vector<int>::iterator itr = ans.begin(); itr != ans.end(); ++itr) {
	cout << *itr << " ";
}


*/


/*for文でx,yを上下左右確認するやつだよ。

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


for (int i = 0; i < 4; i++) {
	int ny = y + dy[i];
	int nx = x + dx[i];
}
*/

/*繰り返し二乗法だよ。modもとってくれるよ。n^kをmodで割った余りでやってくれるよ。

ll POW_MOD(ll n, ll k, ll mod) {
	ll r = 1;

	for (; k > 0; k >>= 1) {
		if (k & 1) {
			r = (r * n) % mod;
		}
		n = (n * n) % mod;
	}
	return r;
}

*/

/*2重for文書くのめんどくなった時用だよ。

for (int i = 0; i < h; i++) {
	for (int j = 0; j < w; j++) {

	}
}

*/

/*実行開始からの経過時間を表すよ。これで1900msまで動作を繰り返すよ。
while (clock() < 1900000) { ; }
*/

/*まだ使えないテクニックのメモだよ。
for (int bit = 0; bit < (1<<n); ++bit)//bit全探索用のfor文だよ
*/


int main() {

	int n; cin >> n;
	int ans = 180;

	while (n > 3) {
		ans += 180;
		n--;
	}



	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
# from math import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

h,w=map(int,input().split())
a=[input() for i in range(h)]

itta=[[0]*w for i in range(h)]
itta[0][0]=1
d=deque([[0,0]])
while d:
    nh,nw=d.popleft()
    itta[nh][nw]%=mod
    if nh+1<h and a[nh+1][nw]==".":
        if itta[nh+1][nw]==0:
            d.append([nh+1,nw])
        itta[nh+1][nw]+=itta[nh][nw]
    if nw+1<w and a[nh][nw+1]==".":
        if itta[nh][nw+1]==0:
            d.append([nh,nw+1])
        itta[nh][nw+1]+=itta[nh][nw]

print(itta[-1][-1]%mod)

Measured memory_bytes: 66012
"""nを素因数分解"""
"""2以上の整数n => [(素因数, 指数), ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(n**0.5)+1):
        if temp%i == 0:
            cnt = 0
            while temp%i == 0:
                cnt += 1
                temp //= i
            arr.append((i, cnt))
    if temp != 1:
        arr.append((temp, 1))
    if arr == []:
        arr.append((n, 1))
    return arr

import fractions
a, b = map(int, input().split())
li = factorization(fractions.gcd(a, b))

if li[0][0] == 1:
    print(1)
else:
    print(len(li)+1)

Measured memory_bytes: 5432
import collections
import sys
sys.setrecursionlimit(10000000)

N,M = map(int,input().split())
A = [list(map(int, input().split())) for i in range(M)]
visit = set()
G = collections.defaultdict(set)
for idx,(f,to) in enumerate(A):
    G[f].add(to)

cache = {}
    
def dfs(start):
    if start in cache:
        return cache[start]
    ma = 0
    for i in G[start]:
        if i not in visit:
            #visit.add(i)
            ma = max(ma,dfs(i))
            #visit.remove(i)
    cache[start] = ma + 1 
    return ma + 1

ma = 0 
for f,to in A:
    #visit.add(f)
    ma = max(ma,dfs(f))
    #visit.remove(f)
print(ma - 1)
        
        

Measured memory_bytes: 118052
#! env python
# -*- coding: utf-8 -*-

import os
import sys
import itertools


# atcoder.main
# Date: 2020/06/20
# Filename: main 
# Author: acto_mini

def splitter(str):
    for i in range(1, len(str)):
        start = str[0:i]
        end = str[i:]
        yield (start, end)
        for split in splitter(end):
            result = [start]
            result.extend(split)
            yield result


def main():
    S = input()
    A = list(splitter(S))

    ans = int(S)
    for i in range(len(A)):
        for j in range(len(A[i])):
            ans += int(A[i][j])

    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 74732
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main(){

  //  string x;
  char x[100];



  while(gets(x)){
    //  cin >> x;


    bool is = true;
    if(strlen(x) >= 3){
      for(int i = 0; i < 30 ; i++){
	//the 
	for(int j = 0; j <= strlen(x)-3; j++){
	  if(is && x[j] =='t' && x[j+1] == 'h' && x[j+2] == 'e'){
	    is = false;
	    break;
	  }
	}
	// this or that
	if(strlen(x) >= 4){
	  for(int j = 0; j <= strlen(x)-4; j++){
	    if(is && x[j] =='t' && x[j+1] == 'h' && x[j+2] == 'a' && x[j+3] =='t' ){
	      is = false;
	      break;
	    }
	    if(is && x[j] =='t' && x[j+1] == 'h' && x[j+2] == 'i' && x[j+3] =='s' ){
	      is = false;
	      break;
	    }
	  }
	}
	// increment
	if(is == false) break; 
	for(int j = 0; j < strlen(x) ; j++){
	  if(x[j] == 'z') x[j] = 'a';
	  else if(x[j] >= 'a' && x[j] < 'z') x[j]++;
	}
      }
    
      if(is == false)	
	cout << x << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1124
n,x,y=map(int,input().split())
cnt=[0]*n
for i in range(1,n+1):
  for j in range(i+1,n+1):
    if i==j:
      continue
    dist=min(j-i,abs(x-i)+1+abs(y-j),abs(y-j)+1+abs(x-i))
    cnt[dist]+=1
print(*cnt[1:],sep="\n")

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

int main(){
    // 制約見て！！！デカかったらlong longにすること！
    set<int> s;
    int n;
    cin >> n;
    int a;
    cin >> a;
    s.insert(a);
    rep(i,n-1){
        cin >> a;
        if(s.find(a) != s.end()){
            cout<< "NO"<<endl;
            return 0;
        }
        s.insert(a);
    }

    cout<<"YES"<<endl;
}

Measured memory_bytes: 12980
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
	double a,b,c,d,e,f;
	while(cin >> a >> b >> c >> d >> e >> f){
		double y = (c*d-f*a)/(b*d-a*e);
		double x = (c-b*y)/a;
		printf("%.3lf %.3lf\n",x,y);
	}
}

Measured memory_bytes: 1236
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
typedef pair<int,pii>ppii;
typedef pair<ppii,ppii> d_pii;
ppii cal(string s){
    ppii temp;
    string a,b,c;
    a=s[0]; a+=s[1];
    b=s[3];b+=s[4];
    c=s[6];c+=s[7];
    temp.first=stoi(a);
    temp.second=pii(stoi(b),stoi(c));
    return temp;
}
int main(){
    int n;
    while(cin>>n,n){
        vector<pair<ll,ll>>v;
        rep(i,n){
            string s,e; cin>>s>>e;
            ppii start,end;
            start=cal(s);
            end=cal(e);
            ll _start=start.first*3600+start.second.first*60+start.second.second;
            ll _end=end.first*3600+end.second.first*60+end.second.second;
            v.push_back(make_pair(_start,_end));
        }
        sort(all(v));
        vl u(v.size());
        rep(i,v.size())u[i]=v[i].first;
        ll ans=0;
        ll base=0;
        u.push_back(INF);
        v.push_back(pii(INF,INF));
        rep(i,u.size()){
            ans++;
            base=v[i].second;
            while(true){
                bool update=false;
                vector<ll>::iterator itr=lower_bound(u.begin(), u.end(),base);
                if(itr!=u.end()){
                    int index=(int)(itr-u.begin());
                    update=true;
                    u.erase(itr);
                    base=v[index].second;
                    v.erase(v.begin()+index);
                }
                if(!update)break;
            }
        }
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 3272
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int a[200005],dist[200005];

int main() {
	// your code goes here
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int k,n;
	cin>>k>>n;
	for(int i=0; i<n; i++)
	    cin>>a[i];
	for(int i=1; i<n; i++)
	{
	    dist[i] = a[i] - a[i-1];
	}
	dist[0] = k - a[n-1] + a[0];
	int maxi = INT_MIN;
	for(int i=0; i<n; i++)
	    maxi = max(maxi, dist[i]);
	cout<<k - maxi;
	return 0;
}


Measured memory_bytes: 1792
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        char[] S = sc.next().toCharArray();
        long K = sc.nextLong();

        int ans = 1;
        for (int i = 0; i < S.length; i++) {
            char ch = S[i];
            if (ch == '1') {
                if (K - 1 == i)  {
                    ans = 1;
                    break;
                }
            } else {
                ans = ch - '0';
                break;
            }

        }

        System.out.println(ans);
        return;
    }

}

Measured memory_bytes: 23252
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define endl '\n'
# define PI  3.14159265358979323846
#define MOD 1000000007
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
const int N = 2e6+5;
const int INF = 1e18L;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}
int ar[N];
int dp[N];
signed main(){
	// #ifndef ONLINE_JUDGE
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	// #endif
	IOS;
	int T=1;
	// cin >> T;
	while(T--){
		double r;
		cin >> r;
		cout << fixed << setprecision(15);
		cout << 2*PI*r <<endl;
	
	
	}
	cerr << "Time Taken : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}

Measured memory_bytes: 3772
#include <bits/stdc++.h>
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
using Int = long long;
const char newl = '\n';


template<typename T,T MOD = 1000000007>
struct Mint{
  static constexpr T mod = MOD;
  T v;
  Mint():v(0){}
  Mint(signed v):v(v){}
  Mint(long long t){v=t%MOD;if(v<0) v+=MOD;}

  Mint pow(long long k){
    Mint res(1),tmp(v);
    while(k){
      if(k&1) res*=tmp;
      tmp*=tmp;
      k>>=1;
    }
    return res;
  }

  static Mint add_identity(){return Mint(0);}
  static Mint mul_identity(){return Mint(1);}

  Mint inv(){return pow(MOD-2);}

  Mint& operator+=(Mint a){v+=a.v;if(v>=MOD)v-=MOD;return *this;}
  Mint& operator-=(Mint a){v+=MOD-a.v;if(v>=MOD)v-=MOD;return *this;}
  Mint& operator*=(Mint a){v=1LL*v*a.v%MOD;return *this;}
  Mint& operator/=(Mint a){return (*this)*=a.inv();}

  Mint operator+(Mint a) const{return Mint(v)+=a;}
  Mint operator-(Mint a) const{return Mint(v)-=a;}
  Mint operator*(Mint a) const{return Mint(v)*=a;}
  Mint operator/(Mint a) const{return Mint(v)/=a;}

  Mint operator-() const{return v?Mint(MOD-v):Mint(v);}

  bool operator==(const Mint a)const{return v==a.v;}
  bool operator!=(const Mint a)const{return v!=a.v;}
  bool operator <(const Mint a)const{return v <a.v;}

  static Mint comb(long long n,int k){
    Mint num(1),dom(1);
    for(int i=0;i<k;i++){
      num*=Mint(n-i);
      dom*=Mint(i+1);
    }
    return num/dom;
  }
};
template<typename T,T MOD> constexpr T Mint<T, MOD>::mod;
template<typename T,T MOD>
ostream& operator<<(ostream &os,Mint<T, MOD> m){os<<m.v;return os;}

//INSERT ABOVE HERE
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  int n;
  cin>>n;

  vector<vector<int>> G[3];
  for(int t=0;t<3;t++){
    G[t].resize(n);
    int m;
    cin>>m;
    for(int i=0;i<m;i++){
      int a,b;
      cin>>a>>b;
      a--;b--;
      if(a>b) swap(a,b);
      G[t][a].emplace_back(b);
    }
  }

  const int MAX = 1010;
  using M = Mint<int, 998244353>;
  M base=M(10).pow(18);

  vector<M> cnt[3];
  for(int t=0;t<3;t++){
    vector<int> dp(n);
    dp.resize(n,0);
    for(int i=n-1;i>=0;i--){
      set<int> used;
      for(int j:G[t][i])
        used.emplace(dp[j]);
      while(used.count(dp[i])) dp[i]++;
    }
    cnt[t].resize(MAX,0);
    for(int i=0;i<n;i++) cnt[t][dp[i]]+=base.pow(i+1);
  }

  M ans{0};
  for(int x=0;x<MAX;x++)
    for(int y=0;y<MAX;y++)
      ans+=cnt[0][x]*cnt[1][y]*cnt[2][x^y];

  cout<<ans<<newl;
  return 0;
}


Measured memory_bytes: 13056
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> pii;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i))
#define mat(type, c, m, n) vector<vector<type>> c(m, vector<type>(n));for(auto& r:c)for(auto& i:r)cin>>i;
#define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define rrep(i,a,n) for(int i=(a), i##_len=(n); i>i##_len; --i)
#define each(x,y) for(auto &(x):(y))
#define var(type, ...)type __VA_ARGS__;Scan(__VA_ARGS__);
template<typename T> void Scan(T& t) { cin >> t; }
template<typename First, typename...Rest>void Scan(First& first, Rest&...rest) { cin >> first; Scan(rest...); }
#define vec(type, c, n) vector<type> c(n);for(auto& i:c) cin>>i;
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
#define em emplace
#define pb pop_back
#define fi first
#define se second
#define get(a, i) get<i>(a)
#define mt make_tuple
inline string zero(int a,string s,char c='0'){return string(a-len(s),c)+s;}
inline string zero(int a,int t,char c='0'){return zero(a, to_string(t), c);}
inline string zero(int a,ll t,char c='0'){return zero(a, to_string(t), c);}
#define mini min_element
#define maxi max_element
#define sum accumulate
#define chmax(a,b) if(a<b)a=b
#define chmin(a,b) if(a>b)a=b
template <class T> inline void print(T t){cout << t << endl;}
template <class H, class... T> inline void print(H h, T... t){cout << h << " ";print(t...);}
int main() {
	var(int, x1, y1, x2, y2);
	int xx = abs(x1 - x2), yy = abs(y1 - y2);
	int a =  x1 <= x2 ? xx : -xx;
	int b =  y1 <= y2 ? -yy : yy;
	print(x2 + b, y2 + a, x1 + b, y1 + a);
	return 0;
}


Measured memory_bytes: 256
C=[list(map(int,input().split())) for _ in range(3)]

for i in range(2):
  for j in range(i+1,3):
    if C[i][0]-C[j][0]==C[i][1]-C[j][1] and C[i][1]-C[j][1]==C[i][2]-C[j][2] and C[i][2]-C[j][2]==C[i][0]-C[j][0]:
      continue
    else:
      print('No')
      exit()

for i in range(2):
  for j in range(i+1,3):
    if C[0][i]-C[0][j]==C[1][i]-C[1][j] and C[1][i]-C[1][j]==C[2][i]-C[2][j] and C[2][i]-C[2][j]==C[0][i]-C[0][j]:
      continue
    else:
      print('No')
      exit()

print('Yes')

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

int main(void) {
  int n, m, k;
  cin >> n >> m >> k;

  string res="No";
  for (int i=0; i<=n; i++) {
    for (int j=0; j<=m; j++) {
      int cnt = i*(m-j)+j*(n-i);
      if (cnt == k) {
        res="Yes";
        break;
      }
    }
  }

  cout << res << endl;

  return 0;
}


Measured memory_bytes: 256
/*
 ╔═══╦═══╦═══╗
 ║╔═╗║╔══╩╗╔╗║
 ║║░║║╚══╗║║║║
 ║║░║║╔══╝║║║║
 ║╚═╝║╚══╦╝╚╝║
 ╚══╗╠═══╩═══╝
 ░░░╚╝░░░░░░░░
 */

#include <bits/stdc++.h>
#define ll					long long
#define debug(x)			{ cerr << #x << " = " << x << endl; }
#define MOD					1000000007
#define MAX					1e9
#define MIN                 -1e9
#define vi					vector<int>
#define vii					vector<vi>
#define mid(s,e)			(s+(e-s)/2)

using namespace std;

int main() {
	ios::sync_with_stdio(false);
 	cin.tie(0);
	ll l,r;
	cin>>l>>r;
	for(ll i=l; i<=r; i++) {
		if(i%2019 == 0) {
			cout<<"0";
			return 0;
		}
	}	
	ll res = MOD;
	for(ll i=l; i<=r; i++) {
		for(ll j=i+1; j<=r; j++) {
			res = min(res,(i*j)%2019);
		}
	} 
	cout<<res;
	return 0;
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll     = long long;
using pii    = pair<int, int>;
using pll    = pair<ll, ll>;
using vi     = vector<int>;
using vl     = vector<ll>;
using vvi    = vector<vi>;
using vvl    = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

template <typename T>
set<T> factors(T a) {
    set<T> facs;
    for (T i = 1; i * i <= a; ++i) {
        facs.insert(i);
        facs.insert(a / i);
    }
    return facs;
}

int main() {
    ll n, k;
    cin >> n >> k;
    if (n == 1) {
        cout << 1 << "\n";
        return 0;
    }
    auto facs = factors(n);
    int m     = facs.size();
    vi vfac;
    for (auto &f : facs)
        vfac.push_back(f);

    vvl dp(k, vl(m, 0));
    for (int i = 0; i < m; ++i)
        dp[0][i] = vfac[i];

    for (int j = 1; j < k; ++j) {
        for (int i = 0; i < m; ++i) {
            ll num = vfac[i];
            if (i)
                num -= vfac[i - 1];
            int idx  = lower_bound(vfac.begin(), vfac.end(), n / vfac[i]) - vfac.begin();
            dp[j][i] = (dp[j - 1][idx] * num) % MOD;
        }
        for (int i = 1; i < m; ++i) {
            dp[j][i] = (dp[j][i] + dp[j][i - 1]) % MOD;
        }
    }
    cout << dp[k - 1][m - 1] << "\n";
    return 0;
}

Measured memory_bytes: 53632
#template
def inputlist(): return [int(j) for j in input().split()]
from collections import Counter
#template
#issueから始める
N = int(input())
A = inputlist()
c = Counter(A)
key = list(c.keys())
dic = {}
dica = {}
for i in key:
    dic[i] = c[i]*(c[i]-1)//2
    dica[i] = (c[i]-1)*(c[i]-2)//2
ans = 0
for i in key:
    ans += dic[i]
for i in range(N):
    suma = ans
    suma = suma - dic[A[i]] + dica[A[i]]
    print(suma)

Measured memory_bytes: 108364
#include <iostream>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <string.h>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()

typedef long long lint;

using namespace std;

int main(){
  char a,b;
  cin>>a>>b;
  bool A=(a=='H');
  bool B=(b=='H');
  cout<<((!(a^b))?'H':'D')<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <b; i++)
typedef long long ll;
#define int ll
typedef vector<int> vi;
typedef vector<long long> vl;
typedef pair<int,int> pi;
#define trace(x) cout<<#x<<"="<<x<<"\n";
#define llp 1000000007
#define mod 1000000007

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
    return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
    os << "{";
    typename vector< T > :: const_iterator it;
    for( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
    os << "[";
    typename set< T > :: const_iterator it;
    for ( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
    os << "[";
    typename map< F , S >::const_iterator it;
    for( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << it -> first << " = " << it -> second ;
    }
    return os << "]";
}

#define deb(x) cerr << #x << " = " << x << endl;
int times=0;
int n, A, B;
vi a;
bool check(int t){
    vi b(n);
    REP(i,0,n){
        b[i]=a[i]-t*B;
    }
    int hav=t;
    for(int i=n-1;i>=0;i--){
        if(b[i]<=0){
            break;
        }
        else{
            int req=0;
            req=b[i]/(A-B);
            if((b[i]%(A-B))!=0){
                req++;
            }
            b[i]=0;
            hav-=req;
            if(hav<0){
                return false;
            }
        }
    }
    if(hav>=0){
        return true;
    }
    else{
        return false;
    }
}

int32_t main(){
	ios::sync_with_stdio(false);

    cin>>n>>A>>B;
    a.resize(n);
    REP(i,0,n){
        cin>>a[i];
    }
    sort(a.begin(),a.end());
    int l=0, r=2*(a[n-1]/B+1)+1;
    int ans=a[n-1]/B+1;
    while(l<=r){
        int mid=(l+r)/2;
        if(check(mid)){
            ans=min(ans, mid);
            r=mid-1;
        }
        else{
            l=mid+1;
        }
    }

    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    long long int H;
    cin >> H;
    
    long long int count = 0;
    long long int N = 1;
    long long int x = H;
    
    while (N > 0) {
        if (x == 1) {
            count += N;
            N = 0;
        } else if (x > 1) {
            count += N;
            N *= 2;
            x = x/2;
        }
    }
    
    cout << count << endl;
}


Measured memory_bytes: 256
import queue

import sys
input = sys.stdin.readline

N=int(input())
adj=[[] for _ in range(N)]

for i in range(N-1):
    u,vv,w=map(int,input().split())
    u-=1
    vv-=1
    adj[u].append((vv,w%2))
    adj[vv].append((u,w%2))

q=queue.Queue()
ans=[0]*N
q.put((0,-1,0))#v,par,col

while not q.empty():
    v,p,c=q.get()
    for i in range(len(adj[v])):
        n_v=adj[v][i][0]
        if n_v!=p:
            n_c=(c+adj[v][i][1])%2
            ans[n_v]=n_c
            q.put((n_v,v,n_c))
            
[print(ans[i]) for i in range(N)]

Measured memory_bytes: 79276
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
using namespace std;
using llong = long long;
using vi    = vector<int>;
using vvi   = vector<vi >;
using vvvi  = vector<vvi >;
using pii   = pair<int,int>;
constexpr int    INF=1e9;
constexpr double EPS=1e-9;
constexpr int    MOD=1e9+7;
template<class Type>
void line(const Type &a){int cnt=0;for(const auto &elem:a){cerr<<(cnt++?' ':'>');cerr<<elem;}cerr<<endl;}

int main(){
	int n;
	cin>>n;
	
	llong ans=0LL;
	for(int i=1;i<n;++i){
		ans+=(n-1)/i;
	}
	
	cout<<ans<<endl;
}

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

int main(){
  int a,b;
  cin >> a >> b;
  
  for (int n=0;n<10000;++n){
    int za=n*8/100;
    int zb=n/10;
    if (a==za&&b==zb){
        cout << n << endl;
        return 0;
    }
  }
  cout << "-1" << endl;
}


Measured memory_bytes: 256
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

#include <bits/stdc++.h>
using namespace std;

int main(){
  ll n,a,b,c,d,e;
  cin>>n>>a>>b>>c>>d>>e;
  
  ll mi=min({a,b,c,d,e});
  ll x=(n+mi-1)/mi-1;
  
  cout<<x+5<<endl;
    
  return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

const ll mod = 1000000007;
struct mint {
    ll x;
    mint(ll x = 0) :x((x% mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) {
            x -= mod;
        }
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) {
            x -= mod;
        }
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

int main() {
    int n;
    cin >> n;
    vector<int> a(n+1);
    unordered_set<int> s;
    int doub;
    rep(i, n+1){
        cin >> a[i];
        if(s.find(a[i]) != s.end())doub = a[i];
        s.insert(a[i]);
    }
    int l = -1;
    int r = -1;
    rep(i, n+1){
        if(a[i] == doub){
            if(l == -1)l = i;
            else r = n - i;
        }
    }

    vector<mint> nck(n+2, 0), lck(l+r+1, 0);
    nck[0] = 1; lck[0] = 1;
    rep(i, n+1){
        nck[i+1] = nck[i] * (n+1-i);
        nck[i+1] /= (i + 1);
    }
    rep(i, l+r){
        lck[i+1] = lck[i] * (l+r-i);
        lck[i+1] /= (i + 1);
    }
    for(int k = 1; k <= l+r+1; k++)nck[k] -= lck[k-1];

    rep(i, n+1){
        cout << nck[i+1].x << endl;
    }
    
}

Measured memory_bytes: 7332
# -*- coding: utf-8 -*-
from heapq import heappop, heappush


def prim(edges, *, start=0, adj_matrix=False, default_value=float('inf')):
    '''
    Returns the Minimum Spanning Tree(MST) of a given graph

    # sample input when given not as adjacency list (adj_matrix=False) (generally works faster)
    edges = [[(1, 2), (2, 5), (3, 4)],         # node 0
             [(0, 2), (3, 3), (4, 6)],         # node 1
             [(0, 5), (3, 2), (5, 6)],         # node 2
             [(0, 4), (1, 3), (2, 2), (4, 2)], # node 3
             [(1, 6), (3, 2), (5, 4)],         # node 4
             [(2, 6), (4, 4)]]                 # node 5

    # sample input when given as adjacency matrix (adj_matrix=True)
    edges = [[0, 2, 5, 4, inf, inf],           # node 0
             [2, 0, inf, 3, 6, inf],           # node 1
             [5, inf, 0, 2, inf, 6],           # node 2
             [4, 3, 2, 0, 2, inf],             # node 3
             [inf, 6, inf, 2, 0, 4],           # node 4
             [inf, inf, 6, inf, 4, 0]]         # node 5
    '''

    n = len(edges)

    costs = [float('inf')] * n
    costs[start] = 0
    prevs = [-1] * n

    pq = [(0, start)]
    T = [True] * n

    while pq:
        tmp_cost, tmp_node = heappop(pq)
        T[tmp_node] = False

        nxt_edges = ((node, cost) for node, cost in enumerate(edges[tmp_node]) if cost != default_value and T[node]) if adj_matrix else\
                    ((node, cost) for node, cost in edges[tmp_node] if T[node])

        for nxt_node, nxt_cost in nxt_edges:
            if costs[nxt_node] > nxt_cost:
                costs[nxt_node] = nxt_cost
                prevs[nxt_node] = tmp_node
                heappush(pq, (nxt_cost, nxt_node))
                T[nxt_node] = True

    else:
        if len([prev for prev in prevs if prev != -1]) != n - 1:
            raise NoSpanningError(
                'There is no spanning tree in this graph (search started from node{})'.
                format(start))

        else:
            return prevs, costs


class NoSpanningError(Exception):
    pass


if __name__ == '__main__':
    '''
    an example of using this function
    AIZU ONLINE JUDGE - ALDS_1_12_A
    '''

    n = int(input())
    edges = [[(j, int(cost)) for j, cost in enumerate(input().split())
              if int(cost) != -1] for i in range(n)]

    prevs, costs = prim(edges)
    print(sum(costs))



Measured memory_bytes: 6464
#include<stdio.h>
#include<stdlib.h>

#define N 101

main(){
  int u,k,i,n,v,j,Aij[N][N];
  scanf("%d",&n);

    for(i=1;i<=n;i++){
      for(j=1;j<=n;j++)
	Aij[i][j] = 0;
    }

  for(i=1;i<=n;i++){
    scanf("%d %d",&u,&k);
    for(j=1;j<=k;j++){
      scanf("%d",&v);
      Aij[i][v] = 1;
    }
  }

  for(i = 1;i <= n;i++){
    for(j=1;j<= n;j++){
      printf("%d",Aij[i][j]);
	if(j!=n) printf(" ");
    }
    printf("\n");  
  }
  return 0;

}

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

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

	vector<string> gift(n);
	for(int i = 0; i < n; i++){
		cin >> gift.at(i);
	}

	sort(gift.begin(), gift.end());

	int count = 1;

	for(int i = 0; i < n-1; i++){
		if(gift.at(i) != gift.at(i+1)){
			count++;
		}
	}
		cout << count << endl;
}

Measured memory_bytes: 9596
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

class DisjointSet
{
public:
    DisjointSet() {}
    DisjointSet(int n)
    : p(vs32(n, -1)), w(vs32(n, 0))
    {}
    ~DisjointSet() {}

    bool same(int x, int y)
    {
        x = parent(x);
        y = parent(y);
        return x == y;
    }

    int diff(int x, int y)
    {
        parent(x); parent(y);
        return w[y] - w[x];
    }

    void unite(int x, int y, int d)
    {
        int rx = parent(x);
        int ry = parent(y);

        if (rx == ry) return;

        if (p[rx] > p[ry])
        {
            swap(rx, ry);
            swap(x, y);
            d = -d;
        }
        p[rx] += p[ry];
        p[ry] = rx;
        w[ry] = w[x] + d - w[y];
    }

    int parent(int x)
    {
        int ret;
        if (p[x] < 0)
        {
            ret = x;
        }
        else
        {
            ret = parent(p[x]);
            w[x] += w[p[x]];
            p[x] = ret;
        }
        return ret;
    }

    vs32 p;
    vs32 w;
};

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

    int n, q;
    cin >> n >> q;

    DisjointSet ds(n);
    char com;
    int x, y, d;
    rep (i, q)
    {
        cin >> com;
        if (com == '0')
        {
            cin >> x >> y >> d;
            ds.unite(x, y, d);
        }
        else if (com == '1')
        {
            cin >> x >> y;
            if (!ds.same(x, y))
            {
                cout << "?\n";
            }
            else
            {
                cout << ds.diff(x, y) << "\n";
            }
        }
    }

    return 0;
}




Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ll long long int
const int INF = 2147483647;
const ll MOD = 1000000007;

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);

  REP(i, n) { cin >> a[i]; }

  ll ans = (a[0] == 0) ? 1 : 0;
  ll ans2 = (a[0] == 0) ? 1 : 0;

  bool minus = true;
  ll total = a[0] == 0 ? 1 : a[0];
  if (a[0] < 0) {
    ans += abs(a[0]) + 1;
    total = 1;
  }
  FOR(i, 1, n) {
    if (minus) {
      if (a[i] + total >= 0) {
        ans += a[i] + total + 1;
        total = -1;
      } else {
        total += a[i];
      }
    } else {
      if (a[i] + total <= 0) {
        ans += abs(a[i] + total) + 1;
        total = 1;
      } else {
        total += a[i];
      }
    }
    minus = !minus;
  }

  cout << endl;

  minus = false;
  total = (a[0] == 0) ? -1 : a[0];
  if (a[0] > 0) {
    ans2 += abs(a[0]) + 1;
    total = -1;
  }
  FOR(i, 1, n) {
    if (minus) {
      if (a[i] + total >= 0) {
        ans2 += a[i] + total + 1;
        total = -1;
      } else {
        total += a[i];
      }
    } else {
      if (a[i] + total <= 0) {
        ans2 += abs(a[i] + total) + 1;
        total = 1;
      } else {
        total += a[i];
      }
    }
    minus = !minus;
  }

  cout << min(ans, ans2) << endl;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pi;
int maxn = 1000000;
int eratoes[1000006];
bool visited[1000006];
bool pairwise = true;
int GCD(int a,int b){
	if(a<b) swap(a,b);
	while(b){
		int t = a%b;
		a = b;
		b = t;
	}
	return a;
}
void proccess(int a){
	vector<int>primes;
	while(a!=1){
		primes.push_back(eratoes[a]);
		a/=eratoes[a];
	}
	for(int i=0; i<primes.size(); i++){
		if(visited[primes[i]]) pairwise = false;
	}
	for(int i=0; i<primes.size(); i++){
		visited[primes[i]] = true;
	}
}
int main(){
	for(int i=2; i<=maxn; i++) eratoes[i] = i;
	for(int i=2; i*i<=maxn; i++){
		if(eratoes[i]==i){
			for(int j=i*i; j<=maxn; j+=i){
				eratoes[j] = i;
			}
		}
	}
	int n;
	cin>>n;
	vector<int>arr(n);
	for(int i=0; i<n; i++) cin>>arr[i];
	for(int i=0; i<n; i++){
		proccess(arr[i]);
		if(!pairwise) break;
	}
	if(pairwise) cout<<"pairwise coprime";
	else{
		int gcd = arr[0];
		for(int i=1; i<n; i++) gcd = GCD(gcd,arr[i]);
		if(gcd==1) cout<<"setwise coprime";
		else cout<<"not coprime";
	}
}

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

constexpr long double EPS = 1e-15;
const long double PI = acos(-1);
constexpr int inf = 2e9;
constexpr ll INF = 2e18;
constexpr ll MOD = 1e9+7;
constexpr ll MOD1 = 998244353;
typedef pair<ll,ll> P;

//#define all(v) (v).begin(), (v).end()
#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
//#define mp make_pair

ll a[200010];
ll diff[200010];
ll s,t;

ll ff(ll num) {
    if (num >= 0) return -num * s;
    else return -num * t;
}

ll f(ll pre, ll now) {
    ll dp = ff(pre);
    ll dn = ff(now);
    return dn - dp;
}

void solve() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n,q;
    cin >> n >> q >> s >> t;
    REP(i,n + 1) {
        cin >> a[i];
    }
    rep(i,1,n + 1) {
        diff[i] = a[i] - a[i-1];
    }
    ll tmp = 0;
    rep(i,1,n + 1) {
        if (diff[i] > 0) {
            tmp -= s * diff[i];
        } else {
            tmp += t * (-diff[i]);
        }
    }

    REP(i,q) {
        int from, to;
        ll h;
        cin >> from >> to >> h;
        to++;
        ll prel = diff[from];
        ll prer = diff[to];
        ll l = prel + h;
        ll r = prer - h;
        tmp += f(prel, l);
        if (to != n+1) {
            tmp += f(prer, r);
            diff[to] = r;
        }
        diff[from] = l;
        cout << tmp << endl;
    }
}


int main(int argc, char *argv[]){

    // /* Regular */
    // int case_num = 1;
    // if (argc > 1 && stoi(argv[1])) cin >> case_num;
    // REP(case_no, case_num) {
    //   cerr << endl << "case " << case_no + 1 << endl;
    //   solve();
    // }

    /* AOJ */
    solve();

    return 0;
}


Measured memory_bytes: 6340
#include<bits/stdc++.h>
using namespace std;
#define int long
signed main(){
  int n,res=1e8;
  cin>>n;
  vector<int> x(n);
  for(auto& i:x)cin>>i;
  for(int i=1;i<=100;++i){
    int sp=0;
    for(int j=0;j<n;++j)sp+=(x[j]-i)*(x[j]-i);
    res=min(res,sp);
  }
  cout<<res;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int x1, y1, x2, y2;
    int d;
    cin >> x1 >> y1 >> x2 >> y2;
    int dx = x2 - x1;
    int dy = y2 - y1;
    cout << x2-dy << " " << y2+dx << " " << x1-dy << " " <<y1+dx << endl;
}


Measured memory_bytes: 256
//C
//#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>


#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#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 <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

//Hang in there!

using namespace std;


int main() {
	double T, X;
	cin >> T >> X;
	cout << T / X << endl;
}
	



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  set<int> s;
  char a;
  for(int i=0;i<n;i++){
    cin>>a;
    s.insert(a);
  }
  cout<<(s.size()==3?"Three":"Four");
}

Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<iterator>
#include<sstream>
#include<iomanip>
#include<map>
#include<queue>
#include<deque>
#include<fstream>

#define rep(i, n) for (ll i = 0; i < n; i++) 
#define rrep(i, n) for(ll i = n-1; i>=0; i--)
#define range(i, n, m) for (ll i = n; i < m; i++) 
#define rrange(i, n, m) for (ll i = n - 1; i => m; i--) 
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vp vector<pair<ll, ll> >
#define vvp vector<vector<pair<ll, ll> > >
#define First first
#define Second second.first
#define Third second.second
//#define MOD 998244353

typedef long long int ll;
typedef unsigned long long int ull;

using namespace std;

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; }

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

	ll N;
	cin >> N;

	vl D(N);
	rep(i, N) {
		cin >> D[i];
	}

	sort(D.begin(), D.end());

	ll K = D[(N / 2)] - D[(N / 2)-1];

	cout << K << endl;
	


	return 0;
}



Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
constexpr ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);

ll mod_pow(ll x, ll n) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * x % mod;
		x = x * x % mod; n >>= 1;
	}
	return res;
}
struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n % mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint& a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint& a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint& a, modint b) { a.n = ((ll)a.n * b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a * a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p % a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 20;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}

void solve() {
	int n; cin >> n;
	int ans = 1000 - n % 1000;
	if (ans == 1000)ans = 0;
	cout << ans << "\n";
}




signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	//int t; cin >> t; rep(i, t)
	solve();
	return 0;
}


Measured memory_bytes: 19996
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        long[] brokens = new long[n+1];
        long[] ins = new long[n+1];
        for(int i = 0;i < m;i++){
            brokens[sc.nextInt()] = 1;
        }
        for(int i = 1;i < n + 1;i++){
            if(brokens[i] == 1){
                ins[i] = 0;
            }else if(i == 1){
                ins[i] = 1;
            }else if(i == 2){
                ins[i] = ins[i - 1] + 1;
            }else{
                ins[i] = ins[i - 1] + ins[i - 2];
                ins[i] = ins[i] % 1000000007;
            }
        }
        System.out.println(ins[n]);
    }
}

Measured memory_bytes: 50328
#include <bits/stdc++.h>
using namespace std;
#define repeat(i,a,b) for(int i=(a),_=(b);i<_;i++)
#define repeat_back(i,a,b) for(int i=(b)-1,_=(a);i>=_;i--)
#define mst(a,a0) memset(a,a0,sizeof(a))
//#define vector basic_string
#define fi first
#define se second
#ifndef qwq
int cansel_sync=(ios::sync_with_stdio(0),cin.tie(0),0);
#endif
//mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
const int N=200010; typedef long long ll; const int inf=~0u>>2; const ll INF=~0ull>>2; ll read(){ll x; if(scanf("%lld",&x)==-1)exit(0); return x;} typedef double lf; typedef long double llf; const lf pi=acos(-1.0); lf readf(){lf x; if(scanf("%lf",&x)==-1)exit(0); return x;} template<typename T> T sqr(const T &x){return x*x;} typedef pair<ll,ll> pii;
const int mod=(1?1000000007:998244353); ll mul(ll a,ll b,ll m=mod){return a*b%m;} ll qpow(ll a,ll b,ll m=mod){ll ans=1; for(;b;a=mul(a,a,m),b>>=1)if(b&1)ans=mul(ans,a,m); return ans;} ll getinv(ll v,ll m=mod){return qpow(v,m-2,m);}
#define int ll
int n,t,ans,a[N],m;
signed main(){
	cin>>n;
	repeat(i,0,n+1)cin>>a[i],m+=a[i],ans+=a[i];
	int top=1;
	repeat(i,0,n+1){
		//cout<<t<<' '<<top<<' '<<ans<<endl;
		top-=a[i]; if(top<0 || (top==0 && i!=n)){ans=-INF; break;}
		ans+=top;
		m-=a[i]; top=min(top*2,m);
	} 
	if(ans<0)cout<<-1<<endl;
	else cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 4432