akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long int
#define MOD(x) ((x % MOD_N) + MOD_N) % MOD_N
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define RFORE(i,a,b) for(int i=(b);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define RALL(c) (c).rbegin(),(c).rend()
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SZ(c) (int)((c).size())
#define EACH(i,v) for(auto i=v.begin();i!=v.end();++i)
#define REACH(i,v) for(auto i=v.rbegin();i!=v.rend();++i)
#define LB(c,x) distance((c).begin(),lower_bound(ALL(c),x))
#define UB(c,x) distance((c).begin(),upper_bound(ALL(c),x))
#define COUNT(c,x) (lower_bound(ALL(c),x)-upper_bound(ALL(c),x))
#define UNIQUE(c) SORT(c); (c).erase(unique(ALL(c)),(c).end());
#define COPY(c1,c2) copy(ALL(c1),(c2).begin())
#define EXIST(s,e) (bool)((s).find(e)!=(s).end())
#define PB push_back
#define MP make_pair
#define DUMP(x)  cerr<<#x<<" = "<<(x)<<endl;
#define NL cerr<<endl;
using namespace std;
template<typename T,typename U> using P=pair<T,U>;
template<typename T> using V=vector<T>;
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>T sum(vector<T>&v){return accumulate(ALL(v),T());}
template<typename T>T sum(vector<T>&v,int a,int b){return accumulate(v.begin()+a,v.begin()+b,T());}
template<typename T>T max(vector<T>&v){return *max_element(ALL(v));}
template<typename T>T min(vector<T>&v){return *max_element(ALL(v));}
template<typename T>T max_index(vector<T>&v){return distance((v).begin(),max_element(ALL(v)));}
template<typename T>T min_index(vector<T>&v){return distance((v).begin(),min_element(ALL(v)));}

struct edge { int to, cost; };

template<typename T>auto&operator<<(ostream&s,const vector<T>&v){s<<"[";bool a=1;for(auto e:v){s<<(a?"":" ")<<e;a=0;}s<<"]";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const pair<T,U>&p){s<<"("<<p.first<<","<<p.second<<")";return s;}
template<typename T>auto&operator<<(ostream&s,const set<T>&st){s<<"{";bool a=1;for(auto e:st){s<<(a?"":" ")<<e;a=0;}s<<"}";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const map<T,U>&m){s<<"{";bool a=1;for(auto e:m){s<<(a?"":" ")<<e.first<<":"<<e.second;a=0;}s<<"}";return s;}

const int INF = 1e18;
const int MOD_N = 1e9+7;

signed main()
{
   int N, W; cin >> N >> W;
   V<int> v(N), w(N), m(N);
   REP(i, N) {
      cin >> v[i] >> w[i] >> m[i];
   }
   V<int> dp(W+1);
   REP(i, N) {
      int num = m[i];
      for (int k = 1; num > 0; k *= 2) {
         int n = min(num, k);
         RREP(j, W) if (j + w[i] * n <= W) {
            chmax(dp[j + w[i] * n], dp[j] + v[i] * n);
         }
         num -= n;
      }
   }
   cout << dp[W] << endl;

   return 0;
}



Measured memory_bytes: 3148
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int MOD = 1e9+7;

typedef pair<ll, ll> pairs;
typedef vector<pairs> p;

struct edge{
    ll to, cost;
};


ll gcd(ll a,ll b){
    if(b == 0){
        return a;
    }else{
        return gcd(b, a%b);
    }
}

ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

// 素数
vector<bool> IsPrime;
void sieve(size_t max){
    if(max+1 > IsPrime.size()){
        IsPrime.resize(max+1,true);
    } 
    IsPrime[0] = false;
    IsPrime[1] = false;

    for(size_t i=2; i*i<=max; ++i){
        if(IsPrime[i]){
            for(size_t j=2; i*j<=max; ++j){
                IsPrime[i*j] = false;
            }
        }
    }
}

// べき乗の余り
ll modpow(ll a, ll n){
    ll res = 1;
    while(n){
        if(n & 1){
            res = res * a % MOD;
        }
        a = a * a % MOD;
        n = n >> 1;
    }
    return res;
}

// コンビネーション
ll MAXN = 2e5+10;
vector<ll> inv(MAXN);
ll nCk(ll n, ll k) {
	ll res = 1;
	for(ll i = 1; i <= k; i++) {
		res = res*(n-i+1) % MOD;
	}
 
	for(ll i = 1; i <= k; i++) {
		res = res*inv[i] % MOD;
	}
	return res;
}

// 回文
bool kai(string S){
    bool flag = true;
    for(ll i=0;i<S.size()/2;++i){
        if(S[i] != S[S.size()-i-1]){
            flag = false;
            break;
        }
    }
    return flag;
}
// ---------------------------------------------

int main(){
    ll n, a, b;
    cin>>n>>a>>b;
    vector<ll> x(n);
    for(ll i=0;i<n;++i){
        cin>>x[i];
    }

    ll ans = 0;
    for(ll i=1;i<n;++i){
        ans += min((x[i] - x[i-1]) * a, b);
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 5556
def get_greatest_common_divisor(n1, n2) :
    # euclidean_algorithm
    if (n2 == 0) :
        return n1
    return get_greatest_common_divisor(n2, n1 % n2)


N, X = [int(i) for i in input().split()]
locations = [int(i) for i in input().split()]

n2 = abs(locations[0] - X)
for i in range(len(locations),1,-1) :
    n1 = abs(locations[i-1] - X)
    n2 = get_greatest_common_divisor(n1,n2)

print(n2)
# locationsの最大公約数が分かればいいはず。

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

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)


def S():
    return input().rstrip()


def I():
    return int(input())


def MI():
    return map(int, input().split())


s = S()
n = int(s[-1])
l = [2, 4, 5, 7, 9]

if n in l:
    print("hon")
elif n == 3:
    print("bon")
else:
    print("pon")


Measured memory_bytes: 9140
#define _GLIBCXX_DEBUG

#include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>

#include <cmath>

#define int long long

using namespace std;

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

  vector<int> v(n);

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

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

  double ans = v[0];

  for (int i = 1; i < n; i++) {
    ans += v[i];
    ans /= 2;
  }

  printf("%.15f\n", ans);

  return 0;
}


Measured memory_bytes: 256
def main():
    a, b, c = map(int, input().split())
    if min(a, b, c) == a and max(a, b, c) == b:
        return 'Yes'
    if min(a, b, c) == b and max(a, b, c) == a:
        return 'Yes'
    return 'No'
print(main())

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

#define str(a) to_string(a)
#define int long long
#define pb push_back
#define mp make_pair
#define SORT(c) sort(c.begin(),c.end())
#define max_heap priority_queue<int>
#define min_heap priority_queue< int,vector<int>, greater<int> >
#define mod 1000000007
#define setbits(x) __builtin_popcount(x)
#define ps(x,y) fixed<<setprecision(y)<<x
#define start(t) int x;cin>>x;while(x--)
#define inf LLONG_MAX
#define sync ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl "\n"
#define MOD 998244353

int gcd(int a, int b) {
	if (b == 0)
		return a;
	return gcd(b, a % b);
}







int32_t main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n;
	cin >> n;
	set<string> a;
	while (n--) {
		string st;
		cin >> st;
		a.insert(st);
	}
	cout << a.size() << endl;

}












