akhauriyash/Code-Regression huggingface dataset:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap

class Mod:
    def __init__(self, m):
        self.m = m
    
    def add(self, a, b):
        return (a + b ) % self.m

    def sub(self, a, b):
        return (a - b) % self.m
    
    def mul(self, a, b):
        return ((a % self.m) * (b % self.m)) % self.m

    def div(self, a, b):
        return self.mul(a, self.pow(b, self.m-2))

    def pow(self, x, y):
        if y == 0: 
            return 1
        elif y == 1: 
            return x % self.m
        elif y % 2 == 0: 
            return self.pow(x, y//2)**2 % self.m
        else: 
            return self.pow(x, y//2)**2 * x % self.m


@mt
def slv(N):
    if N==3:
        return 61

    m = Mod(10**9+7)
    dp = {}
    iv = [
        'agc',
        'acg',
        'gac',
        'aggc'
        'acgc',
        'atgc',
        'agac',
        'aggc',
        'agtc',
    ]
    for s in product('agct', repeat=4):
        s = ''.join(s)
        if not any(map(lambda x: x in s, iv)):
            dp[s] = 1

    for _ in range(N-4):
        dp_ = Counter()
        for k, v in dp.items():
            for c in 'agct':
                s = k + c
                if not any(map(lambda x: x in s, iv)):
                    dp_[s[1:]] = m.add(v, dp_[s[1:]])
        dp = dp_
    
    ans = 0
    for k, v in dp.items():
        ans = m.add(ans, v)


    return ans


def main():
    N = read_int()
    print(slv(N))


if __name__ == '__main__':
    main()


Measured memory_bytes: 5444
N,M = map(int,input().split())
A = list(map(int,input().split()))
match = [0,2,5,5,4,5,6,3,7,6]

dp = [-1 for _ in range(N+1)]
dp[0] = 0
for i in range(N+1):
    for a in A:
        if i-match[a]>=0:
            dp[i] = max(dp[i],dp[i-match[a]]*10+a)

print(dp[-1])

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

int main(){

  int n, k, ans = 0;
  int l[55];

  cin >> n >> k;

  for(int i = 0; i < n; i++){
    cin >> l[i];
  }
  sort(l, l+n);
  int j = n-1;
  for(int i = 0; i < k; i++){
    ans += l[j];
    j--;
  }
  cout << ans << endl;
  return 0;
}


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

int h, w, n;
vector<string> a;
int dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0};
typedef pair<int, int> P;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> h >> w;
	n = h * w;
	a.resize(h);
	for(auto &i:a) cin >> i;
	vector<int> d(n, 1e9);
	queue<P> q;
	for(int i=0; i<h; ++i)
		for(int j=0; j<w; ++j){
			if(a[i][j] == '#'){
				d[i*w+j] = 0;
				q.push(P(0, i*w+j));
			}
		}
	while(!q.empty()){
		P p = q.front(); q.pop();
		int t = p.second;
		if(d[t] < p.first) continue;
		int x = t / w, y = t % w;
		for(int i=0; i<4; ++i){
			int nx = x + dx[i], ny = y + dy[i];
			if(0 <= nx && 0 <= ny && nx < h && ny < w){
				int u = nx * w + ny;
				if(d[u] > d[t] + 1){
					d[u] = d[t] + 1;
					q.push(P(d[u], u));
				}
			}
		}
	}
	int ans = 0;
	for(int i=0; i<n; ++i)
		ans = max(ans, d[i]);
	cout << ans << "\n";
//	for(int i=0; i<n; ++i)
//		cout << d[i] << "\n";
}

Measured memory_bytes: 13456
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<tuple>
#include<map>
#include<bitset>
#include<queue>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;

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

  n = n % 1000;
  if (n != 0){
    n = abs(n - 1000);  
  }

  cout << n << endl;
}


Measured memory_bytes: 3612
#include<iostream>
    #include<cstdio>
    #include<algorithm>
    using namespace std;
    int a,b;
    int main()
    {
    	scanf("%d%d",&a,&b);
    	int num=a+b;
    	num=max(num,a-b);
    	num=max(num,a*b);
    	printf("%d",num);
    	return 0;
    }

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(int argc, const char * argv[]) {
    long long n,m;
    cin>>n>>m;
    long long arr[n][2];
    for(long long i=0;i<n;i++){
        cin>>arr[i][0]>>arr[i][1];
    }
    long long dp[n+1][m+1];
    for(long long j=0;j<m+1;j++){
        for(long long i=0;i<n+1;i++){
            dp[i][j] = 0;
        }
    }
    
   for(long long i=1;i<n+1;i++){
        for(long long j=0;j<m+1;j++){
            if(arr[i-1][0]>j){
                dp[i][j] = dp[i-1][j];
            }
            else{
                dp[i][j] = max(dp[i-1][j],arr[i-1][1]+dp[i-1][j-arr[i-1][0]]);
            }
        }
    }
    
    cout<<dp[n][m]<<endl;
    return 0;
}

Measured memory_bytes: 82300
#include <bits/stdc++.h>
#define PI 3.1415926535897
using namespace std;
typedef long long ll;

