akhauriyash/Code-Regression huggingface dataset:
def e_flatten(MOD=10**9 + 7):
    from fractions import gcd
    from functools import reduce
    N = int(input())
    A = [int(i) for i in input().split()]

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

    def inv(n, mod=MOD):
        return pow(n, mod - 2, mod)

    l = reduce(lcm, A) % MOD
    ans = [(l * inv(a)) % MOD for a in A]
    return sum(ans) % MOD

print(e_flatten())

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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<ll> vll;

#define PI (2*acos(0.0))
#define eps 1e-9
#define pb push_back
#define endl "\n"
#define watch(x) cout << (#x) << " is " << (x) << endl;
#define show(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi] << " "; cout << endl;
#define showpair(v) for(int fi = 0; fi < v.size(); fi++) cout << v[fi].first << " " << v[fi].second << endl;
#define ff first
#define ss second
#define fu cout << "lol" << endl;
#define precision(n) cout << fixed << setprecision(n);
#define lb lower_bound
#define up upper_bound
#define vscan for(i = 0;i<n;i++){cin>>in; v.pb(in);}
#define all(a) a.begin(), a.end()
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define mem(a,val) memset(a,val,sizeof(a))
#define loop(i,n) for(i = 0; i < n; i++)
#define TC() ull T; cin>>T; while(T--)
#define IN(x) {scanf("%d",&x);}
#define LL(x) {scanf("%lld",&x);}
#define CC(x) {scanf("%c",&x);}
#define pfl(x) printf("%d\n",x)
#define pfll(x) printf("%lld\n",x)
#define newl puts("")
#define space printf(" ")
#define MOD 1000000007
#define speed ios_base::sync_with_stdio(false); cin.tie(NULL);


int main()
{
    int i = 0, j = 0, cs = 0, in;
    int l; cin>>l;
    double x = (l/3.0);
    double ans = x*x*x;
    precision(10);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#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) {                              \
        cerr << #x << " = " << (x) << endl; \
    }
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
template <class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return 1;
    } else
        return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    } else
        return 0;
}
#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;

int k, q;
int d[9010];
int D[9010];
int n[9090], x[9090], m[9090];