Measured memory_bytes: 19196
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(vecto) vecto.begin(),vecto.end()
typedef long long ll;

int main(){
    vector<int> vec(3);
    rep(i, 3) cin >> vec.at(i);
    sort(all(vec));
    cout << vec.at(2) - vec.at(0) << endl;
}

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

int main(){
  int n;
  while(cin>>n&&n){
    int ans=0;
    for(int i=0;i<((n*(n-1))/2);++i){
      int tmp; cin>>tmp;
      ans+=tmp;
    }
    cout<<ans/(n-1)<<endl;
  }

  return EXIT_SUCCESS;
}

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

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const ll MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

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

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

  ll n, k, s; cin >> n >> k >> s;
  vll ans;
  if(s == INF) {
    for(int i=0;i<k;++i) {
      ans.push_back(s);
    }
    for(int i=0;i<n-k;++i) {
      ans.push_back(s-1);
    }
  } else {
    
    for(int i=0;i<k;++i) {
      ans.push_back(s);
    }
    for(int i=0;i<n-k;++i) {
      ans.push_back(s+1);
    }
  }
  printv(ans);

}


Measured memory_bytes: 2292
from collections import Counter

S = input()
counter = Counter(S)
if len(counter) == 1:
    k = list(counter.keys())[0]
    if counter[k] > 1:
        print('NO')
    else:
        print('YES')
elif len(counter) == 2:
    # a, b → OK
    # a, a, b, b → NG
    for k in counter.keys():
        if counter[k] != 1:
            print('NO')
            exit()
    print('YES')
else:
    # abcabcb → bacbacb OK
    # abbccc → cabc これのどこにcを追加してもNG
    # abcba → abcab OK
    # aabc → abca OK
    min_v = 10 ** 5
    max_v = 0
    for k in counter.keys():
        min_v = min(min_v, counter[k])
        max_v = max(max_v, counter[k])
    if max_v - min_v > 1:
        print('NO')
    else:
        print('YES')


Measured memory_bytes: 73632
#include <iostream>
#include <algorithm>
#include <deque>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
#include <string>
#include <iostream>
using namespace std;
int main() {
	int a,b,c;
	cin >> a >> b;
	c = a * (a - 1) / 2 + b * (b - 1) / 2;
	cout << c << endl;
	return 0;
}

  

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

int main(){
    ll n; cin>>n;
    ll dp[n+1];
    memset(dp,0,sizeof(dp));
    dp[0] = 1;
    for(int sum=1;sum<=n;++sum){
        for(int coins=3;coins<=sum;++coins){
            dp[sum] = dp[sum] + dp[sum-coins];
            dp[sum] = dp[sum]%mod;
        }
    }
    cout<<dp[n];
}

Measured memory_bytes: 3624
#include <iostream>
#include <string>
#include <vector>
#include <cstring>
using namespace std;

const int MX = 1000001;
bool hamming[MX];
int ac[MX];

