akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Tasks
{
    public class C
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var N = Scanner.Scan<long>();
            var answer = 0L;

            for (var a = 1; a <= N; a++)
            {
                var maxb = N / a;
                for (var b = 1; b <= maxb; b++)
                {
                    var c = N - a * b;
                    if (c == 0) continue;
                    answer++;
                }
            }
            Console.WriteLine(answer);
        }

        public static class Scanner
        {
            private static Queue<string> queue = new Queue<string>();
            public static T Next<T>()
            {
                if (!queue.Any()) foreach (var item in Console.ReadLine().Trim().Split(" ")) queue.Enqueue(item);
                return (T)Convert.ChangeType(queue.Dequeue(), typeof(T));
            }
            public static T Scan<T>() => Next<T>();
            public static (T1, T2) Scan<T1, T2>() => (Next<T1>(), Next<T2>());
            public static (T1, T2, T3) Scan<T1, T2, T3>() => (Next<T1>(), Next<T2>(), Next<T3>());
            public static (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>());
            public static (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>(), Next<T5>());
            public static IEnumerable<T> ScanEnumerable<T>() => Console.ReadLine().Trim().Split(" ").Select(x => (T)Convert.ChangeType(x, typeof(T)));
        }
    }
}


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

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

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

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

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

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

  int N;
  cin >> N;
  map<int, int> mp;
  int a;
  rep(i, N){
    cin >> a;
    mp[a]++;
  } 

  int cnt_eve = 0;
  int cnt_odd = 0;

  for(auto itr = mp.begin(); itr != mp.end(); itr++){

    int cnt = itr->second;
    if(cnt % 2 == 0){
      cnt_eve++;
    }else{
      cnt_odd++;
    }
  }

  int ans = cnt_eve + cnt_odd;
  if(ans % 2 == 0){
    ans--;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 4992
#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++)
typedef long long ll;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << setprecision(20);
  
  int n;
  cin >> n;
  vector<ll> h(n);
  rep(i, n) { cin >> h[i]; }

  ll ans = 0;
  ll current = 0;
  rep(i, n-1) {
    if (h[i] >= h[i+1]) {
      current++;
    } else {
      current = 0;
    }
    ans = max(ans, current);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
// God put a smile upon your face <3

#include <bits/stdc++.h>

#define slld(longvalue) scanf("%lld", &longvalue)

#define ll long long
#define ull unsigned long long
#define pll pair < long long, long long >

#define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0)

#define pb push_back

#define bug printf("BUG\n")

#define mxlld LLONG_MAX
#define mnlld -LLONG_MAX

#define mxd 2e8
#define mnd -2e8

#define pi 3.14159265359

using namespace std;

bool check(ll n, ll pos)
{
	return n & (1LL << pos);
}

ll Set(ll n, ll pos)
{
	return n = n | (1LL << pos);
}

vector < ll > vec;

int main()
{
    ll i, j, k, l, m, n, o, r, q;
    ll testcase;
    ll input, flag, tag, ans;

//    freopen("input.txt", "r", stdin);

//    freopen("output.txt", "w", stdout);

    while(cin >> n)
    {
		vec.resize(n);

		for(ll i = 0; i < n; i++) cin >> vec[i];

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

		ans = 0;

		for(ll i = 0; i < n; i++)
			for(ll j = i + 1; j < n; j++)
				for(ll k = j + 1; k < n; k++)
				{
					if(vec[i] == vec[j] || vec[i] == vec[k] || vec[j] == vec[k]) continue;
					if(vec[i] + vec[j] > vec[k]) ans++;
				}

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


}






Measured memory_bytes: 3632
import java.util.Scanner;

class Main{
	static Scanner s=new Scanner(System.in);
	static int gInt(){return Integer.parseInt(s.next());}
	public static void main(String[]$){
		int n=gInt();
		int f=gInt(),a[]=new int[2];
		for(int i=0;i<n;++i)
			++a[gInt()%2];
		if(a[1]==0)
			System.out.println(f==0?(long)Math.pow(2,n):0);
		else
			System.out.println((long)Math.pow(2,n-1));
	}
}

Measured memory_bytes: 23636
//#pragma GCC optimize(3,"Ofast","inline")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 500;
const int mod = 1e8 + 7;
const double pi = acos(-1);
const int inf = 1e9;
const double eps = 1e-7;
int n,u,v;
int a[N],vis[N];
vector <int> vec[N];
vector <int> ans;
void dfs(int x, int p)
{
    vis[x] = 0;
    for (int i = 0; i < vec[x].size(); ++i)
    {
        int t = vec[x][i];
        if (t == p)
            continue;
        dfs(t, x);
        if (!vis[t] && a[x] > a[t])
            vis[x] = 1;
    }
}
int main()
{
//    freopen("in.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
//    ios::sync_with_stdio(false);
//    cin.tie(NULL);
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i)
        scanf("%d", a + i);
    for (int i = 1; i < n; ++i)
    {
        scanf("%d%d", &u, &v);
        vec[u].emplace_back(v);
        vec[v].emplace_back(u);
    }
    for (int i = 1; i <= n; ++i)
    {
        dfs(i, 0);
        if (vis[i])
            ans.emplace_back(i);
    }
    if (!ans.empty())
    {
        printf("%d", ans[0]);
        for (int i = 1; i < ans.size(); ++i)
            printf(" %d", ans[i]);
        puts("");   
    }
    return 0;
}

Measured memory_bytes: 2944
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iterator>
#include <numeric>
#include <bitset>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
	int N;
	cin >> N;
	vector<int> p(N);
	int max_price = 0, total = 0;
	for (int i = 0; i < N; i++) {
		cin >> p[i];
		if (max_price < p[i]) {
			max_price = p[i];
		}
		total += p[i];
	}

	cout << total - max_price / 2;

	return 0;
}

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


int main(){
    int ans = 1001, a, b;
    string s, t;
    cin >> s >> t;
    int sl = s.length(), tl = t.length();

    for ( int i = 0; i < sl - tl + 1; i++){
        a = 0;
        for (int j = 0; j < tl; j++){
            if(s.at(i + j) == t.at(j)) a++;
        }
        ans = min(ans, tl - a);
    }

    cout << ans << endl;

}

Measured memory_bytes: 3632
from collections import Counter
n = int(input())
v = list(map(int, input().split()))

odd = Counter([v[i] for i in range(1, n, 2)])
even = Counter([v[i] for i in range(0, n, 2)])

if odd.most_common()[0][0] != even.most_common()[0][0]:
    print(n - (odd.most_common()[0][1] + even.most_common()[0][1]))
else:
    if len(odd) >= 2 and len(even) >= 2:
        print(min(n - (odd.most_common()[0][1] + even.most_common()[1][1]), n - (odd.most_common()[1][1] + even.most_common()[0][1])))
    elif len(odd) >= 2:
        print(n - (odd.most_common()[1][1] + even.most_common()[0][1]))
    elif len(even) >= 2:
        print(n - (even.most_common()[1][1] + odd.most_common()[0][1]))
    else:
        print(n//2)

Measured memory_bytes: 18656
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define endl "\n"

const long long INF = (long long)1e18;
const long long MOD = 1'000'000'007; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}



signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int N, K;
	string s;
	int con = 0;
	
	cin>>N>>K;
	cin>>s;
	
	for(int i = 0; i < s.size(); i++){
		if(s[i] == 'L'){
			if(i == 0){
				
			} else {
				if(s[i-1] == 'L') con++;
			}
		} else {
			if(i != N-1){
				if(s[i+1] == 'R'){
					con++;
				}
			
			}
		}
	}
	
	cout<<min(con + 2*K, N-1)<<endl;
	
	return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define reg register
typedef long long ll;
using namespace std;
const int MN=1e5+5;
int n;
int main(){
	scanf("%d",&n);reg int flg=1;
	for(reg int i=3;flg&&i<=n;i+=2)
		if(n%i==0)flg=0;
	if(flg)return 0*puts("No");
	puts("Yes");
	puts("1 2");
	puts("1 3");
	printf("2 %d\n",n+3);
	printf("%d %d\n",n+3,n+1);
	printf("3 %d\n",n+2);
	for(reg int i=4;i+1<=n;i+=2){
		printf("1 %d\n",i);
		printf("1 %d\n",i+1);
		printf("%d %d\n",i,i+1+n);
		printf("%d %d\n",i+1,i+n);
	}
	if(~n&1){
		for(reg int i=2,j;i<=n;i++){
			if(i==3)continue;
			j=n^i^1;
			if(j!=3&&j<=n){
				printf("%d %d\n",i,n);
				printf("%d %d\n",j,n+n);
				break;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 2304
N=int(input())
li = list(map(int,input().split()))
cnt=0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if li[i]!=li[j] and li[i]!=li[k] and li[j]!=li[k]:
                q=[]
                q.append(li[i])
                q.append(li[j])
                q.append(li[k])
                q.sort(reverse=True)
                if q[0]<q[1]+q[2]:
                    cnt+=1
print(cnt)

Measured memory_bytes: 9208
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

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

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define shandom_ruffle random_shuffle

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy


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

    ll a[5];
    F0R(i,5) cin >> a[i];

    ll m = 0;
    ll sum =0;
    F0R(i,5){
      if(a[i]%10!=0){
        if(m < 10 - a[i]%10) m = 10 - a[i]%10;
        sum += a[i] + (10 - a[i]%10);
      } else
        sum += a[i];
    }

    cout << sum - m << endl;

    return 0;
}

// read the question correctly (ll vs int)
// template by super1 derived from bqi343


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

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x)  cerr << #x << " = " << x << endl
using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;

const ld PI = 3.14159265359;

const ll MOD = (ll) 998244353ll;
const ll MAXN = (ll) 5e2 + 10;
const ll INF = (ll) 2242545357980376863;
const ld EPS = (ld) 1e-8;

ll dp1[MAXN], dp2[MAXN];

ll solve(ll n, ll x){
	if(x == 0) return 0;
	if(x == dp1[n]) return dp2[n];
	if(n == 0) return x;
	if(1 + dp1[n - 1] >= x) return solve(n - 1, x - 1);
	return dp2[n - 1] + 1 + solve(n - 1, x - (dp1[n - 1] + 2));
}

int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	dp1[0] = 1;
	dp2[0] = 1;
	for(int i = 1; i < MAXN; i++){
		dp1[i] = 3 + 2 * dp1[i - 1];
		dp2[i] = 1 + 2 * dp2[i - 1];
	}
	ll n, x;
	cin >> n >> x;
	cout << solve(n, x);
	return 0;
}


/*

                                 ____              ,----..               ,----..
   ,---,                       ,'  , `.           /   /   \             /   /   \
  '  .' \                   ,-+-,.' _ |          /   .     :           /   .     :
 /  ;    '.              ,-+-. ;   , ||         .   /   ;.  \         .   /   ;.  \
:  :       \            ,--.'|'   |  ;|        .   ;   /  ` ;        .   ;   /  ` ;
:  |   /\   \          |   |  ,', |  ':        ;   |  ; \ ; |        ;   |  ; \ ; |
|  :  ' ;.   :         |   | /  | |  ||        |   :  | ; | '        |   :  | ; | '
|  |  ;/  \   \        '   | :  | :  |,        .   |  ' ' ' :        .   |  ' ' ' :
'  :  | \  \ ,'        ;   . |  ; |--'         '   ;  \; /  |        '   ;  \; /  |
|  |  '  '--'          |   : |  | ,             \   \  ',  /          \   \  ',  /
|  :  :                |   : '  |/               ;   :    /            ;   :    /
|  | ,'                ;   | |`-'                 \   \ .'              \   \ .'
`--''                  |   ;/                      `---`                 `---`
                       '---'

*/



Measured memory_bytes: 256
-- https://github.com/minoki/my-atcoder-solutions
import qualified Data.Vector.Unboxed as U
import qualified Data.ByteString.Char8 as BS

main = do
  n <- readLn
  xs <- U.replicateM n $ do
    Just (x, _) <- BS.readInt <$> BS.getLine
    return x
  let v = U.zipWith max (U.scanl' max 0 xs) (U.tail $ U.scanr' max 0 xs)
  U.forM_ v print


Measured memory_bytes: 6524
#include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
const int INF = 1e10;
const int MOD = 1e9 + 7;
#define dump(x)                             \
    if (dbg) {                              \
        cout << #x << " = " << (x) << endl; \
    }
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define P pair<int, int>
#define V vector<int>
#define S set<int>
#define itn int
bool dbg = false;
void solve() {
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (d == 1) {
        cout << 1 << endl;
    } else {
        cout << 0 << endl;
    }
    solve();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=(ll)1e9+7;
const ll INF=(ll)1e18+10;
const double PI=acos(-1);

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int dy[]={-1,1,0,0};
int dx[]={0,0,-1,1};


int main() {
    int a[3][3];
    bool hit[3][3]={0};
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            cin>>a[i][j];
        }
    }
    int N; cin>>N;
    vector<int> b(N);
    for(int i;i<N;++i){
        cin>>b[i];
    }
    sort(b.begin(),b.end());
    bool f= false;
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            if(binary_search(b.begin(),b.end(),a[i][j])) hit[i][j]= true;
        }
    }
    for (int i = 0; i < 3; ++i) {
        if(hit[i][0]&&hit[i][1]&&hit[i][2]) f= true;
        if(hit[0][i]&&hit[1][i]&&hit[2][i]) f= true;
    }
    if((hit[0][0]&&hit[1][1]&&hit[2][2])||(hit[0][2]&&hit[1][1]&&hit[2][0])) f= true;
    cout<<(f?"Yes":"No")<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <string>
#include <stack>

using namespace std;


set<int> Union(const set<int> &A,const set<int> &B){
	set<int> ret;
	for(set<int>::iterator it = A.begin(); it!=A.end(); it++){
		ret.insert(*it);
	}
	for(set<int>::iterator it=B.begin(); it!=B.end(); it++){
		ret.insert(*it);
	}
	return ret;
}

set<int> Intersection(const set<int> &A,const set<int> &B){
	set<int> ret;
	for(set<int>::iterator it=B.begin(); it!=B.end(); it++){
		if(A.find(*it)!=A.end())
			ret.insert(*it);
	}
	return ret;
}

set<int> Difference(const set<int> &A,const set<int> &B){
	set<int> ret;
	for(set<int>::iterator it=A.begin(); it!=A.end(); it++){
		if(B.find(*it)==B.end())
			ret.insert(*it);
	}
	return ret;
}

set<int> SymmetricDifference(const set<int> &A,const set<int> &B){
	return Union(Difference(A,B),Difference(B,A));
}

set<int> Complement(const set<int> &A,const set<int> &U){
	set<int> ret;
	for(set<int>::iterator it = U.begin(); it != U.end(); it++){
		if(A.find(*it)==A.end())
			ret.insert(*it);
	}
	return ret;
}

map<char,set<int> > sets;

set<int> analysis(string str){
	stack<int> s;
	if(str.size()==1){
		return sets[str[0]];
	}
	else if(str[0]=='('&&str[str.size()-1]==')'){
		bool f=false;
		for(int i = 0; i < str.size(); i++){
			if(str[i]=='('){
				s.push(1);
			}
			else if(str[i]==')'){
				s.pop();
			}
			if(i!=str.size()-1&&s.size()==0)
				f=true;
		}
		if(!f){
			return analysis(str.substr(1,str.size()-2));
		}
	}
	// ÊÉðÍ.ãë©ç©Ä¢«Astackª0ÌóÔÅZqð©Â¯½çAÄA·é.
	for(int i = str.size()-1; i >= 0; i--){
		if(str[i]==')'){
			s.push(1);
		}
		else if(str[i]=='('){
			s.pop();
		}
		else if(s.size()==0){
			if(str[i]=='u'){
				return Union(analysis(str.substr(0,i)),analysis(str.substr(i+1)));
			}
			else if(str[i]=='i'){
				return Intersection(analysis(str.substr(0,i)),analysis(str.substr(i+1)));
			}
			else if(str[i]=='d'){
				return Difference(analysis(str.substr(0,i)),analysis(str.substr(i+1)));
			}
			else if(str[i]=='s'){
				return SymmetricDifference(analysis(str.substr(0,i)),analysis(str.substr(i+1)));
			}
		}
	}
	if(str[0]=='c'){
		return Complement(analysis(str.substr(1)),sets['U']);
	}
}

int main(){


	while(1){
		sets.clear();
		for(char ch='A'; ch <= 'E'; ch++){
			sets[ch];
		}
		sets['U'];

		char ch;
		bool f=false;
		while(cin>>ch){
			if(ch=='R'){
				int t;
				cin>>t;
				f=true;
				break;
			}
			f=true;
			int n;
			cin>>n;
			for(int i = 0; i < n; i++){
				int t;
				cin>>t;
				sets[ch].insert(t);
				sets['U'].insert(t);
			}
		}
		if(!f)
			break;
		string str;
		cin>>str;
		set<int> s = analysis(str);
		if(s.size()==0)
			cout<<"NULL"<<endl;
		else{
			for(set<int>::iterator it = s.begin(); it!=s.end(); it++){
				cout<<*it;
				if(it==--(s.end())){
					cout<<endl;
				}
				else
					cout<<" ";
			}
		}
	}
		
	return 0;
}

Measured memory_bytes: 0
#include<iostream>


using namespace std;


int main(){
	int a[10][10];
	int d, i, j, k, temp,sum=0;

	while (1){
		cin >> d;
		if (d == 0){
			return 0;
		}

		for (i = 0, j = 0; i < d; i++){
			for (j = 0; j < d; j++){
				cin >> a[i][j];
			}
		}

		for (i = 0, j = 0; i < d; i++){
			for (j = 0; j < d; j++){
				cout.width(5);
				cout << a[i][j];
			}
			temp = 0;
			for (k = 0; k < d; k++){
				temp += a[i][k];
			}
			cout.width(5);
			cout << temp << endl;
			sum += temp;
		}
			
		

		for (j = 0; j < d; j++){
			temp = 0;
			for (k = 0; k < d; k++){
				temp += a[k][j];
			}
			cout.width(5);
			cout << temp;
			sum += temp;

		}



		cout.width(5);
		cout << sum/2 << endl;
		sum = 0;
	}
}

Measured memory_bytes: 1172
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
int main() {/*
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif */
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);  
    std::cout << std::fixed;
    std::cout << std::setprecision(10);
    ld t,k;
    cin>>t>>k;
    cout<<t/k;   
}