void solve() {
    FOR(z, q) {
        int ans = 0;
        int N = n[z];
        int X = x[z];
        int M = m[z];
        X %= M;
        FOR(k) {
            D[i] = d[i] % M;
            if (D[i] == 0) {
                D[i] = M;
            }
        }

        int SUM = 0;
        FOR(i, 0, k)
        SUM += D[i];
        SUM *= ((N - 1) / k);
        int cnt = (N - 1) % k;
        FOR(i, 0, cnt) {
            SUM += D[i];
        }
        SUM += X;
        ans = N - 1 - (SUM / M);
        //cout << SUM << endl;
        cout << ans << endl;
    }
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> k >> q;
    FOR(k)
    cin >> d[i];
    FOR(q)
    cin >> n[i] >> x[i] >> m[i];
    solve();
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main(void){
    int c[3][3]={0};
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            cin>>c[i][j];
        }
    }
    int a[3],b[3];
    a[0]=0;
    b[0]=c[0][0];
    a[1]=c[1][0]-b[0];
    a[2]=c[2][0]-b[0];
    b[1]=c[0][1];
    b[2]=c[0][2];
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            if(a[i]+b[j]!=c[i][j]){
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int N,A[100001],count[100001];


int main(void){
    int i,j,k;

    scanf("%d",&N);

    for(i = 1;i <= N;i++)
        scanf("%d",&A[i]);

    for(i = 1;i <= 100000;i++)
        count[A[i]]++;

    j = 0;
    for(i = 1;i <= 100000;i++)
        if(count[i] > 1)
            j += count[i] - 1;

    k = (j + 1) / 2 * 2;

    N -= k;

    if(N >= 1)
        printf("%d\n",N);
    else
        printf("1\n");
    return 0;
}

Measured memory_bytes: 896
#include <fstream>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <queue>
#include <random>

using namespace std;

#define min(a,b) ((a)<(b) ? (a):(b))
#define max(a,b) ((a)>(b) ? (a):(b))

long long gcd(long long a, long long b){
    if(a<b){
        swap(a,b);
    }
    while(b){
        long long r = a%b;
        a=b;
        b=r;
    }
    return a;
}

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

int isPrim(int a){
    if(a==1){
        return 0;
    }
    for(int i=2;i<=(a+1)/2;i++){
        if(a%i==0){
            return 0;
        }
    }
    return 1;
}

long long mod_pow(long long x, long long n, long long mod){
    //xのn乗を計算するのにn乗を2進表記にして計算
    //x^22 = x^16 + x^4 + x^2
    long long ret=1;
    while(n>0){
        if(n%2==1){
            ret=(ret*x)%mod;//答えに付加
        }
        x=(x*x)%mod;//2乗
        n=n/2;
    }
    return ret;
}


struct XX{
    int u;
    int v;
    int t;
};

class xxIntu {
public:
    bool operator()(const XX& riLeft, const XX& riRight) const {
        //第2条件
        if((riLeft.u) == (riRight.u)){
            return riLeft.v < riRight.v;//<:昇順(小さいものから順番)、>:降順(大きいものから順番)
        }
        //第1条件
        return (riLeft.u) < (riRight.u);
    }
};
/*bool operator< (const XX &riLeft, const XX &riRight){
    return riLeft.d < riRight.d;
};*/


int main(int argc, const char * argv[])
{
    //std::ios::sync_with_stdio(false);
    //scanf("%s",S);
    //scanf("%d",&N);
    //getline(cin, target);
    //cin >> x >> y;
    //テスト用
    //ifstream ifs( "1_06.txt" );
    //ifs >> a;
    //ここから

    int N,A,B;
    cin >> N >> A >> B;
    int t[1000];
    for(int i=0;i<N;i++){
        cin >> t[i];
    }
    int cnt=0;
    for(int i=0;i<N;i++){
        if(A<=t[i] && B>t[i]){
            cnt++;
        }
    }
    
    cout << N-cnt << endl;
    
    //ここまで
    //cout << "ans" << endl;改行含む
    //printf("%.0f\n",ans);//小数点以下表示なし
    //printf("%.7f\n",p);
    //printf("%f\n",pow(2,ans.size()));
    
    return 0;
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORD(i, a, b) for(int i = (a); i >= (b); --i)
#define VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(v) (v).begin(),(v).end()

#define PII pair<int,int>
#define st first
#define nd second
#define pb push_back
#define lint long long int
#define VI vector<int>

#define debug(x) {cout <<#x <<" = " <<x <<endl; }
#define debug2(x,y) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y <<endl; } 
#define debug3(x,y,z) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y << ", " << #z << " = " << z <<endl; } 
#define debugv(x) {{cout <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<endl; }}
#define debugt(t,n) {{cerr <<#t <<" = "; FOR(it,0,(n)) cerr <<t[it] <<", "; cerr <<endl; }}

#define make( x) int (x); scanf("%d",&(x));
#define make2( x, y) int (x), (y); scanf("%d%d",&(x),&(y));
#define make3(x, y, z) int (x), (y), (z); scanf("%d%d%d",&(x),&(y),&(z));
#define make4(x, y, z, t) int (x), (y), (z), (t); scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define makev(v,n) VI (v); FOR(i,0,(n)) { make(a); (v).pb(a);} 
#define IOS ios_base::sync_with_stdio(0)
#define HEAP priority_queue

#define read( x) scanf("%d",&(x));
#define read2( x, y) scanf("%d%d",&(x),&(y));
#define read3(x, y, z) scanf("%d%d%d",&(x),&(y),&(z));
#define read4(x, y, z, t) scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define readv(v,n) FOR(i,0,(n)) { make(a); (v).pb(a);}
#define jeb() fflush(stdout);

using namespace std;

int dp[200005];

int main() {
	make2(n, k);
	makev(v, n);
	set<int> plus, minus;
	if (k == n) {
		printf("1\n"); return 0;
	}
	dp[n-1] = 1;
	FORD(i,n-2,0) {
		if (v[i] < v[i+1]) dp[i] = 1 + dp[i+1];
		else dp[i] = 1;
	}
	int ans = 1;
	FOR(i,0,k+1) plus.insert(v[i]), minus.insert(-v[i]);
	bool byl = false;
	if (dp[0] >= k) byl = true;
	for (int i = 0, j = k; j < n; i++,j++) {
		plus.insert(v[j]); minus.insert(-v[j]);
		if (v[i] != *plus.begin() || -v[j] != *minus.begin()) {
			if (dp[i+1] >= k) {
				if (!byl) {
					ans++;
					byl = true;
				}
			} else {
				ans++;
			}
		}
		if (dp[i+1] >= k) byl = true;
		plus.erase(v[i]);
		minus.erase(-v[i]);
	}
	printf("%d\n", ans);
}







Measured memory_bytes: 20340
#include <cstdio>
#include <algorithm>
#include <cmath>

using ll = long long;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
template<class T>bool CHMAX(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool CHMIN(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)


int main() {
	int n;
	int a[100001], b[100000];

	scanf("%d", &n);
	REP(i, n+1) {
		scanf("%d", &a[i]);
	}
	REP(i, n) {
		scanf("%d", &b[i]);
	}

	ll sum = 0;
	FOR(i, 0, n-1) {
		if (a[i] >= b[i]) {
			sum += b[i];
			a[i] -= b[i];
			b[i] = 0;
		}
		else {
			sum += a[i];
			b[i] -= a[i];
			a[i] = 0;
			if (a[i + 1] >= b[i]) {
				sum += b[i];
				a[i + 1] -= b[i];
				b[i] = 0;
			}
			else {
				sum += a[i + 1];
				a[i + 1] = 0;
				b[i] -= a[i + 1];
			}
		}
	}
	printf("%lld\n", sum);
	return(0);
}

Measured memory_bytes: 896
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
static class Program{
	const int mod=998244353;
	static void Main(){
		Sc sc=new Sc();
		int n=sc.I;
		int max=0,min=100;
		int[] a=sc.Ia;
		int[] h=new int[101];
		string ans="Possible";
		for(int i = 0;i<n;i++) {
			h[a[i]]++;
			max=Math.Max(a[i],max);
			min=Math.Min(a[i],min);
		}
		for(int i = max;i>min;i--) {
			if(h[i]<2){ans="Impossible";}
		}
		if(max%2==0&&h[min]!=1){ans="Impossible";}
		if(max%2==1&&h[min]!=2){ans="Impossible";}
		Console.WriteLine("{0}",ans);
	}
}

public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()).Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
}

Measured memory_bytes: 13140
#include<stdio.h>
#include<math.h>
#include<stdlib.h>

//D日目時点のスコアを計算
int score(int D, int c[], int s[][26], int t[]){
    int pen_day[26]={1};
    for(int i=0; i<26; i++){
        pen_day[i]=1;
    }
    int score=0;
    
    for(int i=0; i<D; i++){
        int type=t[i]-1;
        pen_day[type]=0;
        //満足度増加
        score+=s[i][type];
        //満足度低下
        for(int j=0; j<26; j++){
            int dec=c[j]*pen_day[j];
            score-=dec;
        }
        //日数追加
        for(int j=0; j<26; j++){
            pen_day[j]++;
        }        
    }
    return score;
}

void Greedy(int D, int c[], int s[][26]){
    int t[D], max_type=0, max_score=0;

    for(int i=0; i<D; i++){
        max_score=0;
        for(int j=0; j<26; j++){
            t[i]=j+1;
            int S=score(i+1, c, s, t);
            if(max_score < S){
                max_score = S;
                max_type=j+1;
            }
        }
        t[i]=max_type;
    }

    //局所探索
    int new=0;
    int roop_num=0;
    int MAX=max_score;
    while(1){
        int a=rand()%D;
        int b=rand()%D;

        //a,bを入れ替え
        int tmp;
        tmp=t[a];
        t[a]=t[b];
        t[b]=tmp;

        //scoreを計算
        int now_score=score(fmax(a,b), c, s, t);
        if(MAX<now_score) MAX=now_score;
        else{
            tmp=t[a];
            t[a]=t[b];
            t[b]=tmp;  
        }
        new++;
        roop_num++;
        if(roop_num==D*200) break;
    }

    for(int i=0; i<D; i++){
        printf("%d\n", t[i]);
    }
}

int main(void){
    int D, c[26], s[365][26], t[365];

    //入力
    scanf("%d", &D);
    for(int i=0; i<26; i++){
        scanf("%d", &c[i]);
    }
    for(int i=0; i<D; i++){
        for(int j=0; j<26; j++){
            scanf("%d", &s[i][j]);
        }
    }
    /*
    for(int i=0; i<D; i++){
        scanf("%d", &t[i]);
    }
    */

   /*ここから処理*/
   /*
    int num=1;
    for(int i=0; i<D; i++){
        printf("%d\n", num);
        num++;
        if(num>26) num=1;
    }
    */

   Greedy(D, c, s);


    return 0;
}

Measured memory_bytes: 2180
import java.util.Scanner;

public class Main{

      public static void main (String[] args){
             Scanner in = new Scanner(System.in);
             StringBuilder bu = new StringBuilder();
            
             int num = 0;
             int i = 1;
         
             while(true){
                  num = Integer.parseInt(in.next());
                  if(num == 0){
                    break;
                   }

              bu.append ("Case " + i + ": "+ num + "\n");
             i++;
           }
         System.out.print(bu);
   }
}

Measured memory_bytes: 42532
using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
    long mod = 1000000007;
    long answer = 0;
		string[] input = Console.ReadLine().Split(' ');
		int n = int.Parse(input[0]);
		long k = long.Parse(input[1]);
		long[] nums = Array.ConvertAll(Console.ReadLine().Split(' '),long.Parse);
    long x = FallCount(nums);
    //Console.WriteLine(x);
    x %= mod;
    
    Array.Sort(nums);
    long y = 0;
    long minCount = 0;
    for(int i = 1; i < n; i++)
    {
      if(nums[i] > nums[i-1])
      {
        minCount = i;
      }
      y += minCount;
      y %= mod;
    }
    
    answer = k*x;
    answer %= mod;
    
    long answerSub = (k-1)*k/2;
    answerSub %= mod;
    answerSub *= y;
    answerSub %= mod;

    answer += answerSub;
    answer %= mod;

		Console.WriteLine(answer);
	}

  static long FallCount(long[] nums)
  {//転倒数をO(nlogn)で求める。同じ数は転倒していないとする。
    long answer = 0;
    int n = nums.Length;
    long[,] numss = new long[n,2];
    for(int i = 0; i < n; i++)
    {
      numss[i,0] = nums[i];
      numss[i,1] = i;
    }
    long[,] numsCompress = CoordinateCompression(numss);
    long[] bits = new long[n+1];

    for(int i = 0; i < n; i++)
    {
      answer += BitSum(bits,n) - BitSum(bits,numsCompress[i,2]+1);
      bits = BitAdd(bits,numsCompress[i,2]+1,1);
    }

    return answer;
  }

  static long[] BitAdd(long[] bits, long i, long x)//BITでiだけにx加算。O(logn)
  {
    int n = bits.Length-1;
    while(i <= n)
    {
      bits[i] += x;
      i += i&-i;
    }
    return bits;
  }

  static long BitSum(long[] bits, long i)//BITでi以下の総和を計算。O(logn)
  {
    long sum = 0;
    while(i > 0)
    {
      sum += bits[i];
      i -= i&-i;
    }
    return sum;
  }

  static long[,] CoordinateCompression(long[,] vertexesOriginal)
    //1次元の座標圧縮をO(n)で行う。配列は0-indexで[x,順番]。compressedXも更新。
    //例えば、{2,4,4,3}は{0,2,2,1}を返す。
  {
    long n = vertexesOriginal.GetLength(0);//多次元配列の長さの取得
    long xCount = 1;//圧縮後のxの個数
    long[] compressedXmemo = new long[n];
    long[][] vertexes = new long[n][];
    for(long i = 0; i < n; i++)
    {
      vertexes[i] = new long[3];
      for(long j = 0; j < 2; j++)
      {
        vertexes[i][j] = vertexesOriginal[i,j];//配列をジャグ配列に置換
      }
    }

    Array.Sort(vertexes, (a, b) => a[0].CompareTo(b[0]));//x座標でソート
    vertexes[0][2] = 0;
    compressedXmemo[0] = vertexes[0][0];
    for(long i = 1; i < n; i++)
    {
      if(vertexes[i][0] == vertexes[i-1][0])//x座標が同じ
      {
        vertexes[i][2] = xCount - 1;
      }else
      {
        xCount++;
        vertexes[i][2] = xCount - 1;
        compressedXmemo[xCount-1] = vertexes[i][0];
      }
    }
    long[] compressedX = new long[xCount];
    for(long i = 0; i < xCount; i++) compressedX[i] = compressedXmemo[i];

    Array.Sort(vertexes, (a, b) => a[1].CompareTo(b[1]));//もとの番号順でソート

    long[,] answer = new long[n,3];
    for(long i = 0; i < n; i++)
    {
      for(long j = 0; j < 3; j++)
      {
        answer[i,j] = vertexes[i][j];//ジャグ配列から戻す
      }
    }

    return answer;
  }
  
}