int main() {
    memset(hamming, 0, sizeof hamming);
    hamming[1] = true;
    ac[0] = 0;
    for (int i=1; i<MX; ++i) {
        if (hamming[i]) {
            if (i*2<MX) hamming[i*2] = true;
            if (i*3<MX) hamming[i*3] = true;
            if (i*5<MX) hamming[i*5] = true;
        }
        ac[i] = ac[i-1] + hamming[i];
    }
    int m, n;
    while (cin >> m, m) {
        cin >> n;
        cout << ac[n] - ac[m-1] << endl;
    }
    return 0;
}

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

int main() {
	char a[4];
	cin >> a[0] >> a[1] >> a[2] >> a[3];
	
	int cnt=0;
	
	for(int i=0;i<4;i++){
		if(a[i]=='+') cnt++;
		else if(a[i]=='-') cnt--;
	}
	
	cout << cnt << endl;
	
	return 0;
}

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

int w,h,ans = 0;
int mas[100][100];
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};

void dfs(int x,int y,int sum){
  for(int i=0;i<4;i++){
    int nx = x + dx[i];
    int ny = y + dy[i];
    if(nx >= 0 && nx < w && ny >= 0 && ny < h && mas[ny][nx]){
      mas[ny][nx] = 0;
      dfs(nx,ny,sum+1);
      mas[ny][nx] = 1;
    }
  }
  ans = max(ans,sum);
}

int main(){
  while(cin >> w >> h,w||h){
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++) cin >> mas[i][j];
    }
    ans = 0;
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
	if(mas[i][j]) dfs(j,i,0);
      }
    }
    cout << ans << endl;
  }
}