Measured memory_bytes: 256
using System;
class P
{
    public static void Main()
    {
        string[] str = Console.ReadLine().Split(' ');

            int a = int.Parse(str[0]);
            int b = int.Parse(str[1]);

            decimal ad = a;
            decimal bd = b;
            decimal d = ad / bd;

            Console.WriteLine(a / b + " " + a % b + " " + d.ToString("f12"));
        
    }
}


Measured memory_bytes: 17944
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var one = cin.ReadLine.Split(' ');
            var N = int.Parse(one[0]);
            var M = int.Parse(one[1]);
            var C = int.Parse(one[2]);

            var two = cin.ReadLine.Split(' ');
            List<int> B = new List<int>();
            for (int i = 0; i < M; i++)
            {
                B.Add(int.Parse(two[i]));
            }

            int result = 0;
            for (int i = 0; i < N; i++)
            {
                var temp = cin.ReadLine.Split(' ');
                int sum = 0;
                for (int j = 0; j < M; j++)
                {
                    sum += B[j] * int.Parse(temp[j]);
                }
                sum += C;
                if (sum > 0)
                {
                    result ++;
                }
            }


            Console.Write(result);
        }

    }
    public class deci
    {
        public bool IsFinish { get; set; } = false;
        public int Len { get; set; }
    }
    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}

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