int main(void)
{
    string S;
    cin >> S;

    int plus = 0;
    for (int i = 0; i < 4; i++)
    {
        if (S[i] == '+')
            plus++;
    }
    int ans = plus - (4 - plus);
    cout << ans << endl;

    return (0);
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);
		
		int n=s.nextInt();
		double d=s.nextDouble();
		
		int count=0;
		
		for(int i=0;i<n;i++)
		{
			double x=s.nextDouble();
			double y=s.nextDouble();
			
			double dist=Math.sqrt((x*x)+(y*y));
			
			if(dist<=d)
			{
				count++;
			}
			
		}
		
		System.out.println(count);
		
	}
	
}

Measured memory_bytes: 63608
void main() {
	auto N = ri;
	ulong a = 0, b = 0;
	while(4*a <= 100) {
		ulong tmp = 4*a + 7*b;
		while(tmp <= 100) {
			if(tmp == N) {
				writeln("Yes");
				return;
			}
			b++;
			tmp = 4*a + 7*b;
		}
		a++;
		b = 0;
	}
	writeln("No");
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.conv;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

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

void solve(long long A, string B) {
    long long b = B[0] - '0';

    b *= 100LL;

    b += (B[2] - '0') * 10LL;

    b += (B[3] - '0');
    cout << A * b / 100LL << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main() {
    long long A;
    string B;
    cin >> A >> B;
    solve(A, B);
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  
  int x = 0;
  for (int i = 0; i < N; i++) {
    if (i % 2 == 0) {
      x += vec.at(i);
    }
    else {
      x -= vec.at(i);
    }
  }
  cout << x << endl;
}


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

using namespace std;

int main(){
    int n;
    cin>>n;
    int count=0;
    
    for(int i=1;i<=n;i+=2){
        int ycnt=0;
        for(int j=1;j<=i;j++){
            if(i%j==0) ycnt++;
        }
        if(ycnt==8) count++;
    }
    
    cout<<count<<endl;
    
    return 0;
}

Measured memory_bytes: 256
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math

    inf = 10**17
    #mod = 10**9 + 7

    n,m = map(int, input().split())
    # key[i]:10進数でiを開けれる鍵の値段
    key = [inf]*(1<<n)
    for _ in range(m):
        a,b = map(int, input().split())
        c = list(map(int, input().split()))
        binary = 0
        for i in c:
            binary += 2**(i-1)
        if key[binary] > a:
            key[binary] = a

    # dp[i]:10進数で宝iを開けてる時の最小値段
    dp = [inf]*(1<<n)
    dp[0] = 0
    for i in range(1<<n):
        if key[i] == inf:
            continue
        for s in range(1<<n):
            if (i|s) == s:
                continue
            dp[i|s] = min(dp[i|s], dp[s]+key[i])
    print(dp[-1] if dp[-1] != inf else -1)

if __name__ == '__main__':
    main()


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

int main() {
	int h,n,sum=0;
	cin>>h>>n;
	int a[n];
	
	for(int i=0;i<n;i++){
		cin>>a[i];
		sum+=a[i];
	}
	
	if(sum-h>=0)
	cout<<"Yes";
	else
	cout<<"No";
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
//const int mod=998244353;
using P = pair<int,int>;
using Pll = pair<ll,ll>;
using ld=long double;
using V=vector<int>;
using Vl=vector<ll>;
using VV=vector<vector<int>>;
using VVl=vector<vector<ll>>;

// modint: mod 計算を int を扱うように扱える構造体
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};
using mint = Fp<1000000007>;

int main(){
   ll n;cin >>n;
   Vl a(n);
    for (int i = 0; i < n; ++i) {
        cin >>a[i];
    }
    vector<mint>sum(n+1,0);
    for (int i = 0; i < n;++i) {
        sum[i+1]=sum[i]+a[i];
    }
    mint ans=0;
    for (int i = 0; i < n; ++i) {
        auto k=sum[n]-sum[i+1];
        ans+=(k*a[i]);
    }
    cout <<ans <<endl;
}


Measured memory_bytes: 6420
n,a,b,c=map(int,input().split())
#a+b+c>1のときは必ずYes(追記:入力例3が優しい)
#a+b+c==1のときは操作が限定される
#a+b+c==0のときはNo
#a+b+c>=3のときは大きい方を-1、小さい方を+1の貪欲でいける
#a+b+c=2のときは何手か先まで読む
s=[input()for _ in range(n)]
if s[0]=="AC" and a==c==0:print("No");exit()
if s[0]=="BC" and b==c==0:print("No");exit()
if s[0]=="AB" and a==b==0:print("No");exit()
if (a+b+c)==0:print("No");exit()
if (a+b+c)==1:
  ans=[]
  for i in s:
    if i=="AB":
      if a==1:ans.append("B");a,b=0,1
      elif b==1:ans.append("A");a,b=1,0
      else:print("No");exit()
    elif i=="AC":
      if a==1:ans.append("C");a,c=0,1
      elif c==1:ans.append("A");a,c=1,0
      else:print("No");exit()
    else:
      if b==1:ans.append("C");b,c=0,1
      elif c==1:ans.append("B");b,c=1,0
      else:print("No");exit()
  print("Yes")
  for i in ans:print(i)
  exit()
if (a+b+c)>=3:
  print("Yes")
  for i in s:
    if i=="AB":
      if a>=b:print("B");a-=1;b+=1
      else:print("A");a+=1;b-=1
    elif i=="BC":
      if b>=c:print("C");c+=1;b-=1
      else:print("B");b+=1;c-=1
    else:
      if a>=c:print("C");c+=1;a-=1
      else:print("A");a+=1;c-=1
  exit()
#a+b+c=2
#何手まで読むか
#ダメな操作の例は？
#110AB,020AC
#つまりNoになるのはその直後
#1手先まで読めばいい
print("Yes")
for i in range(n-1):
  if s[i]=="AB":
    if a==b==1:
      if s[i+1]=="AC":print("A");a+=1;b-=1
      else:print("B");b+=1;a-=1
    else:
      if a>=b:print("B");a-=1;b+=1
      else:print("A");a+=1;b-=1
  if s[i]=="BC":
    if b==c==1:
      if s[i+1]=="AB":print("B");b+=1;c-=1
      else:print("C");c+=1;b-=1
    else:
      if b>=c:print("C");c+=1;b-=1
      else:print("B");b+=1;c-=1
  if s[i]=="AC":
    if a==c==1:
      if s[i+1]=="BC":print("C");c+=1;a-=1
      else:print("A");a+=1;c-=1
    else:
      if a>=c:print("C");c+=1;a-=1
      else:print("A");a+=1;c-=1
if s[-1]=="AB":
  if a>=b:print("B");a-=1;b+=1
  else:print("A");a+=1;b-=1
elif s[-1]=="BC":
  if b>=c:print("C");c+=1;b-=1
  else:print("B");b+=1;c-=1
else:
  if a>=c:print("C");c+=1;a-=1
  else:print("A");a+=1;c-=1

Measured memory_bytes: 16996
n=int(input())
a=list(map(int,input().split()))
d1={}
d2={}
r=len(a)
sum=0
maxs=0
maxs2=0
d1[maxs]=d2[maxs2]=0
for i in range(r):
    if i%2:
        if a[i] in d1:
            d1[a[i]]+=1
            if d1[a[i]]>d1[maxs]:
                maxs=a[i]
        else:
            d1[a[i]]=1
            sum+=1
            if d1[a[i]]>d1[maxs]:
                maxs=a[i]
    else:
        if a[i] in d2:
            d2[a[i]]+=1
            if d2[a[i]]>d2[maxs2]:
                maxs2=a[i]
        else:
            d2[a[i]]=1
            sum+=1
            if d2[a[i]]>d2[maxs2]:
                maxs2=a[i]
if maxs!=maxs2:
    print(n-d1[maxs]-d2[maxs2])
else:
    mmmm=0
    for i in d2:
        if i!=maxs2 and d2[i]>mmmm:
            mmmm=d2[i]
    mmm=0
    for i in d1:
        if i!=maxs and d1[i]>mmm:
            mmm=d1[i]
    print(min(n - d1[maxs] - mmmm,n-mmm-d2[maxs2]))

Measured memory_bytes: 59652
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int x = scanner.nextInt(), y = scanner.nextInt();
        System.out.println(Math.min(Math.abs(x + y) + 1, Math.abs(x - y) + (x < y ? 0 : 2)));
    }
}