Measured memory_bytes: 1196
def examA():
    N = I()
    ans = ((N+1)//2)/N
    print(ans)
    return

def examB():
    N, K = LI()
    H = [I()for _ in range(N)]
    H.sort()
    ans = inf
    for i in range(N-K+1):
        cur = H[i+K-1]-H[i]
        if ans>cur:
            ans = cur
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(readline())
def LI(): return list(map(int,readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examB()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Measured memory_bytes: 8320
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())

using namespace std;
using ll = long long;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
constexpr int INF = 1001001001;
constexpr long long INFL = (1LL<<60);
constexpr double eps = (1e-9);

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

  string s, t;
  cin >> s >> t;

  int ans = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != t[i]) ans++;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3796
def main():
    # 1回の操作で引き出す可能性のある金額リスト
    cash = [1]
    n = int(input())
    # nを超えない範囲で6,9の累乗を追加する
    for i in range(1, n):
        if 6 ** i > n:
            break
        cash.append(6 ** i)
    for i in range(1, n):
        if 9 ** i > n:
            break
        cash.append(9 ** i)
    cash.sort()
    # ans[i]: i円ちょうど引き出すのに必要な操作の最小回数
    ans = [float('inf')] * (n + 1)
    ans[0] = 0
    for i in range(1, n + 1):
        for j in cash:
            if i - j < 0:
                break
            else:
                ans[i] = min(ans[i], ans[i - j] + 1)
    print(ans[n])


if __name__ == "__main__":
    main()

Measured memory_bytes: 3828
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
 
n = ini()
ans = 0
count = 100
while count < n:
    count += count // 100
    ans += 1
print(ans)

Measured memory_bytes: 9192
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstring>
#include <fstream>
#include <functional>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#define ll long long int
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(x, a) for (auto &(x) : (a))
#define ALL(a) (a).begin(), (a).end()
#define OUT(x) out << (x) << endl;
#define M0(x) memset(x, 0, sizeof(x))
#define MINF(x) memset(x, 0x3f, sizeof(x))
#define MMINUS(a) memset(a, 0xff, sizeof(a))
#define ten(n) ((int)1e##n)

const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
const double EPS = 1.0 / INF;
const char ENDL = '\n'; // for JetBrains IDE only supports yen

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

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

using namespace std;

//===================================== template =========================================================

int N, A, B, C;
vector<int> L;

int main()
{
    string S; cin >> S;
    string s = "Sunny";
    string c = "Cloudy";
    string r = "Rainy";
    if (S == s) cout << c << endl;
    if (S == c) cout << r << endl;
    if (S == r) cout << s << endl;
}


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

int n, ba;
int num[10];
string str;

int main(){
	while(cin >> n, n){
		for(int i = 0; i < 10; i++) num[i] = 0;
		ba = 0;
		cin >> str;
		for(int i = 0; i < 100; i++){
			if(str[i] == 'M'){
				num[i%n]++;
			} else if(str[i] == 'L'){
				num[i%n] += ba+1;
				ba = 0;
			} else{
				ba += num[i%n]+1;
				num[i%n] = 0;
			}
		}
		sort(num,num+n);
		for(int i = 0; i < n; i++) cout << num[i] << " ";
		cout << ba << endl;
	}
}

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

typedef long long ll;

int main() {
    int x, ans;
    rep(i, 5) {
        cin >> x;
        if (x == 0) ans = i + 1;
    }
    cout << ans << "\n";
}

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


int main() {
	
	int h, w;
	cin >> h >> w;
	vector<vector<char>> s (h+2,vector<char>(w+2,'0'));
	for (int i=1; i<=h; i++){
		string t;
		cin >> t;
		for (int j=1; j<=w; j++){
			s.at(i).at(j) = t.at(j-1);
		}
	}
	
	for (int i=1; i<=h; i++){
		for (int j=1; j<=w; j++){
			
			if(s.at(i).at(j)=='.'){
				int mine = 0;
				if(s.at(i-1).at(j-1)=='#') mine++;
				if(s.at(i-1).at(j)=='#') mine++;
				if(s.at(i-1).at(j+1)=='#') mine++;
				if(s.at(i).at(j-1)=='#') mine++;
				if(s.at(i).at(j+1)=='#') mine++;
				if(s.at(i+1).at(j-1)=='#') mine++;
				if(s.at(i+1).at(j)=='#') mine++;
				if(s.at(i+1).at(j+1)=='#') mine++;
				cout << mine;
			}
			else cout << '#';
			if(j==w) cout << endl;
			
		}
	}
	
	return 0;
}

Measured memory_bytes: 256
n = int(input())
A = [x for x in input().split()]
B = A.copy()
for i in range(n):
    for j in range(i+1,n)[::-1]:
        if A[j][1] < A[j-1][1]:
            A[j],A[j-1] = A[j-1],A[j]

print(*A)
print("Stable")

for i in range(n):
    minj = i
    for j in range(i,n):
        if B[j][1] < B[minj][1]:
            minj = j
    if minj != i:
        B[i],B[minj] = B[minj],B[i]
    
print(*B)

if A == B:
    print("Stable")
else:
    print("Not stable")


Measured memory_bytes: 5612
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Text;

public class Program
{
    public void Proc() {
        Reader.IsDebug = false;
        long[] inpt = Reader.ReadLine().Split(' ').Select(a=>long.Parse(a)).ToArray();

        this.MatiCount = (int)inpt[0];
        this.CostA = (ulong)inpt[1];
        this.CostB = (ulong)inpt[2];

        this.Zahyo = Reader.ReadLine().Split(' ').Select(a=>ulong.Parse(a)).ToArray();

        ulong ans = 0;

        for(int i=0; i<Zahyo.Length-1; i++) {
            ulong kyori = (ulong)(this.Zahyo[i+1] - this.Zahyo[i]);
            if(kyori * CostA > CostB) {
                ans+=CostB;
            } else {
                ans+=CostA*kyori;
            }
        }
        Console.WriteLine(ans);
        
        

    }


    private int MatiCount;
    private ulong CostA;
    private ulong CostB;

    private ulong[] Zahyo;


    public class Reader {
        public static bool IsDebug = true;
        private static System.IO.StringReader SReader;
        private static string InitText = @"


7 1 2
24 35 40 68 72 99 103

";
        public static string ReadLine() {
            if(IsDebug) {
                if(SReader == null) {
                    SReader = new System.IO.StringReader(InitText.Trim());
                }
                return SReader.ReadLine();
            } else {
                return Console.ReadLine();
            }
        }
    }
    public static void Main(string[] args)
    {
        Program prg = new Program();
        prg.Proc();
    }
}


Measured memory_bytes: 14552
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#define _USE_MATH_DEFINES
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = { 0, -1, 1, 0 };
const ll dy[4] = { -1, 0, 0, 1 };
const int INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
void mul(ll a, ll b) {
	a = a * b % INF;
}
double mysqrt(double x) {
	double l = 0, r = x;
	for (int i = 0; i < 64; ++i) {
		double m = (l + r) / 2.0;
		if (m*m < x)l = m;
		else r = m;
	}
	return l;
}
///////////////////////////////////////


ll N, M;
vector<ll> G[100010];
ll d[100010][3];
int main() {
	cin >> N >> M;
	REP(i, M) {
		int u, v; cin >> u >> v;
		u--, v--;
		G[u].push_back(v);
	}
	ll S, T; cin >> S >> T;
	S--; T--;
	memset(d, -1, sizeof(d));
	d[S][0] = 0;
	queue<pii>que;
	que.push({ S,0});
	while (!que.empty()) {
		int v = que.front().first;
		int c = que.front().second;
		que.pop();
		for (auto nv : G[v]) {
			int np = (c + 1) % 3;
			if (d[nv][np] == -1) {
				d[nv][np] = d[v][c] + 1;
				que.push({ nv,np });
			}
		}
	}
	if (d[T][0] == -1)cout << -1 << endl;
	else cout << d[T][0] / 3 << endl;
	return 0;
}

Measured memory_bytes: 8064
#include<stdio.h>
#include<math.h>
#define N 100
#define INF 2147483647

int n,a[N][N],d[N],p[N],used[N];

int init(){
  for(int i=0;i<n;i++){
    d[i]=INF;
    p[i]=-1;
    used[i]=0;
  }
  d[0]=0;
}

void prim(){
  int min,u,i,sum=0;
  while(1){
        min=INF;
        u=-1;
        for(i=0;i<n;i++){
            if(!used[i] && d[i]<min){
                min=d[i];
                u=i;
            }
        }
        if(min==INF) break;
        
        used[u]=1;
        sum+=d[u];
        
        for(int v=0;v<n;v++){
            if(!used[v] && a[u][v]!=-1){
                if(a[u][v]<d[v]){
                    d[v]=a[u][v];
                    p[v]=u;
                }
            }
        }
    }
    printf("%d\n",sum);
}

int main(){
  int i,j;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
        scanf("%d",&a[i][j]);
        //printf("%d ",a[i][j]);
    }
    //printf("\n");
  }
  
  init();
  prim();
  
  return 0;
}