int main() {
	int N, A, B, C, D;
	cin >> N >> A >> B >> C >> D;
	int X1 = (N + A - 1) / A;
	int X2 = (N + C - 1) / C;
	cout << min(X1 * B, X2 * D) << endl;
	return 0;
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
#include <iomanip>
#define M 1000001
#define MAX 1000000001
#define MIN -10000000000000000
#define mod 1000000007
#define ss second
#define ff first
#define ll long long int
#define pb push_back
#define ld double
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
using namespace std;

vector<int>primes;
ll gcd(ll a,ll b){
    if(a == 0 || b == 0)
        return (a+b);
    if(a < b)
        swap(a,b);
    return gcd(b,a%b);
}

void find_primes(){
    bool check[M] = {0};
    for(int i=2;i<M;i++){
        if(check[i] == false){
            primes.pb(i);
            for(int j=i+i;j<M;j+=i)
                check[i] = true;
        }
    }
}

int main(){
    int n;
    cin>>n;
    int fr[M] = {0};
    ll g = 0;
    for(int i=0;i<n;i++){
        ll temp;
        cin>>temp;
        fr[temp]++;
        g = gcd(g,temp);
    }
    if(g == 1){
        find_primes();
        bool pairwise = true;
        for(int i:primes){
            ll cnt = 1,current = i,count = 0;
            while(current < M){
                count += fr[current];
                if(count >= 2){
                    pairwise = false;
                    break;
                }
                current += i;
            }
            if(!pairwise)
                break;
        }
        if(pairwise)
            cout<<"pairwise coprime\n";
        else
        {
            cout<<"setwise coprime\n";
        }
        
    }
    else{
        cout<<"not coprime\n";
    }
    return 0;
        
}


Measured memory_bytes: 12248
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

int main()
{
	int K, X;
	cin >> K;
	cin >> X;
	for (int i = X-K+1; i < X+K; i++)
	{
		cout << i <<" ";
	}
	return 0;
}

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

signed main(void)
{
	int n;
	ll sum, ans;
	cin >> n;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	sort(a.rbegin(), a.rend());
	sum = 0;
	if (n % 2 == 1)
	{
		sum = a[n / 2] + a[n / 2 + 1];
		rep(i, n / 2)
			sum += 2 * a[i];
		for (int i = n / 2; i < n; i++)
			sum -= 2 * a[i];
		ans = sum;
		sum = a[n / 2 - 1] + a[n / 2];
		rep(i, n / 2 - 1)
			sum += 2 * a[i];
		for (int i = n / 2 + 1; i < n; i++)
			sum -= 2 * a[i];
		ans = max(sum, ans);
	}
	else
	{
		sum = a[n / 2 - 1] - a[n / 2];
		rep(i, n / 2 - 1)
			sum += 2 * a[i];
		for (int i = n / 2 + 1; i < n; i++)
			sum -= 2 * a[i];
		ans = sum;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3756
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>

using namespace std;

#define PB push_back

typedef long long LL;
typedef pair<int, int> P;
const int MAXN = 1e5 + 5;

int n, m, k;
int pa[MAXN], dep[MAXN], siz[MAXN], son[MAXN], top[MAXN];
LL dist[MAXN];
vector<P> edges[MAXN];

void dfs1(int u, int fa, LL d) {
  siz[u] = 1;
  son[u] = 0;
  pa[u] = fa;
  dep[u] = dep[fa] + 1;
  dist[u] = d;
  int v;
  for (P edge: edges[u]) {
    v = edge.first;
    if (v == fa) continue;
    dfs1(v, u, d + edge.second);
    siz[u] += siz[v];
    if (siz[son[u]] < siz[v]) son[u] = v;
  }
}

//void dfs2(int u, int fa) {
//  top[u] = fa;
//  if (son[u]) dfs2(son[u], fa);
//  for (P edge: edges[u]) {
//    if (v == pa[u] || v == son[u]) continue;
//    dfs2(v, v);
//  }
//}

//inline int lca(int u, int v) {
//  for (; top[u] != top[v]; u = pa[top[u]]) if (dep[top[u]] < dep[top[v]]) swap(u, v);
//  return dep[u] < dep[v] ? u : v;
//}

int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; ++i) edges[i].clear();
    int u, v, w;
    for (int i = 1; i < n; ++i) {
      scanf("%d%d%d", &u, &v, &w);
      edges[u].PB(P(v, w));
      edges[v].PB(P(u, w));
    }
    scanf("%d%d", &m, &k);
    dfs1(k, 0, 0);
//    dfs2(k, 1);
    while (m--) {
      scanf("%d%d", &u, &v);
      cout << dist[u] + dist[v] << endl;
    }
  }
}


