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

#define MX 1003
#define ll long long
const ll MOD = 1e9 + 7;
char A[MX][MX];
ll dp[MX][MX];
int n, m;

int main()
{
    scanf("%d%d\n", &n, &m);
    for (int i = 0; i < n; i++)
        scanf("%s", A[i]);

    for (int i = 0; i < n; i++){
        for (int j = 0; j < m; j++){
            if (i == 0 || j == 0){
                if (A[i][j] == '#') dp[i][j] = 0;
                else{
                    dp[i][j] = 1;
                    if (i > 0) dp[i][j] = dp[i-1][j];
                    if (j > 0) dp[i][j] = dp[i][j-1];
                }
            }
            else{
                if (A[i][j] == '#') dp[i][j] = 0;
                else dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % MOD;
            }
        }
    }
    printf("%lld\n", dp[n-1][m-1]);
    return 0;
}



Measured memory_bytes: 9088
def solve():
    N = int(input())
    s = [int(input()) for _ in range(N)]
    s.sort()
    ans = sum(s)

    if ans % 10 != 0:
        print(ans)
        return

    mn = float('inf')
    for i in range(N):
        if s[i] % 10 != 0:
            mn = min(mn, s[i])
    
    if mn == float('inf'):
        print(0)
    else:
        ans -= mn
        print(ans)

if __name__ == '__main__':
    solve()

Measured memory_bytes: 69652
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
#include <queue>
#include <tuple>
//#include <functional>
#include <cstring>

#define PI 3.14159265359
#define INF 1e9
#define LINF 1e18
#define IMOD 1000000007 
#define irep(i,n) for(int  i = 0; i < n; i++)
#define irep2(i,a,n) for(int i = a; i <= n; i++)
#define lrep(i,n) for(long long  i = 0; i < n; i++)
#define lrep2(i,a,n) for(long long i = a; i <= n; i++)

typedef long long ll;
typedef std::vector<char> v_char;
typedef std::vector<double> v_double;
typedef std::vector<std::vector<double> > v2_double;
typedef std::vector<int> v_int;
typedef std::vector<std::vector<int> > v2_int;
typedef std::vector<ll> v_ll;
typedef std::vector<std::vector<ll> > v2_ll;
typedef std::vector<std::string> v_string;
typedef std::vector<std::vector<std::string> > v2_string;
typedef std::vector<bool> v_bool;
typedef std::vector<std::vector<bool> > v2_bool;
typedef std::pair<ll, ll> pll;
typedef std::pair<int, int> pii;

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

using namespace std;

int main(void)
{
    int n;
    cin >> n;
    map<string, int> t;

    irep(i, n) {
        string tmp;
        cin >> tmp;
        t[tmp]++;
    }
    
    vector<pair<int, string> > ans;
    for(auto mp : t) {
        ans.push_back(make_pair(mp.second, mp.first));
    }
    sort(ans.rbegin(), ans.rend());
    
    int pre = ans[0].first;
    v_string s;
    s.push_back(ans[0].second);
    for(int i = 1; i < ans.size(); i++) {
        if(pre != ans[i].first) {
            break;
        } else {
            s.push_back(ans[i].second);
        }
    }

    sort(s.begin(), s.end());
    irep(i, s.size()) {
        cout << s[i] << endl;
    }

    return 0;
}
/** atcoder **/


Measured memory_bytes: 32492
#include <stdio.h>

int main(){
 char O[64], E[64], pass[128];
 unsigned i;
 scanf("%s%s", O, E);
 for(i = 0; O[i]; i++){
  pass[i * 2] = O[i];
  pass[i * 2 + 1] = E[i];
 }
 pass[i * 2] = '\0';
 printf(pass);
 putchar('\n');
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define eraser(v,i) (v).erase(v.begin()+(i))
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
int num[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
bool uru(int checkyear){if(checkyear%4==0){if(checkyear%100!=0||checkyear%400==0)return true;}return false;}
int gcd( int x, int y ){return y ? gcd(y, x%y) : x;}
signed main()
{
double x=0,y=0,z=0,w=0,n=0,m=0;
std::cin >> x;
std::cout << (int)((x+1)*(x/2)) << '\n';
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
 
int main(){
    char str[33];
    char ls[1000][33] = {0};
    int  len = 0, i, j;
    int  num[1000] = {0};
     
    while(scanf("%s", str) != EOF){
        for(i = 0; str[i]; i++)
            if('A' <= str[i] && str[i] <= 'Z')
                str[i] -= 'A';
                
        strcpy(ls[len++], str);
    }
    
    strcpy(str, ls[0]);
    
    for(i = 1; i <= len; i++){
        if(strlen(str) < strlen(ls[i]))
            strcpy(str, ls[i]);
            
        for(j = i; j <= len; j++)
            if(!strcmp(ls[i], ls[j])) num[i]++;
    }
            
    for(i = 1, j = 0; i <= len; i++)
        if(num[j] < num[i]) j = i;
            
    printf("%s %s\n", ls[j], str);
    
    return 0;
}

Measured memory_bytes: 600
#include<iostream>
#include<map>
using namespace std;
const int MAX=210000;
const long long MOD=1000000007;

typedef long long ll;

ll fac[MAX],finv[MAX],inv[MAX];

ll mod_pow(ll x, ll n){
    ll ans=1;
    while(n!=0){
        if(n&1) ans=ans*x%MOD;
        x=x*x%MOD;
        n=n>>1;
    }
    return ans;
}

void com_init(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        //inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        //finv[i]=finv[i-1]*inv[i]%MOD;
        finv[i]=finv[i-1]*mod_pow(i,MOD-2)%MOD;
    }
}

ll comb(ll n, ll k){
    if(n<k) return 0;
    if(n<0||k<0) return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}

map<ll,ll> prime_factor(ll n){
    map<ll,ll> table;
    for(ll i=2;i*i<=n;i++){
        while(n%i==0){
            table[i]++;
            n/=i;
        }
    }
    if(n!=1) table[n]=1;
    return table;
}

int main(){
    ll n;
    ll m;
    com_init();
    cin >> n >> m;
    
    map<ll,ll> res;
    res=prime_factor(m);

    ll ans=1;

    map<ll,ll>::iterator it;
    for(it=res.begin();it!=res.end();it++){
        ll tmp=comb(it->second+n-1,n-1);
        ans*=tmp;
        ans%=MOD;
    }
    cout << ans << endl;
}



Measured memory_bytes: 4480
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	
	int n;
	scanf("%d",&n);
	
	int mem[256]={0};
	int x[256][5] = {{0}};
	for(int i = 0; i < n; i++){
		for(int j = 0; j < 3; j++){
			scanf("%d",&x[i][j]);
		}
	}
	
	for(int i = 0; i < 3; i++){
		bool check[256]={0};
		for(int j = 0;j < n; j++){
			for(int k = j+1; k < n; k++){
				if(x[j][i] == x[k][i]){
					check[j] = 1;
					check[k] = 1;
				}
			}
		}
		for(int j = 0; j < n; j++){
			if(check[j] == 1)continue;
			mem[j] += x[j][i];
		}
	}
	
	for(int i = 0; i < n; i++){
		printf("%d\n",mem[i]);
	}	
	return 0;
}
	

Measured memory_bytes: 1028
import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    String s = sc.next();
    if(a>=3200){
      System.out.println(s);
    }else{
      System.out.println("red");
    }  
  } 
}

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