Measured memory_bytes: 2056
#include <bits/stdc++.h>
using namespace std;
string N;
int main(){
  cin >> N ;
  if(N.at(0) == N.at(1) && N.at(1) == N.at(2) ){
    puts("Yes");
  }
  else if( N.at(1) == N.at(2) && N.at(2) == N.at(3)){
    puts("Yes");
  }
  else {
    puts("No");
  }
}

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

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,v) for(auto &(itr):(v))
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())

typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

// k個まで持てる 速度は普段はuで食べるとt秒間v ゴールはl
// 基本拾ったら/効果が切れたらすぐ食ってk個持ってる状態で拾うなら拾う直前に食う
// 持ってる個数がm、ブーストの残り時間がb
int n, k, t, u, v, l, d, m;
double b, s;
bool g[10010];

signed main() {
	cin >> n >> k >> t >> u >> v >> l;
	rep(i,n) {
		cin >> d;
		g[d] = 1;
	}
	repst(i,1,l) {
		if (!deq(b,0) && b>0) {
			b -= 1./v;
			s += 1./v;
		} else {
			if (m) m--, b = t-1./v, s += 1./v;
			else s += 1./u;
		}
		if (g[i]) {
			if (deq(b,0) || m==k) b = t;
			else m++;
		}
	}
	printf("%.14lf\n",s);
}


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

#define FOR(i, m, n) for(int (i) = (m); (i) < (n); (i)++)
#define FORN(i, m, n) for(int (i) = (m); (i) <= (n); (i)++)
#define FORR(i, m, n) for(int (i) = (m); (i) >= (n); (i)--)
#define rep(i, n) FOR(i, 0, n)
#define repn(i, n) FORN(i, 1, n)
#define repr(i, n) FORR(i, n, 0)
#define repnr(i, n) FORR(i, n, 1)
#define co(n) cout << (n) << endl
#define cosp(n) cout << (n) << ' '
#define setp(n) cout << fixed << setprecision(n);
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> Vec;

const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const double PI = acos(-1);
const double EPS = 1e-9;

int main(void){
	int n;
	cin >> n;
	vector<int> x(n);
	vector<int> y(n);
	rep(i, n) cin >> x[i] >> y[i];

	double dist = 0;
	rep(i, n-1){
		FOR(j, i+1, n){
			dist += sqrt((double)(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
		}
	}

	dist *= 2;
	dist /= n;

	setp(10);
	co(dist);
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
// const int INF = (1 << 30) - 1;
// const ll LL_INF = (1LL << 62) - 1;
const ll MOD = 1e9 + 7;

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

const int MAX = 200001;

// fac[n]: n!
// finv[n]: (n!)^-1
// inv[n]: nの逆元
ll fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void comb_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;
  }
}

ll mod(ll val) {
  ll res = val % MOD;
  if (res < 0)
    res += MOD;
  return res;
}

ll nCr(ll n, ll r) {
  ll ret = 1;
  for (ll i = 1; i <= r; i++) {
    ret = mod(ret * (n - i + 1));
    ret = mod(ret * inv[i]);
  }
  return ret;
}

ll n, a, b;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> a >> b;
  comb_init();

  ll ans = mod(power(2, n) - 1);
  ans = mod(ans - nCr(n, a));
  ans = mod(ans - nCr(n, b));

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


Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

int N;
int L[MAX_N], R[MAX_N];
int A[MAX_N];

void solve() {
	cin >> N;
	rep(i, 0, N) {
		cin >> A[i];
	}
	rep(i, 0, N) {
		L[i + 1] = max(L[i], A[i]);
	}
	rer(i, N, 0) {
		R[i] = max(R[i + 1], A[i]);
	}
	rep(i, 0, N) {
		cout << max(L[i], R[i + 1]) << "\n";
	}
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif	
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}



Measured memory_bytes: 5120
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main(){
	int n, k; cin >> n >> k;
	string s; cin >> s;
	int count[100100]={0}, p=0;
	if(s[0]=='0') p++;
	count[p]++;
	for(int i=1; i<s.length(); i++){
		if(s[i-1] == s[i]) count[p]++;
		else count[++p]++;
	}
	int ans=0;
	for(int i=0; i<=p; i+=2){
		int tmp=0;
		for(int j=0; j<k*2+1 && i+j<=p; j++){
			tmp+=count[i+j];
		}
		ans = max(ans, tmp);
	}

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

Measured memory_bytes: 896
import math
a,b,c = map(int, input().split())
c=math.radians(c)

S = (a*b*math.sin(c))/2
L =a+b+ (a*a +b*b - (2*a*b*math.cos(c)))**0.5
h =b*math.sin(c)

print(S)
print(L)
print(h)


Measured memory_bytes: 5716
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
using namespace std;
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define All(v) (v).begin(),(v).end()
using ll = long long;
const ll mod = 1000000007;
const ll INF = 100000000000000000LL;
int main(){
    string s;
    cin >> s;
    int l = 100000000, r = 0;
    rep(i,s.length()){
        if(s[i]=='A')
            l = min(l, i);
        if(s[i]=='Z')
            r = max(r, i);
    }
    cout << r - l + 1 << endl;
}

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

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

    int N;
    cin >> N;
    vector<int> a(N + 1), ans(N + 1, 0), res;
    rep(i, N) { cin >> a[i + 1]; }
    for (int i = N; i >= 1; i--) {
        int cnt = 0;
        for (int j = 2 * i; j <= N; j += i) {
            if (ans[j] == 0)
                continue;
            else
                cnt++;
        }

        if (a[i] != cnt % 2) {
            ans[i] = 1;
            res.push_back(i);
        }
    }

    cout << res.size() << endl;
    rep(i, res.size()) { cout << res[i] << " "; }
}

Measured memory_bytes: 5412
#include <bits/stdc++.h>
#define REP(i, a, n) for (int i = (a); i < (int)(n); ++i)
#define REPC(i, a, n) for (int i = (a); i <= (int)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define MATINIT(type, row, col, init)                                          \
  vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout << (cond ? "Yes" : "No") << endl;
#define YES(cond) cout << (cond ? "YES" : "NO") << endl;
using namespace std;
using LL = long long;
using ULL = unsigned long long;
template <class T> using VEC = std::vector<T>;
template <class T> using MAT = std::vector<std::vector<T>>;
void DUMP() { cerr << endl; }
template <class Head, class... Tail> void DUMP(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  DUMP(std::move(tail)...);
}
template <typename T> ostream &operator<<(ostream &os, vector<T> &vec) {
  os << "{";
  for (auto v : vec)
    os << v << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, map<T1, T2> &m) {
  os << "{";
  for (auto p : m)
    os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
  os << "[" << p.first << " " << p.second << "]";
  return os;
}

int main() {
 int x,y,z;
 cin>>x>>y>>z;
 x-=2*z;
 int a = x/(y+z);
 int b = x%(y+z);
 
 int ans = a+(b>=y?1:0);
 DUMP(x,y,z,a,b,ans);
 cout<<ans<<endl;

  return 0;
}


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

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

  string s;
  bool f = false;
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == "Y") {
      f = true;
      break;
    }
  }
  if (f) {
    cout << "Four" << endl;
  } else {
    cout << "Three" << endl;
  }
}

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