Measured memory_bytes: 23380
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cassert>
#define SIZE 100005

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int main()
{
	ll K,A,B;
	scanf("%lld %lld %lld",&K,&A,&B);
	ll ret=1;
	if(A+2>=B)
	{
		ret+=K;
	}
	else
	{
		ll z=min(K,A-1);
		ret+=z;
		K-=z;
		ret+=(B-A)*(K/2);
		ret+=K%2;
	}
	printf("%lld\n",ret);
	return 0;
}


Measured memory_bytes: 128
def resolve():
    n=int(input())
    num=0
    ans=1
    l=list(range(1,n+1))
    for i in l:
        cnt=0
        while l[i-1]%2==0:
            l[i-1]=l[i-1]//2
            cnt+=1
        if cnt>num:
            num=cnt
            ans=i
    print(ans)

resolve()

Measured memory_bytes: 3064
//
// Created by kuroneko on 2019-07-06.
//

#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <iomanip>

typedef long long ll;
using namespace std;

int main() {
    int a, b, c, d, e; cin >> a >> b >> c >> d >> e;
    int k; cin >> k;

    if (e - a > k) cout << ":(" << endl;
    else cout << "Yay!" << endl;
    return 0;
}

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

#define ll long long
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))

const int N =100;

bool isprime(int n)
{
    if (n <= 1)
        return false;
    for (int i = 2; i*i<=n; i++)
        if (n % i == 0)
            return false;

    return true;
}
int binarySearch(int arr[], int l, int r, int x)
{
    if (r >= l) {
        int mid = l + (r - l) / 2;
        if (arr[mid] == x)
            return mid;
        if (arr[mid] > x)
            return binarySearch(arr, l, mid - 1, x);
        return binarySearch(arr, mid + 1, r, x);
    }
    return -1;
}
long long lcm(long long a,long long b)
{
    long long p,r;
    p = a*b;
    r = __gcd(a, b);
    return p/r;
}
bool ispalindrome(string s)
{
    int n = s.length();
    for(int i=0;i<n/2;i++)
    {
        if(s[i]!=s[n-i-1])
            return false;
    }
    return true;
}
bool isPerfectSquare(long double x)
{
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);

}
ll f(ll n) {
	return n * (n - 1) / 2;
}
bool cmp(const tuple<int, string, string>& a,
               const tuple<int, string, string>& b)
{
    return (get<0>(a) < get<0>(b));
}
void solve()
{
   ll x, k, d, n;
    cin >> x >> k >> d;
    if (x < 0) {x *= -1;}
 
    n = x / d;
    if (k >= n) {
        k -= n;
        x %= d;
    }
    else {
        x -= d * k;
        k = 0;
    }
    if (k % 2 == 1) {x = d - x;}
 
    cout << x << endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
}