Measured memory_bytes: 13484
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> void printvec(const vector<T>& v) {
  for (auto x : v) { cout << x << " "; }
  cout << endl;
}
template<class T> void printtree(const vector< vector<T> >& tree) {
  for (long long i = 0; i < tree.size(); ++i) {
    cout << i + 1 << ": "; printvec(tree[i]);
  }
}
template<class T, class U> void printmap(const map<T, U>& mp) {
  for (auto x : mp) { cout << x.first << "=>" << x.second << endl; }
}

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

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()
#define sz(x) (ll)(x).size()
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;
typedef vector<ll> vl;
typedef vector<P> vp;

const ll INF = 1e15;
const ll MOD = 1000000007;  // 1e9 + 7

const ll N = 105;

ll d[N][N];

int main(int argc, char** argv) {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  //cout << setprecision(10) << fixed;

  ll n, m;
  cin >> n >> m;
  rep(i,n)rep(j,n) { d[i][j] = INF; }
  rep(i,n) { d[i][i] = 0; }

  rep(iter,m) {
    ll s,t,cost;
    cin >> s >> t >> cost;
    d[s][t] = cost;
  }

  // WarshalFloyd
  rep(k, n) {
    rep(i, n) {
      rep(j, n) {
        if (d[i][k] == INF || d[k][j] == INF) { continue; }
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      }
    }
  }

  // Check the presence of negative cycle
  rep(i,n) {
    if (d[i][i] < 0) { // negative cycle
      cout << "NEGATIVE CYCLE" << endl;
      return 0;
    }
  }

  rep(i,n)rep(j,n) {
    if (d[i][j] == INF) {
      cout << "INF";
    } else {
      cout << d[i][j];
    }
    if (j<n-1) {
      cout << " ";
    } else {
      cout << endl;
    }
  }
}