Measured memory_bytes: 17792
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using ld = long double;
#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 REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define sz(v) (int)v.size()
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;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
const char EOL = '\n';
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

void solve() {
    int n;
    cin >> n;
    vector<ll> a(n);
    priority_queue<ll> q;
    ll m = 0;
    REP(i, n) cin >> a[i];
    ll b, d;
    int ans = 0;
    REP(i, n) {
        cin >> b;
        d = a[i] - b;
        if (d > 0) {
            q.emplace(d);
        } else if (d < 0) {
            m += d;
            ans++;
        }
    }
    if (m == 0) {
        cout << 0 << EOL;
        return;
    }

    while (!q.empty()) {
        auto x = q.top(); q.pop();
        ans++;
        if (m + x >= 0) {
            cout << ans << EOL;
            return;
        }
        m += x;
    }
    cout << -1 << EOL;
}



Measured memory_bytes: 1660
import java.util.Scanner;
public class Main
{
	public static void main(String[] args) 
	{
		Scanner in=new Scanner(System.in);
		for(;;)
		{
			int n=in.nextInt();
			if(n==0)
				return;
			double en[][]=new double[n][3];
			for(int i=0;i<n;i++)
				for(int j=0;j<3;j++)
					en[i][j]=in.nextDouble();
			int m=in.nextInt();
			for(int i=0;i<m;i++)
			{
				double tx=in.nextDouble(),ty=in.nextDouble();
				double sx=in.nextDouble(),sy=in.nextDouble();
				boolean judge=false;
				
				for(int j=0;j<n;j++)
				{
					double r=en[j][2];
					double dit=Math.hypot(tx-en[j][0],ty-en[j][1]);
					double dis=Math.hypot(sx-en[j][0],sy-en[j][1]);
					double d=lp_dis(en[j][0],en[j][1],tx,ty,sx,sy);
					if((dit>r||dis>r) && d<=r)
						judge=true;
				}
				System.out.println(judge ? "Safe":"Danger");
			}
		}
	}
	static double lp_dis(double px,double py,double x1,double y1,double x2,double y2)
	{
		double dx=x2-x1,dy=y2-y1;
		double a=dx*dx+dy*dy,b=dx*(x1-px)+dy*(y1-py);
		double t=-b/a;
		if(t<0) t=0;
		if(t>1) t=1;
		double tx=x1+dx*t;
		double ty=y1+dy*t;
		return Math.hypot(px-tx, py-ty);
	}
}

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