Measured memory_bytes: 3664
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstring>
#include <math.h>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<int,int> P;
#define M 1000000007
#define F first
#define S second
#define PB push_back
char s[100005];
ll a,b,c,r=1,n;
int main(void){
    cin>>s;
    n=strlen(s);
    for(int i=0;i<n;i++){
        if(s[i]=='A')a=(a+r)%M;
        else if(s[i]=='B')b=(b+a)%M;
        else if(s[i]=='C')c=(c+b)%M;
        else{
            c=(c*3+b)%M;
            b=(b*3+a)%M;
            a=(a*3+r)%M;
            r=r*3%M;
        }
    }
    cout<<c<<endl;
}


Measured memory_bytes: 384
import sys
import math

def IL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def main():
	a, b, h, m = IL()
	h_angle = (h + m / 60) / 12 * 2 * math.pi
	m_angle = m / 60 * 2 * math.pi
	angle = abs(h_angle - m_angle)
	l = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(angle))
	# print(h_angle, m_angle, angle)
	print(l)

if __name__ == "__main__":
	main()

Measured memory_bytes: 9504
require 'prime'

def _divisors(primes, k)
  Enumerator.new do |y|
    if primes.size == k
      y << 1
    else
      p, e = primes[k]
      _divisors(primes, k + 1).each {|d|
        (e + 1).times {|e1|
          y << p ** e1 * d
        }
      }
    end
  end
end

def divisors(n)
  _divisors(Prime.prime_division(n), 0).to_a.sort
end

# def divisors(n)
#   n.prime_division.inject([1]) do |ary, (p, e)|
#     (0..e).map{ |e1| p ** e1 }.product(ary).map{ |a, b| a * b }
#   end.sort
# end

n, m = gets.split.map(&:to_i)
puts m / divisors(m).bsearch { |i| i >= n }


Measured memory_bytes: 3964
import java.io.*;
import java.util.*;
public class Main
{
	
	private void solve()throws IOException
	{
		int n=nextInt();
		HashSet<Integer> set=new HashSet<>();
		for(int i=1;i<=n;i++)
			set.add(nextInt());
		int d=set.size();
		out.println(d-(n-d)%2);
	}

	 
	///////////////////////////////////////////////////////////