Measured memory_bytes: 3288
#include <stdio.h>

int main(void){

  char s[3];
  scanf("%s", s);

  if (s[0] == 'S' && s[1] == 'A' && s[2] == 'T') {
    printf("1\n");
  }
  if (s[0] == 'F' && s[1] == 'R' && s[2] == 'I') {
    printf("2\n");
  }
  if (s[0] == 'T' && s[1] == 'H' && s[2] == 'U') {
    printf("3\n");
  }
  if (s[0] == 'W' && s[1] == 'E' && s[2] == 'D') {
    printf("4\n");
  }
  if (s[0] == 'T' && s[1] == 'U' && s[2] == 'E') {
    printf("5\n");
  }
  if (s[0] == 'M' && s[1] == 'O' && s[2] == 'N') {
    printf("6\n");
  }
  if (s[0] == 'S' && s[1] == 'U' && s[2] == 'N') {
    printf("7\n");
  }

  return 0;
}

Measured memory_bytes: 128
n = int(input())
for i in range(n):
    p = list(map(float, input().split()))
    print("YES" if abs((p[3] - p[1]) * (p[6] - p[4]) - (p[7] - p[5]) * (p[2] - p[0])) < 1e-10 else "NO")

Measured memory_bytes: 6748
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int h, w;
	cin >> h >> w;
	vector<string> g(h);
	for (int i = 0; i < h; i++) {
		cin >> g[i];
	}
	int dx[] = {1, -1, 0, 0}, dy[] = {0, 0, 1, -1};
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (g[i][j] == '#') {
				bool ok = false;
				for (int k = 0; k < 4; k++) {
					int x = i + dx[k];
					int y = j + dy[k];
					if (x < 0 || x >= h || y < 0 || y >= w || g[x][y] == '.') continue;
					ok = true;
				}
				if (!ok) {
					cout << "No" << endl;
					return 0;
				}
			}
		}
	}
	cout << "Yes" << endl;
	return 0;	
}

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