ans = 0
for i in range(N):
    for j in range(i+1, N):
        dist = 0
        for d in range(D):
            dist += (X[i][d]-X[j][d])*(X[i][d]-X[j][d])
        for r in range(1, 200):
            if dist == r*r:
                ans += 1
                break

print(ans)

Measured memory_bytes: 3064
#include<iostream>
#include<cstdint>
#include<algorithm>
#include<numeric>
#include<string>

int const MAXK = 2e5;

int e[MAXK], l[MAXK];

int main() {
  int N, K, C;
  std::string S;
  std::cin >> N >> K >> C >> S;
  // earliest work days
  int lwd = -C-1, k = 0;
  for(int i = 0; i < N; ++i) if(S[i]!='x' && i > lwd+C) {
    e[k++] = lwd = i;
    if(k == K) break;
  }
  // latest work days
  lwd = N+C; k = K;
  for(int i = N-1; i >= 0; --i) if(S[i]!='x' && i < lwd-C) {
    l[--k] = lwd = i;
    if(k == 0) break;
  }
  for(int i = 0; i < K; ++i) if(e[i] == l[i]) {
    std::cout << e[i]+1 << std::endl;
  }
  return 0;
}


Measured memory_bytes: 3332
#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long ret = a * c;
    ret = max(ret, a * d);
    ret = max(ret, b * c);
    ret = max(ret, b * d);
    cout << ret << endl;
    return 0;
}




Measured memory_bytes: 3644
#include <iostream>

using namespace std;

int main(){

int n;
int ac = 0;
int wa = 0;
int tle = 0;
int re = 0;

cin>>n;

string arr [n];

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

for (int i = 0; i<n; i++){
    if(arr[i] == "AC"){
        ac++;
    } else if(arr[i] == "WA"){
        wa++;
    } else if(arr[i] == "TLE"){
        tle++;
    } else if(arr[i] == "RE"){
        re++;
    }
}

cout<<"AC x "<<ac <<endl;

cout<<"WA x "<<wa <<endl;

cout<<"TLE x "<<tle <<endl;

cout<<"RE x "<<re <<endl;

    return 0;
}

Measured memory_bytes: 6748
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
int main()
{
    int N; cin >> N;
    vector<int> A(N); for (auto &a : A) cin >> a, a--;
    int ans = 0;
    for (int i = 0; i < N; i++) {
        if (A[A[i]] == i) ans++;
    }
    cout << ans/2 << endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
/////////////////////////////////
int main()
{
    int n, a, b;
    cin >> n >> a >> b;
    cout << min(b, n * a) << endl;
}


Measured memory_bytes: 3576
#include<iostream>

using namespace std;

int main()
{
	long long k,a,b;
	cin >> k >> a >> b;

	long long yen=0,bisk=1;
	
	for(int i=0;i<k;i++)
	{
		if(i==k-1)
		{
			if(yen>0)
			{
				yen--;
				bisk+=b;
			}
			else
				bisk++;
		}
		else
		{
			if(yen>0)
			{
				yen--;
				bisk+=b;
			}
			else
			{
				if(b-a>2 && bisk>=a)
				{
					bisk-=a;
					yen++;
				}
				else
					bisk++;
			}
		}
	}
	cout << bisk << endl;
}




Measured memory_bytes: 256
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    sc.nextLine();
    String l = sc.nextLine();
    String[] al = l.split(" ");
    int[] in = new int[n];
    for (int i = 0; i < n; i++) {
      in[i] = Integer.parseInt(al[i]);
    }
    Arrays.sort(in);
    int ans = 0;
    for (int i = n - 1; i >= n-k; i--) {
      ans += in[i];
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 21716
#include<cstdio>
#define ll long long
#define P 1000000007
int a[100005],in[100005],col[100005],cnt[100005],n,L[100005];bool cir[100005];long long f[100005],ans=1;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i) scanf("%d",&a[i]),++in[a[i]];
	for(int i=1;i<=n;++i)
	{
		if(col[i]) continue;int x=i;for(;!col[x];x=a[x]) col[x]=i;
		if(col[x]!=i) continue;for(;!cir[x];x=a[x]) cir[x]=1; 
	}
	for(int i=1;i<=n;++i) if((cir[i]&&in[i]>2)||(!cir[i]&&in[i]>1)) return puts("0"),0;
	for(int i=1;i<=n;++i){if(in[i]) continue;int x=i,tmp=0;while(!cir[x]) x=a[x],tmp++;L[x]=tmp;} 
	for(int i=1;i<=n;++i)
	{
		if(!cir[i]) continue;int x=i,st=0,fir=0,id=0,len=0;
		while(cir[x])
		{
			++id;cir[x]=0;
			if(L[x])
			{
				if(!fir){st=fir=id;len=L[x];x=a[x];continue;}
				else{(ans*=(L[x]<(id-st))+(L[x]<=(id-st)))%=P;if(!ans)return puts("0"),0;st=id;x=a[x];continue;}
			}
			x=a[x];
		}
		if(fir){(ans*=(len<(id+fir-st))+(len<=(id+fir-st)))%=P;if(!ans)return puts("0"),0;}
		else cnt[id]++;
	}
	for(int i=1;i<=n;++i)
	{
		f[0]=1;if(!cnt[i]) continue;
		if(i>1&&(i%2)) for(int j=1;j<=cnt[i];++j) {f[j]=f[j-1]*2%P;if(j>1) (f[j]+=f[j-2]*(j-1)*i%P)%=P;}
		else for(int j=1;j<=cnt[i];++j){f[j]=f[j-1];if(j>1) (f[j]+=f[j-2]*(j-1)*i%P)%=P;}   
		(ans*=f[cnt[i]])%=P;if(!ans)return puts("0"),0;
	}
	printf("%lld",ans);
}