bool MAP[12][12];
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};

void sink_one_island(int x, int y) {
  if (x < 0 or 11 < x or y < 0 or 11 < y or !MAP[x][y])
    return;

  MAP[x][y] = false;
  for (int i = 0; i < 4; i++)
    sink_one_island(x + dx[i], y + dy[i]);
}

int sink_all_islands() {
  int islands = 0;

  for (int x = 0; x < 12; x++) {
    for (int y = 0; y < 12; y++) {
      if (MAP[x][y]) {
        sink_one_island(x, y);
        islands++;
      }
    }
  }

  return islands;
}

int main() {
  string s;
  while (cin >> s) {
    if (s.empty()) continue;

    for (int x = 0; x < 12; x++)
      MAP[x][0] = (s[x] == '1')? true:false;

    for (int y = 1; y < 12; y++) {
      cin >> s;
      for (int x = 0; x < 12; x++)
        MAP[x][y] = (s[x] == '1')? true:false;
    }

    int ids = sink_all_islands();

    cout << ids << endl;
  }
}

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

typedef long long ll;

int main() {
	ios::sync_with_stdio(0);
	
	int a, b, c;
	cin >> a >> b >> c;
	if ((a*100 + b*10 + c) % 4) {cout << "NO";} else {cout << "YES";}

	return 0;
}

Measured memory_bytes: 256
#include <cstdio>

int main(int argc, char const *argv[])
{
	int n,b,f,r,v;
	int m[4][3][10] = {0};

	scanf("%d\n",&n);
	for(int i = 0; i < n ; i ++){
		scanf("%d %d %d %d\n",&b,&f,&r,&v);
		m[b-1][f-1][r-1] += v;
	}

	for(int i = 0; i < 4;i++){
		for(int j = 0;j < 3;j++){
			for(int k = 0; k < 10; k++){
				printf(" %d",m[i][j][k]);
			}
			putchar('\n');
		}
		if(i<3)printf("####################\n");
	}

	return 0;
}