int main(){
    cin.tie(0);
   	ios::sync_with_stdio(false);
    char s1[201],s2[101],s3[101];
    scanf("%s %s",s1,s2);
    strcpy(s3,s1);
    strcat(s1,s3);
    if(strstr(s1,s2))cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Measured memory_bytes: 3280
#include<bits/stdc++.h>
using namespace std;
typedef complex<double> P;
  
namespace std{
  bool operator < (const P &a,const P &b){
    return (a.real()<b.real()||(a.real()==b.real() && a.imag()<b.imag()));
  }
}
  
double eps=1e-10;
  
double Sqrt(double x){
  return sqrt(max(0.0,x));
}
  
struct S{
  P p,q;
  S(P p,P q):p(p),q(q){}
};
  
struct C{
  P p;
  double r;
  C(P p,double r):p(p),r(r){}
  C(double x,double y,double r):p(P(x,y)),r(r){}
};
  
S getTangent(C a,P p){
  P base=a.p-p;
  double w=Sqrt(norm(base)-a.r*a.r);
  P s=p+base*P(w,a.r)/norm(base)*w;
  P t=p+base*P(w,-a.r)/norm(base)*w;
  return S(s,t);
}
  
int main(){
  double ax,ay,ar,bx,by;
  cin>>bx>>by>>ax>>ay>>ar;
  S ans=getTangent(C(ax,ay,ar),P(bx,by));
  if(ans.q<ans.p)swap(ans.q,ans.p);
  printf("%.10f %.10f\n",ans.p.real(),ans.p.imag());
  printf("%.10f %.10f\n",ans.q.real(),ans.q.imag());
  return 0;
}

Measured memory_bytes: 3264
h, w, k = map(int, input().split())
c = [input() for _ in range(h)]
ans = 0
for bi in range(1<<h):
    for bj in range(1<<w):
        tmp = sum(c[i][j]=='#' for i in range(h) for j in range(w) if (bi>>i&1) and (bj>>j&1))
        if tmp==k:
            ans += 1
print(ans)

Measured memory_bytes: 9184
N,Y = map(int, input().split())
answer=-1,-1,-1
for x in range(N+1):
  for y in range(N-x+1):
    z = N-x-y
    if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
      answer=x,y,z
      break
    else:
      continue
    break
print(*answer)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	for(int i=0;i<s.size()-1;i++)
	{
		if(s[i]==s[i+1])
		{
			cout<<i+1<<" "<<i+2;
			return 0;
		}
	}
	if(s.size()>=3)
	{
		for(int i=0;i<s.size()-2;i++)
		{
			if(s[i]==s[i+2])
			{
				cout<<i+1<<" "<<i+3;
				return 0;
			}
		}
	}
	cout<<-1<<" "<<-1;
}


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

int main()
{
  int r;
  cin >> r;
  cout << 3 * r * r << endl;
}

Measured memory_bytes: 256
N = gets.to_i
hs = gets.split.map(&:to_i)

ans = 0
while hs.size > 0
    while hs[0] > 0
        ans += 1
        hs.size.times do |i|
            if hs[i] > 0
                hs[i] -= 1
            else
                break
            end
        end
    end
    hs.shift
end
puts ans

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

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

typedef long long ll;
using namespace std;

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

  int N;
  cin >> N;
  vector<int> A(N);
  REP(i, N) { cin >> A.at(i); }
  sort(A.begin(), A.end());

  int ans = 1 << 29;
  REP(i, N) { ans = min(ans, A.at(N - 1) - A.at(i) + (A.at(i) - A.at(0))); }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <bitset>
#include <iomanip>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <algorithm>
#include <sstream>

using namespace std;

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vec2bool vector<vector<bool>>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s >= 0;s--)

int main()
{
	ll n,m,ans=0;
	string s;

	cin >> n >> m;

	vecll h(n);

	forll(i, 0, n)
		cin >> h[i];

	vecpairll x(m);

	forll(i, 0, m)
		cin >> x[i].first >> x[i].second;

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

	vecbool check(n, true);

	forll(i, 0, m)
	{
		if (h[x[i].first - 1] > h[x[i].second - 1])
			check[x[i].second - 1] = false;
		else if (h[x[i].first - 1] < h[x[i].second - 1])
			check[x[i].first - 1] = false;
		else
		{
			check[x[i].first - 1] = false;
			check[x[i].second - 1] = false;
		}
	}

	forll(i, 0, n)
	{
		if (check[i])
			ans++;
	}

	cout << ans;

}


Measured memory_bytes: 5632
#include<iostream>

using namespace std;

int main() 
{
	int N;
	int ichi;

	cin >> N;
	ichi = N % 10;

	switch (ichi)
	{
	case 0:
	case 1:
	case 6:
	case 8:cout << "pon" << endl;
		break;
	case 2:
	case 4:
	case 5:
	case 7:
	case 9:cout << "hon" << endl;
		break;
	case 3:cout << "bon" << endl;
		break;
	}
	return 0;
}

Measured memory_bytes: 3624
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int one = n%10;
    n = n/10;
    int two = n%10;
    n = n/10;
    int three = n%10;
    if(one == 7 || two == 7 || three == 7){
      System.out.println("Yes");
    }
    else{
      System.out.println("No");
    }
  }
}

Measured memory_bytes: 35712
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner (System.in);

		int a = scan.nextInt();
		int b = scan.nextInt();

		if (a < b) {
			System.out.println("a < b");
		} else if (a > b) {
			System.out.println("a > b");
		} else if (a == b) {
			System.out.println("a == b");
		}
	}
}

Measured memory_bytes: 26140
// ABC061_C
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator>  // std::back_inserter()
#include <tuple>  // std::tuple std::get
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <algorithm>  // std::copy()
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <bitset>  // static_cast<std::bitset<8>>
#include <sstream>  // std::stringstream
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
#include <iomanip>  // std::setprecision()
using namespace std;

#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (ll i=0; i < n; i++)  // 0 ~ n-1
#define REPN(i, n) for (ll i=1; i <= n; i++)  // 1 ~ n
#define MIN(vec) min_element(ALL((vec)))  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(ALL((vec)))
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(ALL((vec)), 0LL)  // 0 は初期値
#define COPY(vec1, vec2) copy(ALL(vec1), back_inserter(vec2))  // vec1をvec2にコピーする vec2は空にしておく必要あり
#define zero_pad(num) setfill('0') << std::right << setw(num)
#define space_pad(num) setfill(' ') << std::right << setw(num)

typedef long long ll;