	public void run()throws IOException
	{
		br=new BufferedReader(new InputStreamReader(System.in));
		st=null;
		out=new PrintWriter(System.out);

		solve();
		
		br.close();
		out.close();
	}
	public static void main(String args[])throws IOException{
		new Main().run();
	}
	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	String nextToken()throws IOException{
		while(st==null || !st.hasMoreTokens())
		st=new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	String nextLine()throws IOException{
		return br.readLine();
	}
	int nextInt()throws IOException{
		return Integer.parseInt(nextToken());
	}
	long nextLong()throws IOException{
		return Long.parseLong(nextToken());
	}
	double nextDouble()throws IOException{
		return Double.parseDouble(nextToken());
	}
}

Measured memory_bytes: 43424
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <queue>
#include <tuple>
#include <set>
#include <map>

using namespace std;

int main(void) {
    int N;
    cin >> N;

    for(int n=1; n<=N; n++) {
        int ans = 0;
        for(int x=1; x*x<=N; x++) {
            for(int y=1; y*y<=N; y++) {
                for(int z=1; z*z<=N; z++) {
                    if(x*x+y*y+z*z+x*y+y*z+z*x > n) {
                        break;
                    } else if(x*x+y*y+z*z+x*y+y*z+z*x == n) {
                        ++ans;
                    }
                }
            }
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define optimize ios_base::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0) ;
#define ll long long
#define ld long double
#define lint __int128
#define vi vector<int>
#define pb push_back
#define lp(i,a,b) for(int i = a ; i <= b ; i ++)
#define rlp(i,a,b) for(int i = b ; i >= a ; i --)
#define a_sort(v) sort(v.begin(), v.end())
#define d_sort(v) sort(v.rbegin(), v.rend())
#define pii pair<int,int>
#define pi 3.14159265358979323846264338327950
using namespace std ;
// #define debug

const int MOD = 1E9 + 7 ;
const int N = 1E5 ;

int main() {
    #ifdef debug
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif // debug
    optimize

    int a , b , c , k ; cin >> a >> b >> c >> k ;
    if(k <= a) cout << k << endl ;
    else if(k <= a + b) cout << a << endl ;
    else cout << a - (k - a - b) << endl ;
}


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

const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;

typedef long long ll;

ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }

ll LCM(ll x, ll y)
{
    return x * y / GCD(x, y);
}

int main()
{
    int N;
    cin >> N;
    string P, Q;
    rep(i, N)
    {
        char p;
        cin >> p;
        P += p;
    }
    rep(i, N)
    {
        char q;
        cin >> q;
        Q += q;
    }

    string R;
    for (int i = 1; i <= N; i++) {
        R += to_string(i);
    }
    int a, b;
    int cnt = 0;
    do {
        if (R == P) {
            a = cnt;
        }
        if (R == Q) {
            b = cnt;
        }
        cnt++;
    } while (next_permutation(R.begin(), R.end()));

    cout << abs(a - b) << endl;
}


Measured memory_bytes: 256
// @ts-ignore
import * as fs from 'fs';

// メイン
function main(input: string[]) {
    var work0: number[] = input.shift().split(" ").map(x => Number(x));
    var n: number = work0[0];
    var m: number = work0[1];
    var node: number[][] = input.map(x => x.split(" ").map(x => Number(x) - 1));
    g_uf_root = new Array(n).fill(-1);
    g_uf_count = new Array(n).fill(1);
    node.forEach(value => {
        var a: number = value[0];
        var b: number = value[1];
        UF_mergeRoot(a, b);
    });
    console.log(Math_max(g_uf_count));
}

// math
function Math_max(arr: number[]) {
    return arr.reduce(function (x, y) {
        return Math.max(x, y);
    });
}

// union-find
var g_uf_root: number[];
var g_uf_count: number[];
function UF_getRoot(index: number) {
    if (g_uf_root[index] < 0) {
        return index;
    } else {
        var work0: number = UF_getRoot(g_uf_root[index]);
        g_uf_root[index] = work0;
        return work0
    }
}
function UF_mergeRoot(a: number, b: number) {
    var root0: number = UF_getRoot(a);
    var root1: number = UF_getRoot(b);
if (root0 == root1) return;
    if (root0 > root1) [root0, root1] = [root1, root0];
    g_uf_count[root0] += g_uf_count[root1];
    g_uf_count[root1] = 0;
    g_uf_root[root1] = root0;
}

// エントリポイント
// - OSによるパラメタの処理の違いを吸収
function entrypoint() {
    try {
        var input = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        console.debug = function () { };
        main(input);
    }
    catch (ex) {
        console.log("----");
        console.log("file='%s'", __filename.split("\\").slice(-1)[0]);
        console.log("----");
        const lines: string[] = [];
        // @ts-ignore
        const reader = require('readline').createInterface({
            // @ts-ignore
            input: process.stdin,
            // @ts-ignore
            output: process.stdout
        });
        reader.on('line', function (line: string) {
            lines.push(line);
        });
        reader.on('close', function () {
            input = lines;
            console.log("input=%o", input);
            console.time();
            console.log("----")
            main(input);
            console.log("----")
            console.timeEnd();
        });
    }
}
entrypoint();


Measured memory_bytes: 87652
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#include<random>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

ll gcd(ll n, ll m) {
	ll tmp;
	while (m!=0) {
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m) {
	return abs(n * m) / gcd(n, m);//gl=xy
}
 
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;
}
 
using namespace std;

//ここから

void solve(){
  int n,m;
  cin>>n>>m;
  vector<string>a(n),b(m);
  rep(i,n)cin>>a[i];
  rep(i,m)cin>>b[i];
  rep(i,n-m+1){
    rep(j,n-m+1){
      bool ng=false;
      rep(k,m){
        rep(l,m){
          if(a[i+k][j+l]!=b[k][l])ng=true;
        }
      }
      if(!ng){
        cout<<"Yes";
        return;
      }
    }
  }
  cout<<"No";
}

int main(){
	ios::sync_with_stdio(false);
  cin.tie(0);
	cout<<fixed<<setprecision(15);
  solve();
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef vector<pii> VP;
typedef vector<string> VS;
typedef priority_queue<int> PQ;
template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//priority_queue<int,vector<int>, greater<int> > q2;

int modpow(int a, int p) {
	if (p == 0) return 1;
	if (p % 2 == 0) {

		int halfP = p / 2;
		int half = modpow(a, halfP);

		return half * half % mod;
	}
	else {

		return a * modpow(a, p - 1) % mod;
	}
}



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

	int K, N; cin >> N >> K;

	int ans = 0;

	VI memo(K + 1, 0);

	for (int i = K; i > 0; i--) {
		int a = modpow(K / i, N);

		int j = 1;
		while (j*i<=K) {
			a -= memo[j*i];
			a = (a + mod) % mod;
			j++;
		}


		int cnt = a * i%mod;
		memo[i] = a;
		ans = (ans + cnt) % mod;;
	}

	

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



Measured memory_bytes: 3984
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	
	public static void main(String[] args) throws IOException {
		try(final Scanner sc = new Scanner(System.in)){
			final int N = sc.nextInt();
			final int K = sc.nextInt();
			
			System.out.println((N - K + 1));
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}

Measured memory_bytes: 22612
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE TypeApplications #-}
module Main (main) where

import Control.Monad
import qualified Data.ByteString.Char8 as C8
import qualified Data.Char as C
import qualified Data.IntSet as Set
import qualified Data.List as L
import System.Random

main :: IO ()
main = do
  [d] <- readInts
  scoreTable <- readInts
  replicateM d readInts >>= output d . solve
 
solve :: [[Int]] -> _
solve xs = xs
 
output :: Int -> _ -> IO ()
output d _ = mapM_ (print . (+1) . flip mod 26) $ take d fib'

-- utils
readInts :: IO [Int]
readInts = L.unfoldr (C8.readInt . C8.dropWhile C.isSpace) <$> C8.getLine

-- リストのhead側を正格評価する版
zipWith' :: (a -> b -> c) -> [a] -> [b] -> [c]
zipWith' f (x:xs) (y:ys) = let z = f x y
                           in z `seq` (z : zipWith' f xs ys)

-- zipWithを使った版（正格評価）
fib' :: [Int]
fib' = 0 : 1 : zipWith' (+) fib' (tail fib')

-- pi_ :: [Integer]
-- pi_ = g(1,0,1,1,3,3) where
--   g (q,r,t,k,n,l) =
--    if 4*q+r-t < n*t
--     then n : g (10*q, 10*(r-n*t), t, k, div (10*(3*q+r)) t - 10*n, l)
--     else g (q*k, (2*q+r)*l, t*l, k+1, div (q*(7*k+2)+r*l) (t*l), l+2)
 
-- digs = insertPoint digs'
--   where insertPoint (x:xs) = x:'.':xs
--         digs' = map (head . show) pi_

Measured memory_bytes: 4312
#include<iostream>
#include<string>
#include<cmath>
#include<cstdlib>
#include<vector>
#include<map>
#include<set>
#include<algorithm>

using namespace std;

int main(){
  int a,b;
  cin>>a>>b;
  int ret = 1000*1000*2;
  ret = max(a+b,max(a-b,a*b));
  cout<<ret<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define Rep(n) for (ll _ = 0; _ < (ll)(n); _++)

template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
ll min(int a,ll b){return min((ll)a,b);} ll min(ll a,int b){return min(a,(ll)b);}
template <class S> void print(vector<S> &v){for(ll i=0; i<(ll)v.size(); i++){cerr << v[i] << ' ';}cerr << endl;}
template <class S> void print(vector<vector<S>> &v) {for (ll i = 0; i < (ll)v.size(); i++) {for (ll j = 0; j < (ll)v[i].size(); j++) {cerr << v[i][j] << ' ';}cerr << endl;}}

int main(){
	int n,k; cin >> n >> k;
	vector<int> p(n), c(n);
	rep(i,n){ 
		cin >> p[i];
		p[i]--;
	}
	rep(i,n) cin >> c[i];
	if(k <= n){
		ll ans = -10000000000;
		ll s = 0;
		int h;
		rep(start, n){
			s = 0;
			h = start;
			Rep(k){
				h = p[h];
				s += (ll)c[h];
				ans = max(ans, s);
			}
		}
		cout << ans << endl;
	}else{
		ll ans = -10000000000;
		ll s = 0;
		int h;
		rep(start, n){
			s = 0;
			h = start;
			ll m = -10000000000;
			int move = 0;
			while(1){
				move++;
				h = p[h];
				s += (ll)c[h];
				m = max(m, s);
				if(h == start) break;
			}
			if(s <= 0){
				ans = max(m, ans);
			}else{
				ll sure = k / move - 1;
				int kk = k - sure * move;
				s *= sure;
				h = start;
				Rep(kk){
					h = p[h];
					s += (ll)c[h];
					ans = max(ans, s);
				}
			}
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 3692
#include<bits/stdc++.h>
#define int long long
#define rep(i,a,b) for(int i=a;i<b;i+=1)
#define vi vector<int>
using namespace std;
bool helper(string str){ 
    
    int l = 0; 
    int h = str.length() - 1; 
    while (h > l) 
    { 
        if (str[l++] != str[h--]) 
        { 
            return false;
        } 
    } 
    return true; 
}

int32_t main(void){
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);

	string s;
	cin>>s;
	int len = s.length();
	string s1 = s.substr(0, (len-1)/2);
	string s2 = s.substr((len+3)/2-1, len);
	bool ans1 = helper(s);
	bool ans2 = helper(s1);
	bool ans3 = helper(s2);
	
	if(ans1 && ans2 && ans3) cout<<"Yes";
	else cout<<"No";
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        String b = a.substring(a.length()-1, a.length());
        switch(b) {
        case "2":
        case "4":
        case "5":
        case "7":
        case "9":
            System.out.println("hon");
            break;
        case "0":
        case "1":
        case "6":
        case "8":
            System.out.println("pon");
            break;
        case "3":
            System.out.println("bon");
            break;
        default:
            break;
        }
    }
}

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

using namespace std;

int main() {
    long long int N, M = 0, H;
    cin >> N;
    
    long long int last = 0, row = 0;
    cin >> last;
    for (int i = 0; i < N - 1; i++)
    {
        cin >> H;
        if (H <= last)
        {
            row++;
        } else {
            if (row > M) {
                M = row;
            }
            row = 0;
        }

        if (i == N - 2)
        {
            if (row > M) {
                M = row;
            }
        }
        
        last = H;
    }

    cout << M;
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)

// functions
template <class T> T ceil(T a, T b) {
    return (a + b - 1) / b;
}
template <class T> T round(T a, T b) {
    return (a + b / 2) / b;
}
template <class T> T gcd(T a, T b) {
    return b ? gcd(b, a % b) : a;
}
template <class T> T lcm(T a, T b) {
    return a * b / gcd(a, b);
}
template <class T> bool amax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

// main
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll X, Y;
    cin >> X >> Y;
    int res = 0;
    while (X <= Y) {
        res++;
        X *= 2;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	char str;
	int n[3]={},ans=0;
	while(cin>>str){
		if(str=='J'&&n[1]==0&&n[2]==0)n[0]++;
		else if(str=='O'&&n[1]<n[0]&&n[2]==0)n[1]++;
		else if(str=='I'&&n[2]<n[1]&&n[0]!=0){if((n[2]+=1)==n[1])ans=max(ans,n[1]);}
		else{
			for(int i=0;i<3;i++)n[i]=0;
			if(str=='J')n[0]=1;
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 1144
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1LL << 60;
const int MAX = 1000000010;
const ll MOD = 1000000007;

int main() {
    int N; cin >> N;
    map<ll, int> m;
    for (int i = 0; i < N; i++) {
        ll a; scanf("%lld", &a);
        m[a * (-1)]++;
    }

    ll ans = 0;
    bool flag = false;
    for (auto p : m) {
        ll a = p.first * (-1);
        int num = p.second;
        if (flag) {
            if (num > 1) {
                ans *= a;
                break;
            }
        } else {
            if (num > 1) {
                if (num > 3) {
                    ans = a * a;
                    break;
                }
                ans = a;
                flag = true;
            }
        }
    }

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

Measured memory_bytes: 6528
/**
 *  author: MOOONI
 *  hackers are welcome!
**/
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;
typedef pair<ll, str> pllstr;
typedef pair<str, ll> pstrll;
typedef pair<str, str> pstr;
typedef pair<db, db> pdb;

typedef vector<ll> vll;
typedef vector<db> vdb;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vstr;
typedef vector<vector<ll>> vvll;
typedef vector<vector<string>> vvstr;
typedef vector<vector<db>> vvdb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<pll>> vvpll;
typedef vector<vector<pllstr>> vvpllstr;
typedef vector<vector<pstrll>> vvpstrll;
typedef vector<vector<pstr>> vvpstr;
typedef vector<vector<pdb>> vvpdb;
typedef map<ll, ll> mll;
typedef map<ll, str> mllstr;
typedef map<str, ll> mstrll;
typedef map<str, str> mstr;
typedef map<double, double> md;

#define ff first
#define ss second
#define sz(x) (int) x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define rsz resize
#define ins insert
#define fr front 
#define bc back
#define pf push_front
#define pb push_back
#define eb emplace back
#define lb lower_bound
#define ub upper_bound

#define FOR(i, a, b) for (int i = a; i <= b; i++) 
#define ROF(i, a, b) for (int i = b; i >= a; i--)
#define trav(a, x) for (auto &a : x)
#define pcount __builtin_popcount
#define ctz __builtin_ctz
#define clz __builtin_clz
#define gcd __gcd

mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

#define ts to_string
str ts(const str &s) { return '"' + s + '"'; }
str ts(const char *s) { return ts((str) s); }
str ts(bool b) { return (b ? "true" : "false"); }
str ts(vb v) {
  bool sep = false;
  str res = "";
  res += '{';
  FOR (i, 0, sz(v) - 1) {
    if (sep) { res += ", "; }
    res += ts(v[i]);
    sep = true;
  }
  res += '}';
  return res;
}
template <size_t N> 
str ts(bitset<N> v) {
  str res = "";
  FOR(i, 0, N - 1) {
    res += (char) ('0' + v[i]);
  }
  return res;
}

template <typename A> 
str ts(A v) {
  bool sep = false;
  str res = "";
  res += '{';
  trav(x, v) {
    if (sep) { res += ", "; }
    res += ts(x);
    sep = true;
  }
  res += '}';
  return res;
}

template <typename A, typename B> 
str ts(pair<A, B> p) { return "(" + ts(p.ff) + ", " + ts(p.ss) + ")"; }
template <typename A, typename B, typename C>
str ts(tuple<A, B, C> p) {
  return "(" + ts(get<0>(p)) + ", " + ts(get<1>(p)) + ", " + ts(get<2>(p)) + ")";
}

void dbg() { cerr << endl; }
template <typename H, typename... T> 
void dbg(H h, T... t) { cerr << " " << ts(h); dbg(t...); }

#ifdef LOCAL
#define DBG(...) cerr << "[" << #__VA_ARGS__ << "]:", dbg(__VA_ARGS__)
#else
#define debug(...) 42
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll a, b;
  cin >> a >> b;
  if (b >= a) {
    cout << "unsafe" << '\n';
    return (0);
  }
  cout << "safe" << '\n';
  return 0;
}

Measured memory_bytes: 3652
#include<stdio.h>

int main(){
    int a,b,c;
    scanf("%d %d %d", &a, &b, &c);
    
    int ans = 0;
    
    for (a;a<=b; a++){
        if (c%a == 0){
            ans++;
        }
    }
    
    printf("%d\n", ans);
}


Measured memory_bytes: 2104
#include <iostream>

#define Nmax int(1e5 + 1)
using namespace std;

char S[Nmax];
long long nr_B,nr_R,i;

int main() {
    cin >> S;
    for(i = 0; S[i]; ++i)
        if(S[i] == '1')
            nr_B++;
        else
            nr_R++;
    cout << 2 * min(nr_B,nr_R);
    return 0;
}


Measured memory_bytes: 384
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>

int main(void){

    int n, *hs;
    long *costs;
    scanf("%d\n", &n);

    const int k = 2;

    hs = malloc(n * sizeof(int));
    costs = malloc(n * sizeof(long));

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

        while(isspace(c)) c = getchar();
        int val = 0;
        for(; c >= '0'; c = getchar()) val = val * 10 + c - '0';
        hs[i] = val;
    }

    costs[0] = 0;
    int lim = k < n ? k : n;
    for(int i = 1; i < lim; ++i){

        int hi = hs[i];
        long min = LONG_MAX;
        for(int j = 0; j < i; ++j){

            int testing = costs[j] + abs(hi - hs[j]);
            if(testing < min) min = testing;
        }
        costs[i] = min;
    }

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

        int hi = hs[i];
        long min = LONG_MAX;
        for(int j = i - k; j < i; ++j){

            int testing = costs[j] + abs(hi - hs[j]);
            if(testing < min) min = testing;
        }
        costs[i] = min;
    }

    printf("%li", costs[n - 1]);
}

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

using namespace std;

int main(){
  int N, Q;
  cin >> N >> Q;
  string S;
  cin >> S;
  vector<vector<int>> lr(Q,vector<int>(2));
  for(int i=0;i<Q;++i){
    cin >> lr[i][0] >> lr[i][1];
  }
  
  vector<int> sum(N+1);
  sum[0] = 0;
  for(int i=1;i<=N;++i){
    if(i==N){
      sum[i] = sum[i-1];
    }
    else if(S[i-1]=='A' && S[i]=='C'){
      sum[i] = sum[i-1] + 1;
    }else{
      sum[i] = sum[i-1];
    }
  }

  for(int i=0;i<Q;++i){
    cout << sum[lr[i][1]-1] -sum[lr[i][0]-1] << endl;
  }
}

Measured memory_bytes: 6784
#include <stdio.h>
int main(void){
    // Your code here!
    int n;
    int a[100];
    
    double ans=0;
    
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        ans+=1.0/(double)a[i];
    }
    
    printf("%f\n",1.0/ans);
}


Measured memory_bytes: 128
#include <iostream>
#include <stdio.h>
#include <strings.h>
#include <cstring>
#include <algorithm>
#include <cmath>

using namespace std;
 
int main(){
    double a,b,c;
    double S,h,L;
    double PI = acos(-1);
    scanf("%lf %lf %lf",&a,&b,&c);
    double C = c * PI / 180;
    h = b * sin(C);
    S = a * h / 2;
    L = a + b + sqrt(a*a + b*b - 2*a*b*cos(C));
    printf("%.8lf\n",S);
    printf("%.8lf\n",L);
    printf("%.8lf\n",h);
    return 0;
}


Measured memory_bytes: 3372
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
//using namespace __gnu_pbds;

#define LL       long long
#define DS       pair<LL, LL>
#define READ(f)  freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)

const int N = 3e5 + 5;
const int MOD = 1e9 + 7;
const double PI = 2 * acos(0.0);
//template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int main() {
    //ios::sync_with_stdio(false);
    //cin.tie(0);
    int a[3][3];
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            scanf("%d", &a[i][j]);
        }
    }
    int n;
    scanf("%d", &n);
    map<int, int> mop;
    for (int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        mop[x] = 1;
    }
    for (int i = 0; i < 3; i++) {
        int cnt = 0;
        for (int j = 0; j < 3; j++) {
            if (mop[a[i][j]]) cnt++;
        }
        if (cnt == 3) {
            puts("Yes");
            return 0;
        }
    }
    for (int i = 0; i < 3; i++) {
        int cnt = 0;
        for (int j = 0; j < 3; j++) {
            if (mop[a[j][i]]) cnt++;
        }
        if (cnt == 3) {
            puts("Yes");
            return 0;
        }
    }
    int cnt = 0;
    for (int i = 0, j = 2; i < 3; i++, j--) {
        if (mop[a[i][j]]) cnt++;
    }
    if (cnt == 3) {
        puts("Yes");
        return 0;
    }
    cnt = 0;
    for (int i = 0, j = 0; i < 3; i++, j++) {
        if (mop[a[i][j]]) cnt++;
    }
    puts(cnt == 3 ? "Yes" : "No");
    return 0;
}


Measured memory_bytes: 256