Measured memory_bytes: 2672
#include <bits/stdc++.h>
    using namespace std;
    #define uint unsigned int
    #define ull  unsigned long long
    typedef string str;
    typedef long long ll;
    typedef pair<int, int> pii;
    typedef vector<int> vi;
    typedef vector<bool> vb;
    #define pb push_back
    #define fi first
    #define se second
    #define ins insert
    #define all(x) (x).begin(), (x).end()
    #define fr(i, n) for(int i = 0; i < n; i++)
    #define rall(x) (x).rbegin(), (x).rend()
    #define speed() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
    const int INF = 1e9 + 5;


    void solve(){
        int n;
        cin >> n;
        vi v(n);
        int sum = 0;
        for(int  i = 0; i < n; ++i){
            cin >> v[i];
            sum += v[i];
        }
        int avg = sum/n;
        int ans = 0;
        for(int i = 0; i < n; ++i){
            ans += ((avg-v[i])*(avg-v[i]));
        }
        int tmp = 0;
        for(int i = 0; i < n; ++i){
            tmp += (((avg+1)-v[i])*((avg+1)-v[i]));
        }
        ans = min(ans, tmp);
        cout << ans;
    }


    int main(){
        speed();
        int t = 1;
        //cin >> t;
        while(t--)solve();
    }

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;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 9999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main(){

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

  int ans = INF+1;

  while(1){
      int minNum = INF;
  int minId = -1;

  REP(i,n){
    if(a[i]<minNum && a[i]!=0){
      minNum = a[i];
      minId = i;
    }
  }

  REP(i,n){
    if(i!=minId){
      a[i] = a[i] % minNum;
    }
  }

  if(minNum!=ans){
    ans = minNum;
  }else{
    break;
  }

  }

cout<<ans<<endl;




  return 0;
}

Measured memory_bytes: 640
import java.util.*;
import java.io.*;

public class Main {
	
	public void change(int[] d){
		if( d[0] == -1 ){
			d[0] = 0;
			d[1] = 1;
		} else if( d[0] == 0 ){
			if( d[1] == 1 ){
				d[0] = 1;
				d[1] = 0;
			} else {
				d[0] = -1;
				d[1] = 0;
			}
		} else {
			d[0] = 0;
			d[1] = -1;
		}
	}
	public void solve() throws IOException{
		boolean flag = false;
		int n = nextInt();
		for(int i = 0; i < n; i++){
			if( flag ){
				writer.println();
			}
			flag = true;
			int length = nextInt();
			if( length == 1 ){
				writer.println('#');
				continue;
			}
			char[][] ans = new char[length+2][length+2];
			for(int j = 0; j < ans.length; j++){
				for(int k = 0; k < ans.length; k++){
					ans[j][k] = ' ';
				}
			}
			int[] point = new int[2];
			point[0] = length; point[1] = 1;
			int[] dir = new int[2];
			dir[0] = -1; dir[1] = 0;
			int count = 1;
			int repeat = 30;
			while(true){
				if( point[0]+dir[0] > length || point[0]+dir[0] < 1 || point[1]+dir[1] > length || point[1]+dir[1] < 1 ){
					change(dir);
					count = 0;
					if( ans[point[0]+2*dir[0]][point[1]+2*dir[1]] == '#' ){
						ans[point[0]][point[1]] = '#';
						break;
					}
					continue;
				}
				int x = point[0]+dir[0];
				int y = point[1]+dir[1];
				if( ans[x][y] == '#' ){
					if( count < 3 ){
						break;
					}
					point[0] -= dir[0];
					point[1] -= dir[1];
					count = 0;
					change(dir);
					if( ans[point[0]+2*dir[0]][point[1]+2*dir[1]] == '#' ){
						break;
					}
				}
				ans[point[0]][point[1]] = '#';
				point[0] += dir[0];
				point[1] += dir[1];
				count++;
			}
			for(int j = 1; j <= length; j++){
				for(int k = 1; k <= length; k++){
					writer.print(ans[j][k]);
				}
				writer.println();
			}			
		}
		writer.flush();
	}			
	public static void main (String args[]) throws IOException{
		new Main().run();
	}
	
	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;
	
	public void run() throws IOException{
		try{
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (Exception e){
			e.printStackTrace();
			System.exit(1);
		}
	}
	public int nextInt() throws IOException{
		return Integer.parseInt(nextToken());
	}		
	public String nextToken() throws IOException{
		while( tokenizer == null || !tokenizer.hasMoreTokens() ){
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}
}

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

int A[SIZE];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++) scanf("%d",&A[i]);
	ll now=1000;
	for(int i=0;i+1<n;i++)
	{
		if(A[i]<A[i+1])
		{
			ll c=now/A[i];
			now+=c*(A[i+1]-A[i]);
		}
	}
	printf("%lld\n",now);
}

Measured memory_bytes: 3812
n,m = map(int, input().split())
a = [input() for _ in range(m)]

x = 10 ** (n - 1)
if n == 1: x = 0
ans = [-1]

while x < 10 ** n:
    s = str(x)
    if all(s[int(ai[0]) - 1] == ai[2] for ai in a):
        ans.append(x)
        break
    x += 1

print(ans[-1])

Measured memory_bytes: 3064
#include<stdio.h>
int main()
{
    int a,b,c;
    scanf("%d %d %d", &a, &b, &c);
    if(a>=1&&a<=13&&b>=1&&b<=13&&c>=1&&c<=13)
    {if(a+b+c>=22)
    printf("bust");
    else printf("win");}
    return 0;
}


Measured memory_bytes: 128
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        k: usize,
        mut v: [(usize, usize); n]
    }
    v.sort_by_key(|x| x.0);
    let mut s = 0;
    let mut idx = 0;
    while s < k && idx < n - 1 {
        s += v[idx].1;
        idx += 1;
    }
    if s < k {
        println!("{}", v[idx].0);
    } else {
        println!("{}", v[idx - 1].0);
    }
}