const ll MOD7 = 1000000007;  // 1 000 000 007
const ll MOD9 = 1000000009;  // 1 000 000 009

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

    // input
    ll N, K, a, b;
    cin >> N >> K;
    vector<ll> num(100000+1, 0);
    REP(i, N) {
        cin >> a >> b;
        num[a] += b;
    }
    
    vector<ll> partial;
    COPY(num, partial);  // copy vec to partial
    partial_sum(num.begin(), num.end(), partial.begin());
    
    // calculation
    auto iter = lower_bound(partial.begin(), partial.end(), K);
    ll idx = IDX(partial, iter);
    
    for (ll j = idx; j < 100000+1; ++j) {
        if (num[j] != 0) {
            cout << j << "\n";
            break;
        }
    }
    
    return 0;
}


Measured memory_bytes: 2168
#include <stdio.h>

int main(void){
	int i,n, m;
	int sum = 0;
	int count = 0;
	scanf("%d", &n);
	scanf("%d", &m);
	int a[n];
	for (i = 0; i < n;++i) {
		scanf("%d", &a[i]);
		sum += a[i];
	}
	double b = (double)sum / (double)(4 * m);
	for (i = 0; i < n;++i) {
		if((double)a[i] >=b) {
			count++;
		}
	}
	if(count >= m) {
		puts("Yes");
	}
	else {
		puts("No");
	}
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
using namespace std;
int main() {
	int s, data[4], flag = 1;
	cin >> s;
	for (int i = 0; i < 4; ++i) {
		data[i] = s % 10;
		s /= 10;
	}
	for (int i = 0; i < 3; ++i)
		if (data[i] == data[i + 1]) flag = 0;
	cout << (flag ? "Good" : "Bad") << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
signed main()
{
	ios::sync_with_stdio(0);
    cin.tie(0);
	int n,w,a[101],ans=101;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>w;
		if(i)a[i]=a[i-1]+w;
		else a[0]=w;
	}
	for(int i=0;i<n;i++)
	{
		int s1=a[i];
		int s2=a[n-1]-a[i];
		ans=min(ans,abs(s1-s2));
	}
	cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
 
int main() {
	
	int n,m;
	long long k;
	cin>>n>>m>>k;
	
	vector<long long> arr1(n+2,0);
	vector<long long> arr2(m+2,0);
	
	for(int i=1;i<=n;i++)
	{
	    cin>>arr1[i];
	    arr1[i]+=arr1[i-1];
	}
	
	for(int i=1;i<=m;i++)
	{
	    cin>>arr2[i];
	    arr2[i]+=arr2[i-1];
	}
	
	int j=m,ans=0;
	
	for(int i=0;i<=n;i++)
	{
	    if(arr1[i]>k)
	    break;
	    while(arr2[j]>(k-arr1[i]))
	    j--;
	    
	    ans=max(ans,(i+j));
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 6396
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<numeric>
#include<cctype>
using namespace std;

#define Yes(a) a ? "Yes" : "No";
#define YES(a) a ? "YES" : "NO";
#define rep(i,n) for(int i=0;i<n;i++)

void sout(string* a, string* b) {
	if (*a > * b) {
		string c = *a;
		*a = *b;
		*b = c;
	}
}

int combination(int n, int k) {
	if (n > k && k > 0) {
		return (combination(n - 1, k) + combination(n - 1, k - 1));
	}
	else
		return 1;
}

int main() {
	int n, k, q;
	cin >> n >> k >> q;
	vector<int> a(q), s(n);
	for (int i = 0; i < q; i++) {
		cin >> a.at(i);
	}
	for (int i = 0; i < n; i++) {
		s.at(i) = k - q;
	}
	for (int i = 0; i < q; i++) {
		s.at(a.at(i)-1)++;
	}
	for (int i = 0; i < n; i++) {
		if (s.at(i) > 0) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
}


Measured memory_bytes: 1408
#include<stdio.h>
int main()
{
    int A,B,C;
    while(scanf("%d %d %d",&A,&B,&C)!=EOF)
    {
        if(C>=A && C<=B)
        {
            printf("Yes\n");
        }
        else
        {
            printf("No\n");

        }


    }
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=1000000007;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };


int main() {
	string s,t;
	cin>>s>>t;
	if(t.size()<2){
		for(int i=s.size()-1;i>=0;i--){
			if(s[i]==t[0]||s[i]=='?'){
				s[i]=t[0];
				for(int j=0;j<s.size();j++){
					if(s[j]=='?') s[j]='a';
				}
					cout<<s<<endl;
					return 0;
			}
		}
	}
	else{
		for(int i=s.size()-1;i>t.size()-2;i--){
			if(s[i]==t[t.size()-1]||s[i]=='?'){
				for(int j=0;j<t.size();j++){
					if(s[i-j] != t[t.size()-1-j] && s[i-j] != '?'){
						break;
					}

					if(j==t.size()-1){
						for(int k=0;k<t.size();k++){
							s[i-k]=t[t.size()-1-k];
						}
						for(int k=0;k<s.size();k++){
							if(s[k]=='?') s[k]='a';
						}
						cout<<s<<endl;
						return 0;
					}
				}
			}
		}
		cout<<"UNRESTORABLE"<<endl;
	}
}


Measured memory_bytes: 256
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N = II()
print(N**3)

Measured memory_bytes: 3060
n = gets.to_i
hash = Hash.new(0)

# 1つめの文字列から Hash を作成
gets.chomp.each_char do |i|
	hash[i] += 1
end

# 2つめの文字列と比較して、残る文字を数える
(n-1).times do
	txt = gets.chomp

	hash.each do |hashkey|
		hash[hashkey[0]] = [hashkey[1], txt.count(hashkey[0])].min
	end
end

# 残っていない文字(num ==0)を削除し、
# 辞書順に sort し、それぞれの文字数だけ concat して出力。
anstxt = ""
hash.delete_if {|char, num| num == 0}.sort.each do |hashkey|
	anstxt.concat(hashkey[0] * hashkey[1])
end

print anstxt

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

using namespace std;

//#define MD 10

int main(){
    int h,w;
    cin>>h>>w;
    char s[60][60]={'\0'};
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            cin>>s[i][j];
        }
    }
    
     for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(s[i][j]=='#'){
                int flag=0;
                if(i>0){
                    if(s[i-1][j]=='#'){
                        flag++;
                    }
                }
                if(i<h-1){
                    if(s[i+1][j]=='#'){
                        flag++;
                    }
                }
                if(j>0){
                    if(s[i][j-1]=='#'){
                        flag++;
                    }
                }
                if(j<w-1){
                    if(s[i][j+1]=='#'){
                        flag++;
                    }
                }
                if(flag==0){
                    cout<<"No"<<endl;
                    return 0;
                }
            }
        }
     }
    cout<<"Yes"<<endl;
    return 0;
}

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

long long N, X;
class BLU {
public :
    long long b, l, u;
    long long max_d, min_d;

    BLU(long long b, long long l, long long u)
    :b(b), l(l), u(u)
    {
        max_d = X * u - b * u;
        min_d = - b * l;
    }
};
vector<BLU> A;
vector<long long> S_AU, S_AL, S_BU;

bool check(long long m)
{
    long long cnt = m / X;
    if(cnt >= N) return true;
    long long score_a = cnt ? S_AU[cnt-1] + S_AL.back() - S_AL[cnt-1] : S_AL.back();
    long long score_b = cnt ? S_BU[cnt-1]:0;
    long long k = m % X;
    for(auto i = 0; i < N; ++i)
    {
        long long c = k > A[i].b ? A[i].u : A[i].l;
        long long s_a = score_a;
        long long s_b = score_b;
        if(i < cnt) {
            s_a -= A[i].b * A[i].u;
            s_b -= X * A[i].u;

            s_a += A[cnt].b * A[cnt].u - A[cnt].b * A[cnt].l;
            s_b += X * A[cnt].u;
        }
        else {
            s_a -= A[i].b * A[i].l;
            s_b -= 0;
        }

        s_a += c * A[i].b;
        s_b += c * k;

        if(s_a <= s_b)
            return true;
    }

    return false;
}

void solve()
{
    cin >> N >> X;
    
    for(auto i = 0; i < N; ++i)
    {
        long long b, l, u;
        cin >> b >> l >> u;
        A.emplace_back(BLU(b, l, u));
    }

    sort(A.begin(), A.end(), [](const BLU& lhs, const BLU& rhs) {
        return -(lhs.max_d - lhs.min_d) < -(rhs.max_d - rhs.min_d);
    });

    for(auto i = 0; i < N; ++i) {
        auto p = A[i].b * A[i].u;
        auto q = A[i].b * A[i].l;
        auto t = X * A[i].u;
        if(i > 0) {
            p += S_AU.back();
            q += S_AL.back();
            t += S_BU.back();
        }
        S_AU.emplace_back(p);
        S_AL.emplace_back(q);
        S_BU.emplace_back(t);
    }

    long long l = -1;
    long long r = N * X;

    while(l+1 < r) {
        long long m = (l+r) / 2;
        if(check(m))
            r = m;
        else
            l = m;
    }

    cout << r << endl;
}

int main()
{
    cin.sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    solve();
}

Measured memory_bytes: 9068
def count1(x, m):
  return x // (2 * m) * m + max(0, x % (2 * m) - m)

a, b = map(int, input().split())
ans = 0
m = 1
while m <= 2 * b:
  ans += (count1(b + 1, m) - count1(a, m)) % 2 * m
  m *= 2
print(ans)


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

template<class T> void mkmin(T& a, const T b) { a = min(a, b); }
template<class T> void mkmax(T& a, const T b) { a = max(a, b); }

typedef long long ll;
typedef pair<int, int> pii;

#define F first
#define S second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define ferrari ios_base::sync_with_stdio(false); cin.tie(NULL)
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll mod = 1e9 + 7; // 998244353
const ll OO = 1e18;
const int oo = 2e9;
const int N = 200100;

int a[3], k;

int main() {
	cin >> a[0] >> a[1] >> a[2] >> k;
	while (a[1] <= a[0] && k > 0) {
		a[1] *= 2;
		k--;
	}	
	while (a[2] <= a[1] && k > 0) {
		a[2] *= 2;
		k--;
	}
	if (a[0] < a[1] && a[1] < a[2]) cout << "Yes";
	else cout << "No";
}


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

using ll = long long;
const ll amari = 1e9+7;
#define ben(a) a.begin(),a.end()
#define pb(a,b) a.push_back(b)

int main(){
	int a,b,c;
	int sum = 0;
	cin >> a >> b;
	if(a == b)sum++;
	else sum += 2;
	cin >> c;
	if(a != c && b != c)sum++;
	cout << sum << endl;
	return 0; 
}

Measured memory_bytes: 256
#include <cstdio>
#define N 100001
using namespace std;

int a[N], p[N], n, m, r = 0;
int f(int x) { return p[x] = p[x] == x ? x : f(p[x]); }
void u(int x, int y) { p[f(x)] = f(y); }

int main() {
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++)
		scanf("%d", a + i), p[i] = i;
	for(int i = 1, x, y; i <= m; i++)
		scanf("%d%d", &x, &y), u(x, y);
	for(int i = 1; i <= n; i++)
		r += f(i) == f(a[i]);
	printf("%d", r);
}


Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pop pop_back
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int n){
	par= vector<int>(n, -1);
  }
  int find(int x){
    if(par[x]<0)
      return x;
    else
      return par[x]=find(par[x]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
/*struct aa{
	vector<int> gt;
  aa(int n){
	gt= vector<int>(n, 1);
  }
	void c(V<int> d,int b){
	if(d[b]==0){
		gt[d[b]-1]++;
		gt[gt.sz-1]++;
	}
	else{
		gt[d[b]-1]++;
		c(d,d[d[b]]-1);
	}
}
void cok(int a){
	cout<<gt[a-1]<<endl;
	fo(i,a-1)
	cout<<gt[i]<<endl;
}
};
*/
signed main(){
	string a;
	cin>>a;
	if(a.sz>=4){
	if(a[0]=='Y'&&a[1]=='A'&&a[2]=='K'&&a[3]=='I')
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
}
    else
    	cout<<"No"<<endl;
}

Measured memory_bytes: 256
n,k=map(int,input().split())
A=list(map(int,input().split()))
ans=10**10
for i in range(n+1-k):
  s=A[i]
  t=A[i+k-1]
  if s*t>=0:
    a=max(abs(s),abs(t))
  else:
    a=max(abs(s),abs(t))+min(abs(s),abs(t))*2
  if a<ans:
    ans=a
print(ans)

Measured memory_bytes: 14536
#include <bits/stdc++.h>
#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++)
using namespace std;
using P = pair<int, int>; 
using ll = long long;

int main()
{
  int a,b,c;
  cin >>a>>b>>c;
  if(a * c <= b) cout << c << endl;
  else cout << b/a << endl;
  return 0;
}


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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = ((int)(n)-1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> P;
 
const int INF = 1e9;
//const ll INF = 1e18;
const double EPS = 1e-10;
const int MOD = 1e9+7;
const double PI = acos(-1.0);

int main()
{
	int n,c,k;
	cin >> n >> c >> k;
	vector<int> t(n);
	for(int i = 0; i < n; i++) cin >> t[i];
	sort(all(t));
	int ans = 0;
	for(int i = 0; i < n; ans++){
		int limit = t[i]+k;
		int next;
		for(next = 1; next < c; next++){
			if(i+next >= n || t[i+next] > limit) break;
		}
		i += next;
		//cout << t[i] << endl;
	}
	cout << ans << endl;
    return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

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

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

int main(){
	ll n;cin>>n;
	vl a(n);
	rep(i,n)cin>>a[i];
	map<ll,ll>b;
	rep(i,n){
		b[a[i]]++;
	}
	sort(all(a));
	a.erase(unique(all(a)),a.end());
	reverse(all(a));
	ll m1=0,m2=0;
	rep(i,a.size()){
		if(b[a[i]]>=2){
			m1=a[i];
			b[a[i]]-=2;
			break;
		}
	}
	rep(i,a.size()){
		if(b[a[i]]>=2){
			m2=a[i];
			break;
		}
	}
	cout<<m1*m2<<endl;
}

Measured memory_bytes: 7296
#include <iostream>
#include<algorithm>
#include<vector>
#include<string>
#include <cmath>
#include <iomanip>
#include <math.h>
#include <numeric>
using namespace std;

int main() {
	int N;
	cin >> N;
	vector<int> h(1000);
	for (int i = 1; i <= N; i++) cin >> h[i];
	long long int ans = 0, active = 0;
	for (int i = 1; i <= N; i++) {
		if (active < h[i]) {
			ans += h[i] - active;
			active = h[i];
		}
		else active = h[i];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for(int i=0;i<(n);++i)
typedef long long ll;

int main() {
  int N;
  vector<int> A;
  cin >> N;
  ll sum = 0;
  int tmp;
  rep(i, N) {
    cin >> tmp;
    sum += tmp;
    A.push_back(tmp);
    if (i % 2) sum -= 2 * tmp;
  }

  cout << sum << " ";
  for (int i = 0; i < N-1; ++i) {
    sum = 2 * A[i] - sum;
    cout << sum << " ";
  }

  return 0;
}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define nl "\n" 



int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n,k;
    cin >> n >> k;
    unordered_set<int> sp;
    for(int i=1;i<=k;++i){
		int d;
		cin >> d;
		int sd[d];
		for(int j=0;j<d;++j){
			cin >> sd[j];
			sp.insert(sd[j]);
		}
	}
	printf("%d",n-(int)sp.size());
	return 0;
}



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

using ll = long long;
using G = vector<vector<int>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const ll MOD = 1000000007;

ll GCD(ll x, ll y){
	return y ? GCD(y, x%y) : x;	
}

int main() {
	int x, y, z;
	cin >> x >> y >> z;
	cout << z << ' ' << x  << ' ' << y << endl;
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse4")
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int ll
#define all(x) x.begin(), x.end()
#define trav(i,a) for(auto &i:a) 
inline int in(){int x;scanf("%lld",&x);return x;}
const int mod=1e9+7;
int f[26];
int32_t main()
{
	int n=in();
	string s;
	cin>>s;
	for(auto i:s)
	f[i-'a']++;
	
	int ans=1;
	for(int i=0;i<26;i++)
	{
		ans*=(f[i]+1);
		ans%=mod;
	}	
	ans-=(1-mod);ans%=mod;
	cout<<ans;
	
}


Measured memory_bytes: 3796
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    ll w,h,x,y;
    cin>>w>>h>>x>>y;
    double area=w*h*.5;
    x*=2;
    y*=2;
    int f=0;
    if(x==w && y==h)
        f=1;
    cout<<setprecision(10)<<fixed<<area<<" "<<f<<endl;

    return 0;
}


Measured memory_bytes: 3772