Measured memory_bytes: 2176
using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static void Main(string[] args)
    {
      string[] input = ReadLine().Split();
      int a = int.Parse(input[0]);
      int b = int.Parse(input[1]);
      List<string> s= new List<string>();
      List<string> s1= new List<string>();
      int ans = 0;
      
      for (int i=a;i<=b;i++)
      {
        s=i.ToString().ToList().ConvertAll(x=>x.ToString());
        s1=i.ToString().ToList().ConvertAll(x=>x.ToString());
        s.Reverse();
        if (string.Join("",s)==string.Join("",s1))
        {
          ans+=1;
        }
      }
      WriteLine(ans);
    }
}

Measured memory_bytes: 46908
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
const char NL = '\n'; 
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n; cin >> n;
  vector<int> a(n);
  REP(i,n) cin >> a[i];
  vector<int> sub;
  REP(i,n-1){
    if(a[i+1]-a[i]>0) sub.push_back(1);
    else if(a[i+1]-a[i]<0) sub.push_back(-1);
  }
  
  int ans = 1;
  if(sub.size()>1){
    REP(i,sub.size()-1){
      if(sub[i] != sub[i+1]) ans++, i++;
    }
  }
  cout << ans << NL;
  return 0;
}


Measured memory_bytes: 1404
#include<iostream>
using namespace std;
int main() {
    int n;
    cin >> n;
    int x[n], y[n], h[n];
    for (int i = 0; i < n; ++i) {
        cin >> x[i] >> y[i] >> h[i];
    }
    int Max = 100;
    for (int yy = 0; yy <= Max; ++yy) { //top
        for (int xx = 0; xx <= Max; ++xx) {
            int needH = -1; //一意
            for (int i = 0; i < n; ++i) {
                if (h[i] > 0) {
                    int tmp = h[i] + abs(xx - x[i]) + abs(yy - y[i]);
                    if (needH == -1) { //最初
                        needH = tmp;
                    } else if (needH != tmp) {
                        needH = -2;
                        break;
                    }
                }
            }
            if (needH == -2) {
                continue;
            }
            for (int i = 0; i < n; ++i) {
                if (h[i] == 0) { //本来負かもしれない
                    int dist = abs(yy - y[i]) + abs(xx - x[i]);
                    if (needH > dist) {
                        needH = -2;
                        break;
                    }
                }
            }
            if (needH == -2) {
                continue;
            }
            cout << xx << " " << yy << " " << needH << endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iterator>
#include <vector>
#include <iomanip>
#include <iostream>
#include <stack>
#include <queue>
#include <list>
#include <utility>
 
#include <string>
#include <cstring>
 
#include <cstdio>
#include <cassert>
 
// M_PI for pi
#define _USE_MATH_DEFINES
#include <cmath>
 
using namespace std;
 
static const int MAX = 1005;
char s[MAX];
 
int main(int argc, char* argv[]) {

    cin >> s;

    //int n = 0;
    char c;

    bool bN = false;
    bool bE = false;
    bool bW = false;
    bool bS = false;

    for (int i = 0; i < MAX; ++i) {
        c = s[i];

        if (c == 'N') {
            bN = true;
        } else if (c == 'E') {
            bE = true;
        } else if (c == 'W') {
            bW = true;
        } else if (c == 'S') {
            bS = true;
        } else {
            break;
        }
    }

    if (
        (bN == bS) && (bW == bE)
        ) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

    int N;
    string S;
    cin >> N >> S;
    int left = 0, right = 0;
    REP(i, N) {
        if (S[i] == '(') {
            right++;
        } else if (right > 0) {
            right--;
        }
    }
    REPR(i, N) {
        if (S[i] == ')') {
            left++;
        } else if (left > 0) {
            left--;
        }
    }
    string res = string(left, '(') + S + string(right, ')');
    cout << res << endl;

    return 0;
}


Measured memory_bytes: 3624
def gcd(a, b):
  v0 = a
  v1 = b
  v2 = a % b
  while v2 > 0:
    v0 = v1
    v1 = v2
    v2 = v0 %v1
  return v1

def lcm(a, b):
  return a * b // gcd(a, b)

N = int(input())
tmp = 1
for i in range(N):
  T = int(input())
  ans = lcm(T, tmp)
  tmp = ans
print(int(ans))
  


Measured memory_bytes: 3060
n = int(input())
x = 0
y = 0
t = 0
a = 0
def trav(a,b,c,d,e,f):
    if abs(a-b) + abs(c-d) <= e - f and ((a-b) % 2 + (c-d) % 2)%2 == (e-f) % 2:
        return 0
    else:
        return 1
for i in range(n):
    tn,xn,yn = map(int,input().split())
    if trav(xn,x,yn,y,tn,t) == 0:
        x = xn
        y = yn
        t = tn
    else:
        a = 1
if a == 0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include<stdio.h>
int main(void){
int n,a[10000],min,max,A;
long long int sum=0;
scanf("%d",&n);
for(A=0;A<n;A++){
scanf("%d",&a[A]);
}
min=a[0];
max=a[0];
for(A=0;A<n;A++){
if(min>a[A])min=a[A];
if(max<a[A])max=a[A];
sum+=a[A];
}
printf("%d %d %lld\n",min,max,sum);
return 0;
}


Measured memory_bytes: 2000
#include<cstdio>
#include<algorithm>

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

using namespace std;

typedef long long ll;

const ll M=1000000007;

int main(){
	int n,T; scanf("%d%d",&n,&T);
	int a[100000];
	rep(i,n) scanf("%d",a+i);
	sort(a,a+n);

	ll ans=1;
	rep(i,n){
		int c=upper_bound(a+i,a+n,a[i]+T)-(a+i);
		ans=ans*c%M;
	}
	printf("%lld\n",ans);

	return 0;
}

Measured memory_bytes: 1432
#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <list>
#include <algorithm>
#include <math.h>
#include <iomanip>      // std::setprecision
#include <unordered_map>
#include <set>
#define FOR(x,y,z) for(int x = (y); x < (z); x++)
#define FORD(x,y,z) for(int x = (y); x >= z; x--)
#define REP(r,n) for(int r = 0; r < (n); r++)
#define MP make_pair
#define ST first
#define MAXUS 3000
#define ND second
#define PB push_back
#define MAXUS2 9000005
#define PI 3.1415926
#define SIZE(c) ((int)((c).size()))
#define FOREACH(i,x) for (__typeof((x).begin()) i=(x).begin(); i!=(x).end(); i++)
#define ALL(u) (u).begin(),(u).end()
#define epsilon 0.000001
#define MAXUS3 3000010
using namespace std;

typedef long long LL;
typedef long double LD;
typedef vector<int> VI;
typedef pair<int, int> PR;

int main() {
    ios_base::sync_with_stdio(0);
    int n, k;
    cin >> n;
    int in[n];
    LL sum = 0; 
    REP(i,n) {
        cin >> in[i];
        sum += in[i];
    }
    LL sum0 = 0;
    LL best = abs(in[0]-(sum-in[0]));
    REP(i,n-1) {
        sum0 += in[i];
        if (abs(sum0-(sum-sum0)) < best) best = abs(sum0-(sum-sum0));
    }
    cout << best << endl;
    return 0;

}


Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <cmath>
#include <queue>
#include <map>
#include <cstring>
#include <string>
#include <set>
#include <vector>
#include <list>
#include <deque>
#include <algorithm>
#include <stack>
#include <numeric>
#include <time.h>
#include<iomanip>
#pragma warning(disable:4996)
using namespace std;
const int inf = 0x7f7f7f7f;
const long long mod = 1e9 + 7;
int main()
{
	int a, b;
	cin >> a >> b;
	cout << a + b / 2 << endl;
}
// 运行程序: Ctrl + F5 或调试 >“始执行(不调试)”菜单
// 调试程序: F5 或调试 >“开始调试”菜单
// 入门提示:
//   1. 使用解决方案资源管理器窗口添 加/管理文件
//   2. 使用团队资源管理器窗口连接到源代码管理
//   3. 使用输出窗口查看生成输出和其他消息
//   4. 使用错误列表窗口查看错误
//   5. 转到“项目”>“添加新项”以创建新的代码文件，或转到“项目”>“添加现有项”以将现有代码文件添加到项目
//   6. 将来，若要再次打开此项目，请转到“文件”>“打开”>“项目”并选择 .sln 文件

Measured memory_bytes: 256
package main

import (
	"bytes"
	"fmt"
	"log"
	"strconv"
)

func main() {
	log.SetFlags(log.Lshortfile)
	var N, M, Q int
	_, err := fmt.Scanf("%d %d %d", &N, &M, &Q)
	if err != nil {
		log.Fatal(err)
	}
	var data [510][510]int
	for i := 0; i < M; i++ {
		var l, r int
		_, err := fmt.Scanf("%d %d", &l, &r)
		if err != nil {
			log.Fatal(err)
		}
		data[l][r]++
	}

	for i := N; i >= 1; i-- {
		for j := 1; j <= N; j++ {
			data[i][j] += data[i+1][j]
			data[i][j] += data[i][j-1]
			data[i][j] -= data[i+1][j-1]
		}
	}
	var buf bytes.Buffer
	for i := 0; i < Q; i++ {
		var p, q int
		_, err := fmt.Scanf("%d %d", &p, &q)
		if err != nil {
			log.Fatal(err)
		}
		buf.WriteString(strconv.Itoa(data[p][q]))
		buf.WriteString("\n")
	}
	fmt.Println(buf.String())
}

Measured memory_bytes: 9344
#include<bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define repk(i,k,n) for (ll i = k; i < (ll)(n); ++i)
#define INF 500000001000000000
#define MOD 1000000007
typedef long long  ll;

using namespace std;

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

	ll N;
	cin >> N;

	vector<pair<ll,ll>> AB(N);
	rep(i,N){
		cin >> AB[i].second >> AB[i].first;
	} 

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

	ll now = 0;
	rep(i,N){
		now += AB[i].second;
		if(now > AB[i].first){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 3456
#define TST 0
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <cctype>
#include <bits/stdc++.h>

using namespace std;
// for loop
#define F(i, L, R) for(long i = L; i < R; i++)
#define FE(i, L, R) for(long i = L; i <= R; i++)
// for (reversed)
#define FR(i, L, R) for(long i = L; i > R; i--)
#define FRE(i, L, R) for(long i = L; i >= R; i--)

// data types
#define Int long
#define ul unsigned long
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned shoft

// vectors
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
#define ALL(c) (c).begin(),(c).end()
#define last(vec) vec.size()-1
#define lastEle(vec) vec[last(vec)]
#define pb push_back
#define InputV(a, n) F(i,0,n){long l; cin >> l; a.pb(l);}

// debug
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl;
#define printA(a, L, R) FE(i, L, R) cout << a[i] << (i==R?'\n':' ')
#define printAF(a, L) printA(a, 0, L-1)
#define printV(a) printA(a, 0, a.size()-1)
#define printM(a, n, m) F(i, 0, n){ FE(j, 0, m) cout << a[i][j] << (i==m?'\n':' ');}

// utils
#define char2int(c) (c-'0')
#define bit(x, i) (x&(1<<i))
#define space ' '
#define PI 3.14159265358979323

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

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

#define printMatrix(mat,n,m){ \
    F(i, 0, n){               \
        F(j, 0, m){           \
            cout << mat[i][j] << space;\
        }\
        cout << endl;\
    }\
}

int main() {
#if TST==1
    ifstream in ("input.txt");
    cin.rdbuf(in.rdbuf());
#endif
    ll n;
    cin >> n;
    int ans = 100;
    for(ll i = 1; i<=sqrt(n);i++){
        if(n % i != 0)continue;
        int length = to_string(n/i).size();
        ans = min(ans, length);
    }
#if TST==1
#endif
    cout << ans << endl;
}


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

using namespace std;

int main(){
    string S, T;
    cin >> S;
    cin >> T;
    for (int i = 0; i < S.size(); ++i) {
        if(S[i] == T[0]){
            string temp(S);
            S.resize(i);
            S = (&temp[i]) + S;
//            cout << S << endl;
            if(S == T){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#define INT_MAX (~(1<<31))
using namespace std;

int merge(int *a, int left, int mid, int right){
	int n1, n2, *l, *r, i, j, k, cnt;
	cnt = 0;
	n1 = mid - left;
	n2 = right - mid;
	l = new int[n1+1];
	r = new int[n2+1];
	for(i=0;i<n1;++i)l[i] = a[left+i];
	for(i=0;i<n2;++i)r[i] = a[mid+i];
	l[n1] = r[n2] = INT_MAX;
	i = j = 0;
	for(k=left;k<right;++k){
		cnt++;
		if(l[i]<=r[j]){
			a[k] = l[i];
			++i;
		}else{
			a[k] = r[j];
			++j;
		}
	}
	return cnt;
}

int mergeSort(int *a, int left, int right){
	int cnt = 0;
	if(left+1 < right){
		int mid = (left + right) / 2;
		cnt += mergeSort(a,left,mid);
		cnt += mergeSort(a,mid,right);
		cnt += merge(a,left,mid,right);
	}
	return cnt;
}
    
int main() {
	int n,*s, cnt;
	
	cin>>n;
	s = new int[n];
	for(int i=0;i<n;++i){
		cin>>s[i];
	}
	
	cnt = mergeSort(s,0,n);
	
	for(int i=0;i<n;++i){
		cout<<s[i]<<(i!=n-1?" ":"");
	}
	cout<<endl<<cnt<<endl;
	
	return 0;
}

Measured memory_bytes: 63936
#include <algorithm>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
constexpr int kMod = 1000000007;
typedef long long LL;

template<typename T>
std::map<T, int> prime_factorize(T x) {
  std::map<T, int> primes;
  for (T factor = 2; factor * factor <= x; ++factor) {
    if (x % factor == 0) {
      T count = 0;
      while (x % factor == 0) {
          count++;
          x /= factor;
      }
      primes[factor] = count;
    }
  }
  if (x != 1) primes[x] = 1;
  return primes;
}

LL modpow(LL a, LL b, LL mod) {
  LL r = 1;
  while (b) {
    if (b % 2 == 1) r = r * a % mod;
    a = a * a % mod;
    b /= 2;
  }
  return r;
}

LL invmod(LL a, LL mod) {
  return modpow(a, mod - 2, mod);
}

int main() {
  int N; std::cin >> N;
  std::vector<LL> A(N);
  for (int i = 0; i < N; ++i) std::cin >> A[i];

  // LCM
  std::map<LL, int> lcm;
  for (const auto& v : A) {
    const std::map<LL, int>& ps = prime_factorize(v);
    for (const auto& p : ps) {
      if (lcm.find(p.first) == lcm.end()) lcm[p.first] = p.second;
      else                                lcm[p.first] = std::max(lcm[p.first], p.second);
    }
  }

  LL lcm_v = 1;
  for (const auto& p : lcm) {
    lcm_v = (lcm_v * modpow(p.first, p.second, kMod)) % kMod;
  }

  LL sum = 0;
  for (const auto& v : A) {
    LL b = lcm_v * invmod(v, kMod) % kMod;
    sum = (sum + b) % kMod;
  }

  std::cout << sum << std::endl;
}


Measured memory_bytes: 896
#include <iostream>
#include <math.h>

using namespace std;
int t[100005];
int x[100005];
int y[100005];
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>t[i]>>x[i]>>y[i];
	}
	t[0]=0;x[0]=0;y[0]=0;
	for(int i=1;i<=n;i++)
	{
		if((abs(x[i]-x[i-1])+abs(y[i]-y[i-1]))%2!=(t[i]-t[i-1])%2||(abs(x[i]-x[i-1])+abs(y[i]-y[i-1]))>t[i]-t[i-1]) 
		{
			cout<<"No"<<endl;
			return 0;
		}
	} 
	cout<<"Yes"<<endl;
	return 0;
}

Measured memory_bytes: 1408
#include <set>
#include <map>
#include <iostream>
using namespace std;
int main() {
    map<string, int> m;
    int n; cin >> n;
    while (n--) {
        string s; cin >> s;
        m[s]++;
    }
    int mx = 0;
    for (auto &x : m) mx = max(mx, x.second);
    set<string> S;
    for (auto &x : m) if (x.second == mx) S.insert(x.first);
    for (const string &s : S) cout << s << endl;
}


Measured memory_bytes: 35584
#!/usr/bin/env python3
import sys


def solve(A: int, B: int, C: int):
    print(max(C - (A - B), 0))
    return



# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    solve(A, B, C)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;

const int N = 1e6 + 10;

char s[1000010];

inline int C(int n, int m) { return (n & m) == m; }

int main() {
    int n;
    scanf("%d%s", &n, s + 1);
    if(n == 1) putchar(s[1]), puts("");
    else {
        --n;
        int find1 = 0;
        for(int j = 1; j <= n; j++)
            s[j] = abs(s[j] - s[j + 1]), find1 |= s[j] == 1;
        if(!find1) for(int i = 1; i <= n; i++) s[i] >>= 1;
        find1 ^= 1;
        int t = 0;
        for(int j = 1; j <= n; j++) t ^= C(n - 1, j - 1) * (s[j] & 1);
        cout << (int(t) << find1) << endl;
    }
    return 0;
}


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

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

typedef long long LL;
const LL mod=1000000007;
#define MAX 10000
#define NIL -1
const double PI  = acos(-1.0);
const int INF = 1e9 + 7;
//-------------------------------------------

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int N, a[MAX], cnt = 0;
    cin >> N;

    bool flag = false;

    vector <int> v;
    REP(i, N){
        int z;
        cin >> z;
        z--;
        v.push_back(z);
    }

    int i = 0;
    for( ; ;){
        cnt++;

        if( v[i] == 1){
            flag = true;
            cout << cnt << endl;
            break;
        }

        i = v[i];

        if( cnt > N){ break;}

    }

    if( !flag){ cout << -1 << endl;}

    return 0;
}


Measured memory_bytes: 892
#include <iostream>
using namespace std;
static const int N = 100;

int main(){
    int M[N][N];
    int n, u, k, v;

    cin >> n;

    for (int i = 0; i < n; i++){
        for (int j = 0; j < n; j++){
            M[i][j] = 0;
        }
    }

    for (int i = 0; i < n; i++){
        cin >> u >> k;
        u--;
        for (int j = 0; j < k; j++){
            cin >> v;
            v--;
            M[u][v] = 1;
            }
    }

    for (int i = 0; i < n; i++){
        for (int j = 0; j < n; j++){
            if (j){
                cout << " ";
            }
            cout << M[i][j];
        }
        cout << endl;
    }
    return 0;
}


Measured memory_bytes: 3084
import java.util.Scanner;

public class Main {
    static int N;
    static int B;

    private static void init() {
        Scanner scanner = new Scanner(System.in);
        N = scanner.nextInt();
        B = scanner.nextInt();
        scanner.close();
    }


    public static void main(String[] args) {
        init();
        if(N - (B * 2) <= 0) {
            System.out.println(0);
        } else {
            System.out.println(N - (B * 2));
        }
    }
}

Measured memory_bytes: 21844
from collections import deque
import math

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

n = NextInt()
print((100000000-n)%1000)

Measured memory_bytes: 9396
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
typedef long long ll;
ll dp[51][51][2501];
int main(){
	int N,A;
	cin>>N>>A;
	dp[0][0][0]=1;
	rep(i,N){
		int x;
		cin>>x;
		rep(j,50) rep(k,2501) if(dp[i][j][k]){
			dp[i+1][j][k]+=dp[i][j][k];
			dp[i+1][j+1][k+x]+=dp[i][j][k];
		}
	}
	ll ans=0;
	rep1(i,N) ans+=dp[N][i][i*A];
	cout<<ans<<endl;
}


Measured memory_bytes: 9600
n,a,b = map(int, input().split())
s = list(str(input()))
count_all = 0
count_a = 0
count_b = 0
for person in s:
    if person == "a":
        if count_all < a+b:
            print("Yes")
            count_all += 1
        else:
            print("No")
    elif person == "b":
        if count_all < a+b and count_b < b:
            print("Yes")
            count_all += 1
            count_b += 1
        else:
            print("No")
    else:
        print("No")


Measured memory_bytes: 4712
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {

	int N,K;cin>>N>>K;
	vector<vector<int>>v(2*K,vector<int>(2*K));
	for (int i = 0; i < N; ++i) {
		int x,y;char c;cin>>x>>y>>c;
		if(c=='B')x+=K;
		x%=2*K;
		y%=2*K;

		v[y][x]++;
	}
	vector<vector<int>>sums(2*K+1,vector<int>(2*K+1));

	for (int y = 0; y < 2 * K+1; ++y) {
		for (int x = 0; x < 2 * K + 1; ++x) {
			if (y&&x) {
				sums[y][x]=v[y-1][x-1]+sums[y-1][x]+sums[y][x-1]-sums[y-1][x-1];
			}
		}
	}

	int ans=0;
	for (int u = 0; u < K; ++u) {
		for (int l = 0; l <  K; ++l) {
			int nans;
			 {

				int ttl=l;
				int ttu=u;
				int lu = sums[ttu][ttl];
				int ly = sums[ttu + K][ttl] - lu;
				int ld = sums[2 * K][ttl] - ly - lu;
				int xu = sums[ttu][ttl+K] - lu;
				int xy = sums[ttu + K][ttl + K] - ly - xu - lu;
				int xd = sums[2 * K][ttl + K] - xu - xy - ld - ly - lu;
				int ru = sums[ttu][2 * K] - xu - lu;
				int ry = sums[ttu + K][2*K]-ru-xu-xy-lu-ly;
				int rd = sums[2*K][2*K]-ry-ru-xd-xy-xu-ld-ly-lu;
				nans=lu+ld+xy+ru+rd;
			}
			ans=max(ans,N-nans);
			ans=max(ans,nans);
		}
	}

	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 31744
gets.to_i
X = gets.chomp.split(" ").map(&:to_i).sort

ans = 10 ** 6
(X[0]..X[-1]).each{|m|
  wk = X.inject(0){|r, x|
    r + (x - m) ** 2
  }
  ans = wk if ans > wk
}

puts ans


Measured memory_bytes: 1788
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <string.h>
#include <math.h>

int main (void)
{
    intmax_t N;
    intmax_t ans = 0;

    scanf("%jd", &N);

    for (int i = 1; i < (N / 2); i++) {
        ans++;
    }
    if (N % 2) ans++;
    if (N == 1) ans--;

    printf("%jd\n", ans);

    return 0;
}


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

int main(void){
    int a,b,c;
    scanf("%d",&a);
    if(1>a || a>100){
        while(1>a || a>100){
            scanf("%d",&a);
        }
    }
    scanf("%d",&b);
    if(1>b || b>100){
        while(1>b || b>100){
            scanf("%d",&b);
        }
    }
    c=a*b;
    printf("%d\n",c);
}


Measured memory_bytes: 1732
import sys
input=sys.stdin.readline
from collections import deque
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())
 
def ss_raw():
    return input().split()
 
def ints_raw():
    return tuple(map(int, ss_raw()))


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


DIV = 10**9+7

def ncr(n, r, mod=DIV):
	r = min(r, n-r)
	ret = 1
	for i in range(1, r+1):
		ret = ret * (n-i+1) % mod
		ret = ret * mod_inv(i, mod) % mod
	return ret


def main():
    ans =0
    N,X = ints_raw()
    Ls = ints_raw()
    D = 0
    for l in [0]+list(Ls):
        D+=l
        if D<=X:
            ans+=1
    return ans

print(main())


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

int main(){
  int N,K;
  string S;
  cin >> N >> S >> K;
  char x=S[K-1];
  for(int i=0;i<N;i++){
    if(S[i]!=x){S[i]='*';}
  }
  cout << S << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define X first
#define Y second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define endl '\n'
#define fastio ios::sync_with_stdio(false); cin.tie(nullptr)
using namespace std;

using ll = long long;
const int dx[] = { -1, 0, 1, 0, -1, 1, 1, -1 };
const int dy[] = { 0, 1, 0, -1, 1, 1, -1, -1 };

int main() {
	fastio;
	int N, K;
	cin >> N >> K;

	cout << (N + K - 3) / (K - 1);

	return 0;
}

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

const int maxn = 1e7+1;

int n;
long long d[maxn];

void sieve() {
	for (int i = 1; i < maxn; ++i) {
		for (int j = i; j < maxn; j += i) {
			d[j]++;
		}
	}
}

void p() {
	int n; cin >> n;
	long long ans = 0;
	for (int i = 1; i <= n; ++i) {
		for (int j = i; j <= n; j += i) {
			ans += j;
		}
	}
	cout << ans << '\n';
}

void p2() {
	int n; cin >> n;
	long long ans = 0;
	for (int i = 1; i <= n; ++i) {
		long long d = n/i;
		ans += i * (d * (d + 1) / 2);
	}
	cout << ans << '\n';
}

int main() {
	p2(); return 0;
	cin >> n;
	sieve();
	long long ans = 0;
	for (int i = 1; i <= n; ++i) {
		ans += d[i] * i;
	}
	cout << ans << '\n';
}

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(2e5 + 5);

int n;

vector<pair<ll, ll>> bas;

int main(void) {
  // Here your code !
  scanf("%d", &n);

  for (int i = 0; i < n; ++i) {
    ll a, b;
    scanf("%lld %lld", &a, &b);

    bas.push_back(make_pair(b, a));
  }

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

  ll cur = 0LL;

  for (auto ba: bas) {
    cur += ba.second; // plus a

    if (cur > ba.first) {
      printf("No\n");
      return 0;
    }
  }

  printf("Yes\n");

  return 0;
}


Measured memory_bytes: 6256
import java.util.List;
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int t = sc.nextInt();
        int a = sc.nextInt();
        int[] l = new int[n];
        for (int i = 0; i < n; i++) {
            l[i] = sc.nextInt();
        }
        double min = Double.MAX_VALUE;
        int minIndex = 0;
        for (int i = 0; i < n; i++) {
            double temp = t - l[i] * 0.006;
            if (Math.abs(temp - a) < min) {
                min = Math.abs(temp - a);
                minIndex = i;
            }

        }

        System.out.println(minIndex + 1);
    }
}

Measured memory_bytes: 22228
(defun dist2 (px py qx qy)
  (+ (expt (- px qx) 2)
     (expt (- py qy) 2)))

(defvar A (float (read) 0d0))
(defvar B (float (read) 0d0))
(defvar h (float (read) 0d0))
(defvar m (float (read) 0d0))
(incf h (/ m 60))


(defvar lx)
(defvar ly)
(defvar sx)
(defvar sy)

(setf lx (* A (sin (* 2 (/ h 12) pi))))
(setf ly (* A (cos (* 2 (/ h 12) pi))))
(setf sx (* B (sin (* 2 (/ m 60) pi))))
(setf sy (* B (cos (* 2 (/ m 60) pi))))


(format t "~,11F" (sqrt (dist2 lx ly sx sy)))
       


Measured memory_bytes: 24172
#include <chrono>

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <time.h>
#include <random>
#include <string>
#include <cassert>
#include <vector>
#include <ostream>
#include <istream>
#include <stack>
#include <deque>
#include <queue>
#include <functional>

using namespace std;

#define int long long
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define pii pair<int, int>
#define ld long double

ostream& operator << (ostream &a, const vector<int> &b) {
    for (auto k : b) cout << k << " ";
    return a;
}

#ifdef LOCAL
    #define dbg(x) cout << #x << " : " << (x) << "\n";
    const int INF = 1e18;
//    const int mod = 2600000069;
//    const int p = 10;
//    const ld PI = 3.1415926535;
#else
    #define dbg(x)
    const int INF = 1e18;
//    const int mod = 2600000069;
//    const int p = 179;
//    const ld PI = 3.1415926535;
#endif

//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,sse3,sse4")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("fast-math")
//#pragma GCC target("avx2")
//#pragma GCC optimize("section-anchors")
//#pragma GCC optimize("profile-values,profile-reorder-functions,tracer")
//#pragma GCC optimize("vpt")
//#pragma GCC optimize("rename-registers")
//#pragma GCC optimize("move-loop-invariants")
//#pragma GCC optimize("unswitch-loops")
//#pragma GCC optimize("function-sections")
//#pragma GCC optimize("data-sections")

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifdef LOCAL
    #else
//        freopen("capitals.in", "r", stdin);
//        freopen("capitals.out", "w", stdout);
    #endif
    string s;
    cin >> s;
    int n = s.size();
    if (s[2] == s[3] && s[4] == s[5]) {
        cout << "Yes\n";
        return 0;
    } else cout << "No\n";
}
/*

*/


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define endl '\n'
const int inf = 1000000007;
const ll INF = 1e18;
// int mod = 998244353;
int mod = 1000000007;
const double eps = 1e-8;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template<typename T, typename U> T pow_(T a, U b) { return b ? pow_(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<class T> ostream& operator << (ostream& os, const set<T>& s) { for (auto si : s) os << si << " "; return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { a += b % mod; if (a >= mod) a -= mod; }
template<class T> void operator += (vector<T>& v, vector<T> v2) { rep(i, sz(v2)) v.eb(v2[i]); }

void solve();

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout << fixed << setprecision(12); // debuged
    int T;
    T = 1;
    while (T--) solve();
}

void solve() {
    string s;
    cin >> s;
    if (s[0] == 'R' && s[1] == 'R' && s[2] == 'R') cout << 3 << endl;
    else if ((s[0] == 'R' && s[1] == 'R') || (s[1] == 'R' && s[2] == 'R')) cout << 2 << endl;
    else if (s[0] == 'R' || s[1] == 'R' || s[2] == 'R') cout << 1 << endl;
    else cout << 0 << endl;
}







Measured memory_bytes: 3652
#!/usr/bin/env python3
import sys

YES = "YES"  # type: str
NO = "NO"  # type: str


def solve(N: int, K: int):
    from math import ceil
    if(ceil(N/2) >= K):
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include <iostream>
using namespace std;
int main(){
    int N;
    cin >> N;
    int arr[N];
    for (int i = 0 ; i < N ; i++)
        cin >> arr[i];
    long long ans = 0;
    for (int i = 0 ; i < N - 1 ; i++)
        ans += max(0 , arr[i] - arr[i + 1]),
        arr[i + 1] = max(arr[i + 1] , arr[i]);
    cout << ans << endl;
}


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

using namespace std;
#define d getchar()
int main() {

	string s;
	int k;

	cin >> k;
	cin >> s;

	if (s.size() <= k)
		cout << s;

	else{
		int c = 0;
		for (auto a : s) {
			cout << a;
			if (c == k-1) {
				cout << "...";
				break;
			}
			c++;
		}
	}

	return 0;
}


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

int main() {

    int a,b;
    cin>>a>>b;

    if(a+b<24){
        cout<<a+b<<endl;
    }
    else {
        cout<<a+b-24<<endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for (long i=0;i<(n);i++)
#define FOR(i,a,b) for (long i=(a);i<(b);i++)
#define RREP(i,n) for(long i=n;i>=0;i--)
#define RFOR(i,a,b) for(long i=(a);i>(b);i--)
#define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i]) << endl;
#define dump2d_arr(array) REP(i,array.size()) REP(j,array[i].size()) cerr << #array << "[" << (i) << "]" << "[" << (j) << "] ==> " << (array[i][j]) << endl;
#define dump(x)  cerr << #x << " => " << (x) << endl;
#define CLR(vec) { REP(i,vec.size()) vec[i] = 0; } 
#define llINF (long long) 9223372036854775807
#define loINF (long) 2147483647
#define shINF (short) 32767
#define SORT(c) sort((c).begin(),(c).end())
using namespace std;
typedef long long LL;
typedef vector<long> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef pair<LL,LL> pr;
typedef vector<pr> VP;

int main(void){
	short N,K;
	cin >> N >> K;

	VL x(N);
	VL y(N);
	VP point(N);
	REP(i,N) {
		LL x_input,y_input;
		cin >> x_input >> y_input;
		point[i].first  = x[i] = x_input;
		point[i].second = y[i] = y_input;
	}
	SORT(x);
	SORT(y);

	long count;
	LL ans = llINF;
	REP(x_min,N){
		RFOR(x_max,N-1,x_min){
			REP(y_min,N){
				RFOR(y_max,N-1,y_min){
					count = 0;
					REP(p,N){
						if (x[x_min] <= point[p].first && y[y_min] <= point[p].second && point[p].first <= x[x_max] && point[p].second <= y[y_max]) count++;
					}

					if (count >= K) {
						#ifdef DEBUG
							cerr << "------------------" << endl;
							dump(x[x_max]);
							dump(x[x_min]);
							dump(y[y_max]);
							dump(y[y_min]);
							dump((x[x_max]-x[x_min])*(y[y_max]-y[y_min]));
						#endif
						ans = min(ans,(x[x_max]-x[x_min])*(y[y_max]-y[y_min]));
					}
				}
			}
		}
	}
	cout << ans <<endl;
	return 0;
}

Measured memory_bytes: 256