int main() {
	int a;
	string s;
	cin >> a >> s;

	int ans = 0;
	int b = 0;
	for (int i = 0;i < s.size();i++) {
		if (s[i] == 'I')b++;
		else b--;

		if (ans < b)ans = b;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
def solution(num, list):
    flag = "default"
    count = 1
    for i in range(num - 1):
        diff = l[i+1] - l[i]
        if flag == "plus":
            if diff < 0:
                flag = "default"
                count += 1
        elif flag == "minus":
            if diff > 0:
                flag = "default"
                count += 1
        else:
            if diff > 0:
                flag = "plus"
            elif diff < 0:
                flag = "minus"
    return count

if __name__ == "__main__":
    n = int(input())
    l = list(map(int, input().split()))
    print(solution(n, l))


Measured memory_bytes: 15588
a = int(input())
b = []
print(" ",end="")
for i in range(1, a+1, 1):
    if "3" in str(i):
        b.append(i)
    elif i % 3 == 0:
        b.append(i)
    else:
        pass
count = 0
for i in b:
    count += 1
    if len(b) == count:
        print(i)
        break
    print(i, end="")
    print(" ", end="")


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

int main(){
    char a[100];
    cin >> a;

    if(a[0]=='Y'&&a[1]=='A'&&a[2]=='K'&&a[3]=='I'){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3592
import java.io.PrintWriter

val squares = (1..127).map { it * it }

fun check(x: List<Int>, y: List<Int>): Boolean {
    val distanceSquared = x.zip(y).map { (it.first - it.second) * (it.first - it.second)}.sum()
    return distanceSquared in squares
}

fun solve(out: PrintWriter): Boolean = with(out) {
    val N = readLine()!!.toInt()
    val A = readLine()!!.split(" ").map { it.toInt() }.toMutableList()

    for (i in 0 until N-1 step 2 ) {
        A[N-1] = A[N-1] - A[i] + A[i+1]
    }
    A[N-1] /= 2

    for (i in N-2 downTo 0) {
        A[i] -= A[i+1]
    }

    println(A.map { it*2 }.joinToString(" "))

    return false
}

// with(PrintWriter(System.out))
// with(File("out.txt").printWriter())
// with(File(args[1]).printWriter())
fun main(args: Array<String>) = with(PrintWriter(System.out)){
//    System.setIn(File(args[0]).inputStream())
    while(solve(this));
    flush()
}

Measured memory_bytes: 76420
MOD = 10**9+7
class NCR
  @fac = []
  class << self
    def init(n)
      @fac[0] = 1
      @fac[1] = 1
      i = 2
      while i <= n
        @fac[i] = (@fac[i-1]*i)%MOD
        i += 1
      end
    end
    def fact(n)
      @fac[n]
    end
  end
end
N, M = gets.split.map(&:to_i)
NCR.init([N, M].max)
if (N-M).abs > 1
  p 0
else
  if (N-M).abs == 1
    p((NCR.fact(N) * NCR.fact(M)) % MOD)
  else
    p((2 * NCR.fact(N) * NCR.fact(M)) % MOD)
  end
end


Measured memory_bytes: 2760
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;


int main() {
    int a; cin >> a;
    if(a==3 || a==5 || a==7){
        cout << "YES" << endl;
        return 0;
    }
    cout << "NO" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1000000007;

signed main() {
 int n,k,q;
 cin>>n>>k>>q;
int a[n];
pair<int,int> t[n];
for(int i=0;i<n;i++){
  cin>>a[i];
  t[i]=make_pair(a[i],i);
}
sort(t,t+n);
int root= t[0].second,node;
int l[n],r[n];fill(l,l+n,n);fill(r,r+n,n);

for(int i=1;i<n;i++){
  node=root;
  while(true){
    if(t[i].second<node){
      if(l[node]==n){
        l[node]=t[i].second;
        break;
      }
      node=l[node];
    }else{
      if(r[node]==n){
        r[node]=t[i].second;
        break;
      }
      node=r[node];
    }   
  }
}
//cerr<<'y';
priority_queue<int,vector<int>,greater<int>> que[n];
priority_queue<int> qq;
int ans=MOD*2000;
for(int i=n-1;i>=0;i--){
  node=t[i].second;
  if(l[node]!=n)swap(que[node],que[l[node]]);
  if(r[node]!=n){
    while(!que[r[node]].empty()){
      que[node].push(que[r[node]].top());
      que[r[node]].pop();
    }
  }
  if(que[node].size()<k-1)que[node].push(a[node]);
  else{
    qq.push(a[node]);
    while(que[node].size()>k-1){
      qq.push(que[node].top());
      que[node].pop();
    }
    while(qq.size()>q)qq.pop();
    if(qq.size()==q)ans=min(ans,qq.top()-a[node]);
  }
}
cout<<ans;
return 0;
}


Measured memory_bytes: 18688
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<climits>
#include<map>
#include<string>
#include<functional>
#include<iomanip>
#include<deque>
#include<random>
#include<set>

using namespace std;
typedef long long ll;
typedef double lldo;
#define mp make_pair
#define pub push_back
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
ll gcd(ll a, ll b) { if (a % b == 0) { return b; } else  return gcd(b, a % b); }
ll lcm(ll a, ll b) { if (a == 0) { return b; }return a / gcd(a, b) * b; }
template<class T>ll LBI(vector<T>& ar, T in) { return lower_bound(ar.begin(), ar.end(), in) - ar.begin(); }
template<class T>ll UBI(vector<T>& ar, T in) { return upper_bound(ar.begin(), ar.end(), in) - ar.begin(); }

string s;

int main() {
	cin >> s;
	rep(i, sz(s))cout << 'x';
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
  char buf1[400001];
  char* i = buf1 + 200000;
  gets(buf1);
  gets(i);
  int ans = 0;
  char* j = buf1 - 1;
  do ans += *(++j) != *i; while(*(++i));
  printf("%d", ans);
  return 0;
}


Measured memory_bytes: 1968
using namespace std;

#include <cstdio>
#include <cstdint>
#include <cstring>
#include <string>
#include <cmath>
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>

int main(
){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int     N = 0;
    int     n = 0;
    cin >> N;
    string  tmp;
    set<string> s;
    int     ans = N;
    for(n = 0; n<N; n++){
        cin >> tmp;
        s.insert(tmp);
    }

    ans = s.size();

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

Measured memory_bytes: 19276
#include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define sz(a) (int)a.size()
#define mp(a, b) make_pair(a, b)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
const int MAXN = 10;

int n, m;
char arr[MAXN][MAXN];
bool path[MAXN][MAXN];

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

  forn(i, n)
    forn(j, m)
      cin >> arr[i][j];

  path[0][0] = true;

  forn(i, n)
    forn(j, m)
    {
      if (path[i][j])
      {
        if (arr[i + 1][j] == '#')
          path[i + 1][j] = true;
        else if (arr[i][j + 1] == '#')
          path[i][j + 1] = true;
      }
    }

  bool ok = true;

  forn(i, n)
    forn(j, m)
      ok &= path[i][j] ^ (arr[i][j] == '.');

  cout << (ok ? "Possible" : "Impossible");
	return 0;
}


Measured memory_bytes: 764
#include<iostream>
using namespace std;
int main()
{
	int n,k,arr[10000],a=0;
	cin>>n>>k;
	for(int i=1;i<=n;i++){
		cin>>arr[i];
	}
	for(int i=1;i<=n-1;i++){
		for(int j=1;j<=n-i;j++){
			if(arr[j]<arr[j+1]){
			    int b=arr[j];
			    arr[j]=arr[j+1];
			    arr[j+1]=b;
			}
		}
	}
	for(int i=1;i<=k;i++){
		a+=arr[i];
	}
	cout<<a<<endl;
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define PI 3.1415926535897932384
#define MAX 100000
#define MOD 10000007
using namespace std;

///OMI
int main()
{
   
double l;
cin>>l;

double res=l/3;

 res=res*res*res;

 printf("%.20f\n",res);



}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef long double ld;

#define FOR(i, a, b) for (int i = (a), _b = (b); i <= _b; i++)
#define FORD(i, b, a) for (int i = (b), _a = (a); i >= _a; i--)
#define REP(i, n) for (int i = 0, _n = (n); i < _n; i++)
#define FORE(i, v) for (__typeof((v).begin()) i = (v).begin(); i != (v).end(); i++)
#define fi   first
#define se   second
#define all(a) a.begin(), a.end()
#define MASK(i) (1LL << (i))
#define BIT(x, i) (((x) >> (i)) & 1)
#define endl '\n'

const int offset = 8e3 + 5, N = offset - 5;
bool dp[N + 5][3 * offset + 10];

int main(int argc, char const *argv[])
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	clock_t tStart = clock();

	string s;
	int x, y;
	cin >> s >> x >> y;
	int nn = s.size(), cnt = 0;
	s = ' ' + s;
	vector <int> a;
	FORD(i, nn, 1) {
		if (s[i] == 'F') cnt++;
		else {
			a.push_back(cnt);
			cnt = 0;
		}
	}
	int n = a.size();
	if (n == 0) {
		if (x == cnt && y == 0) cout << "Yes"; else cout << "No";
		return 0;
	}
	a.push_back(0); reverse(a.begin(), a.end());
	memset(dp, 0, sizeof dp);
	dp[0][cnt + offset] = 1;
	dp[1][a[1] + offset] = dp[1][-a[1] + offset] = 1;
	FOR(i, 2, n) FOR(j, -N, N) {
		if (abs(j + a[i]) <= nn) dp[i][j + offset] |= dp[i - 2][j + a[i] + offset];
		if (abs(j - a[i]) <= nn) dp[i][j + offset] |= dp[i - 2][j - a[i] + offset];
	}
	if (n & 1) dp[n][x + offset] = dp[n - 1][x + offset];
	else dp[n][y + offset] = dp[n - 1][y + offset];
	if (dp[n][x + offset] && dp[n][y + offset]) cout << "Yes"; else cout << "No";
	
	fprintf(stderr, "Time taken: %.2fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);
	return 0;
}


Measured memory_bytes: 188160
#define _CRT_SECURE_NO_WARNINGS

#include<iostream>
#include<string>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<map>
#include<tuple>
#include<algorithm>
#include<numeric>
#include<math.h>

#define REPS(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

const int mod = 1e9 + 7;
const long double pi = 3.141592653589793238462643383279502884197;
const long double eps = 1e-7;

int dis[30][30];
int grid[500][500];

int main() {
	int N, C;
	cin >> N >> C;
	REP(i, C) {
		REP(j, C) {
			cin >> dis[i][j];
		}
	}
	REP(i, N) {
		REP(j, N) {
			cin >> grid[i][j];
		}
	}
	// 初期化
	int color_count[3][30];
	REP(i, 3) {
		REP(j, 30) {
			color_count[i][j] = 0;
		}
	}
	// 数え上げ
	REP(i, N) {
		REP(j, N) {
			int rest = (i + j + 2) % 3;
			int color_num = grid[i][j] - 1;
			color_count[rest][color_num]++;
		}
	}

	int minCost = mod;

	// 全探索
	REP(i, C) {
		REP(j, C) {
			if (i == j) continue;
			REP(k, C) {
				if (k == i || k == j) continue;

				int cost = 0;
				REP (l, C) {
					cost += (
						color_count[0][l] * dis[l][i] +
						color_count[1][l] * dis[l][j] +
						color_count[2][l] * dis[l][k]);
				}
				if (minCost > cost) minCost = cost;
			}
		}
	}
	cout << minCost;
	system("pause");
	return 0;
}

Measured memory_bytes: 1408
import sys

n, *a = map(int, sys.stdin.read().split())

cumsum = [0] + a
cumxor = cumsum.copy()
for i in range(1, n):
    cumsum[i+1] += cumsum[i]
    cumxor[i+1] ^= cumxor[i]

def is_ok(l, r):
    s = cumsum[r] - cumsum[l-1]
    x = cumxor[r] ^ cumxor[l-1]
    return s == x

def main():
    res = 0
    for l in range(1, n+1):
        lo = l - 1; hi = n+1
        while lo + 1 < hi:
            r = (lo + hi) // 2
            if is_ok(l, r):
                lo = r
            else:
                hi = r
        res += lo - l + 1
            
    return res
if __name__ == '__main__':
    ans = main()
    print(ans)

Measured memory_bytes: 28224
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int n;
    cin>>n;
    int ac=0,wa=0,t=0,r=0;
    while(n--)
    {
        string s;
        cin>>s;
        if(s[0]=='A')
        {
            ac++;
        }
        if(s[0]=='W')
        {
            wa++;
        }
        if(s[0]=='T')
        {
            t++;
        }
        if(s[0]=='R')
        {
            r++;
        }
    }
    printf("AC x %d\n",ac);
    printf("WA x %d\n",wa);
    printf("TLE x %d\n",t);
    printf("RE x %d\n",r);
}


Measured memory_bytes: 3716
import sys
input = sys.stdin.readline

'''

'''

n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

def binsearch(times, target):
    if target < 0:
        return 0
    elif target == 0:
        return 0

    low = 0
    high = len(times) - 1
    while low <= high:
        mid = (low+high) // 2
        cur = times[mid]

        if cur == target:
            return mid
        elif cur < target:
            low = mid+1
        else:
            high = mid-1

    if 0 <= mid+1 < len(times) and times[mid+1] <= target:
        return mid+1
    elif 0 <= mid < len(times) and times[mid] <= target:
        return mid
    elif 0 <= mid-1 < len(times) and times[mid-1] <= target:
        return mid-1
    else:
        return 0

times_a = [0]
cur_time = 0
for ai in a:
    if cur_time + ai > k:
        break
    else:
        cur_time += ai
        times_a.append(cur_time)

res = binsearch(times_a, k)

if res >= 0:
    best = res
else:
    best = 0

cur_time = 0
for i, bi in enumerate(b, start=1):
    cur_time += bi

    if cur_time > k:
        break

    a_books = binsearch(times_a, k - cur_time)
    best = max(best, i + a_books)

print(best)



    
        


Measured memory_bytes: 108900
s=list(map(int,input().split()))
a=str(s[0])
b=str(s[1])
c='0'
d='0'
for i in range(s[1]):
  c+=a
for j in range(s[0]):
  d+=b
c.strip('0')
d.strip('0')
c=int(c)
d=int(d)
if c<d:
  print(d)
else:
  print(c)

Measured memory_bytes: 3064
#include<iostream> 
#include<cstring> 
#include<cstdlib> 
using namespace std; 
  
/* Returns length of LCS for X[0..m-1], Y[0..n-1] */
void lcs( char *X, char *Y, int m, int n ) 
{ 
   int L[m+1][n+1]; 
  
   /* Following steps build L[m+1][n+1] in bottom up fashion. Note 
      that L[i][j] contains length of LCS of X[0..i-1] and Y[0..j-1] */
   for (int i=0; i<=m; i++) 
   { 
     for (int j=0; j<=n; j++) 
     { 
       if (i == 0 || j == 0) 
         L[i][j] = 0; 
       else if (X[i-1] == Y[j-1]) 
         L[i][j] = L[i-1][j-1] + 1; 
       else
         L[i][j] = max(L[i-1][j], L[i][j-1]); 
     } 
   } 
  
   // Following code is used to print LCS 
   int index = L[m][n]; 
  
   // Create a character array to store the lcs string 
   char lcs[index+1]; 
   lcs[index] = '\0'; // Set the terminating character 
  
   // Start from the right-most-bottom-most corner and 
   // one by one store characters in lcs[] 
   int i = m, j = n; 
   while (i > 0 && j > 0) 
   { 
      // If current character in X[] and Y are same, then 
      // current character is part of LCS 
      if (X[i-1] == Y[j-1]) 
      { 
          lcs[index-1] = X[i-1]; // Put current character in result 
          i--; j--; index--;     // reduce values of i, j and index 
      } 
  
      // If not same, then find the larger of two and 
      // go in the direction of larger value 
      else if (L[i-1][j] > L[i][j-1]) 
         i--; 
      else
         j--; 
   } 
  
   // Print the lcs 
   cout << lcs; 
} 
  
/* Driver program to test above function */
int main() 
{ 
  char X[3005]; 
  char Y[3005];
  cin>>X>>Y;
  int m = strlen(X); 
  int n = strlen(Y); 
  lcs(X, Y, m, n); 
  return 0; 
} 


Measured memory_bytes: 35456
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int N; cin >> N;
  vector<int> L(N);
  int sum = 0;
  rep(i,N) {
    cin >> L[i];
    sum += L[i];
  }
  bool ok = true;
  rep(i,N) {
    if (sum - L[i] <= L[i]) ok = false;
  }
  if (ok) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3152