Measured memory_bytes: 6396
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse = True)
    return divisors
  
n, m = list(map(int, input().split()))
div = make_divisors(m)
for i in div:
  if m / i >= n:
    print(i)
    quit()

    

Measured memory_bytes: 3188
import numpy as np
last=[0]*26
D=int(input())
c=list(map(int, (input().split(' '))))
s=[]
a=[0]*D
b=[0]*D
comsat=[0]*D
comlast=[0]*26
comday=0
sat=0

for i in range(D):
    s.append(list(map(int, (input().split(' ')))))
    a[i]=s[i].index(max(s[i])) + 1
    last[a[i]-1] = i+1
    comsat[i] = s[i][a[i]-1] - np.dot(c, list(map(lambda x: i+1-x, last)))
for i in range(D):
    for k in range(26):
        for j in range(26):
            last[j]=comlast[j]
        last[k] = i+1
        sat = comsat[i-1] + s[i][k] - np.dot(c, list(map(lambda x: i+1-x, last)))
        if sat > comsat[i]:
            comday = k
            comsat[i] = sat
            a[i] = k+1
    comlast[comday] = i+1
for j in range(D):
    print(a[j])

Measured memory_bytes: 27476
n=int(input())
a = [0]*20
x=[[0 for i in range(20)]for j in range(20)]
y=[[0 for i in range(20)]for j in range(20)]

for i in range(n):
	a[i]=int(input())
	for j in range(a[i]):
		x[i][j], y[i][j] = map(int,input().split())
		x[i][j]-=1

ans=0
for bits in range(1<<n):
	isok=True
	for i in range(n):
		if (bits>>i)&1 == 0:
			continue
		for j in range(a[i]):
			if y[i][j]^((bits>>x[i][j])&1):
				isok=False
	if isok:
		tmp=bits
		an=0
		while(tmp):
			if tmp&1:
				an+=1
			tmp//=2
		ans = max(ans,an)
print(ans)

Measured memory_bytes: 42732
#include <bits/stdc++.h> 
using namespace std; 
  
// Function to traverse the DAG 
// and apply Dynamic Programming 
// to find the longest path 
void dfs(int node, vector<int> adj[], int dp[], bool vis[]) 
{ 
    // Mark as visited 
    vis[node] = true; 
  
    // Traverse for all its children 
    for (int i = 0; i < adj[node].size(); i++) { 
  
        // If not visited 
        if (!vis[adj[node][i]]) 
            dfs(adj[node][i], adj, dp, vis); 
  
        // Store the max of the paths 
        dp[node] = max(dp[node], 1 + dp[adj[node][i]]); 
    } 
} 
  
// Function to add an edge 
void addEdge(vector<int> adj[], int u, int v) 
{ 
    adj[u].push_back(v); 
} 
  
// Function that returns the longest path 
int findLongestPath(vector<int> adj[], int n) 
{ 
    // Dp array 
    int dp[n + 1]; 
    memset(dp, 0, sizeof dp); 
  
    // Visited array to know if the node 
    // has been visited previously or not 
    bool vis[n + 1]; 
    memset(vis, false, sizeof vis); 
  
    // Call DFS for every unvisited vertex 
    for (int i = 1; i <= n; i++) { 
        if (!vis[i]) 
            dfs(i, adj, dp, vis); 
    } 
  
    int ans = 0; 
  
    // Traverse and find the maximum of all dp[i] 
    for (int i = 1; i <= n; i++) { 
        ans = max(ans, dp[i]); 
    } 
    return ans; 
}
int main()
{
	int n,m,x,y;
	cin>>n>>m;
	vector <int> adj[n+1];
	for (int i=0;i<m;i++)
	{
		cin>>x>>y;
		addEdge(adj,x,y);
	}
	cout<<findLongestPath(adj,n);
	return 0;
}

Measured memory_bytes: 9600
#include<bits/stdc++.h>
using namespace std;
const int N=3000;
double a[N],dp[N][N];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%lf",&a[i]);
	dp[1][1]=a[1];
	dp[1][0]=1-a[1];
	for(int i=2;i<=n;i++)
	{
		for(int j=0;j<=i;j++)
		{
			if(j==0)
				dp[i][j]=dp[i-1][j]*(1-a[i]);
			else
				dp[i][j]=dp[i-1][j]*(1-a[i])+dp[i-1][j-1]*a[i];
		}
	}
	double sum=0;
	for(int i=(n+1)/2;i<=n;i++)
		sum+=dp[n][i];
	printf("%.10lf\n",sum);
	return 0;
}


Measured memory_bytes: 68864
(defun digitSums (n)
  (do ((Sn 0) (/10 n))
      ((= /10 0) Sn)
    (setf Sn (+ Sn (mod /10 10)))
    (setf /10 (floor /10 10))))

(defvar a (read))
(defvar b (digitSums a))
(if (= 0 (mod a b)) 
    (format t "Yes~%")
    (format t "No~%"))

Measured memory_bytes: 12772