akhauriyash/Code-Regression huggingface dataset:
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    static int N;
    static int M;
    static Edge[] edges;
    static long[] d;
    static long INF = Long.MAX_VALUE;

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

        edges = new Edge[M];
        for(int i = 0; i < M; i++) {
            int from = scanner.nextInt() - 1;
            int to = scanner.nextInt() - 1;
            long cost = -scanner.nextLong();
            Edge e = new Edge(from, to, cost);
            edges[i] = e;
        }

        d = new long[N];
        Arrays.fill(d, INF);

        scanner.close();
    }

    private static void bellmanFord(int s) {
        d[s] = 0;
        for(int i = 0; i < N; i++) {
            boolean update = false;
            for(int j = 0; j < M; j++) {
                Edge e = edges[j];
                if(d[e.from] != INF && d[e.from] + e.cost < d[e.to]) {
                    d[e.to] = d[e.from] + e.cost;
                    update = true;
                }
            }
            if(!update) break;
        }
    }

    public static void main(String args[]) {
        init();
        bellmanFord(0);
        long ans = -d[N - 1];

        bellmanFord(0);
        if(ans == -d[N - 1]) {
            System.out.println(ans);
        } else {
            System.out.println("inf");
        }
    }
}

class Edge {
    int from;
    int to;
    long cost;

    public Edge(int from, int to, long cost) {
        this.from = from;
        this.to = to;
        this.cost = cost;
    }
}

Measured memory_bytes: 28652
object Main extends App {
	override def main(args:Array[String]) = {
		val sc = new java.util.Scanner(System.in)
		
		val rooms = getAllRooms
		val map = new scala.collection.mutable.HashMap[Room , Int]();
		
		val n = sc.nextInt
		(1 to n).foreach{ x =>
			val a,f,r,v = sc.nextInt
			val room = Room(a,f,r)
			val newVal = map.getOrElse(room,0) + v
			map.put(room,newVal)
		}
		
		printRooms(map, new java.io.PrintWriter(System.out))
		
	}
	
	case class Room(apt :Int, floor :Int, room:Int)

	def getAllRooms = 
		for(a <- (1 to 4) ; f <- (1 to 3) ; r <- (1 to 10) ) yield Room(a,f,r)
		
	def printRooms(map:scala.collection.mutable.Map[Room,Int], pw : java.io.PrintWriter):Unit = {
		for(a <- (1 to 4)){
			for(f <- (1 to 3)){
				for(r <- (1 to 10)){
					val v = map.getOrElse(Room(a,f,r), 0 )
					print(" " + v)
				}
				println()
			}
			if(a != 4){
				println("####################")
			}
		}
	}
	
}

Measured memory_bytes: 47804
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cstdlib>
 
using namespace std;
 
const int maxn = 2e5 + 10;
bool know[maxn];
int ans[maxn];
int n;
int a(string s){
	if(s == "Vacant")
		return 0;
	else if(s == "Male")
		return 1;
	else
		return 2;
}
int main(){
	cin >> n;
	cout << 0 << endl;
	string cur;
	cin >> cur;
	ans[0] = a(cur);
	if(ans[0] == 0)
		return 0;
	know[0] = 1;
	int l = 0 , r = n - 1;
	while(l < r - 2){
		int mid = (l + r) >> 1;
		cout << mid << endl;
		cin >> cur;
		ans[mid] = a(cur);
		if(ans[mid] == 0){
			return 0;
		}
		know[mid] = 1;
		if(know[l]){
			if(((ans[l] == ans[mid]) + (mid - l + 1)) & 1)
				r = mid;
			else
				l = mid;
		}
		else{
			if(((ans[mid] == ans[r]) + (r - mid + 1)) & 1)
				l = mid;
			else
				r = mid;
		}
	}
	for(int i = l ; i < r ; ++ i){
		cout << i << endl;
		cin >> cur;
		ans[i] = a(cur);
		if(ans[i] == 0)	return 0;
	}
	cout << r << endl;
	cout.flush();
	return 0;
}

Measured memory_bytes: 976
class UnionFind
  def initialize(n)
    @data = Array.new(n, &:itself)
  end

  def num_roots
    @data.uniq.size
  end

  def root(i)
    _compact!(i, _root(i))
  end

  def same?(i, j)
    root(i) == root(j)
  end

  def unite!(i, j)
    _compact!(i, root(j))
  end

  def _root(i)
    i = @data[i] until i == @data[i]
    i
  end

  def _compact!(i, r)
    until @data[i] == r
      tmp = @data[i]
      @data[i] = r
      i = tmp
    end
    r
  end
end

n, m = gets.chomp.split.map(&:to_i)
uf = UnionFind.new(n)
m.times do
  a, b = gets.chomp.split.map(&:to_i)
  uf.unite!(a-1, b-1)
end
n.times{|i| uf.root(i)}
puts uf.num_roots - 1

Measured memory_bytes: 18332
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(), (x).end()
#define call(x) (x).cbegin(), (x).cend()
#define pb push_back
const double PI = acos(-1);
const int mod = 1e9+7;
const long long INF = (1LL << 60);
ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}
ll stringcount(string s, char c){return count(s.cbegin(), s.cend(), c);}
bool isInteger(double x){return floor(x) == x;}
ll ceil(const ll a, const ll b){return ((a)+(b)-1)/b;}

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

  ll n;
  cin >> n;
  vector<double> x(n), y(n);
  for(ll i = 0; i < n; i++) cin >> x[i] >> y[i];

  vector<ll> v(n);
  for(ll i = 0; i < n; i++) v[i] = i;

  double sum = 0;
  do{
    for(ll i = 1 ; i < n; i++){
      sum += sqrt(pow(x[v[i]] - x[v[i-1]], 2) + pow(y[v[i]] - y[v[i-1]], 2));
    }
    //cout << sum << endl;    
  }while(next_permutation(all(v)));
  
  ll cnt = n;
  for(ll i = n-1; i >= 1; i--) cnt *= i;
  sum /= (double)cnt;
  printf("%.16f\n", sum);
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main()
{
	int n,x;
	int a,b,c;

	while(scanf("%d %d",&n,&x)!=EOF)
	{
		int count=0;
		if(n==0&&x==0)break;
		
		else
		{
			for(a=1;a<=n;a++)
			{
				for(b=a+1;b<=n;b++)
				{
					for(c=b+1;c<=n;c++)
					if(a+b+c==x&&a!=b&&a!=c&&b!=c)count++;
				}
			}
		}
		printf("%d\n",count);
	}
	return 0;
}

Measured memory_bytes: 600
n, m = map( int , raw_input().split() )
A = []
b = []
 
for i in range(n):
  A += [ map( int , raw_input().split() ) ]
for j in range(m):
  b += [ input() ]
 
for i in range(n):
  c=0
  for j in range(m):
    c += A[i][j]*b[j]
  print c

Measured memory_bytes: 6624
import sys
sys.setrecursionlimit(5000000)
N = int(input())
ans = []


def func(s):
    if len(s) == N:
        ans.append(s)
    else:
        for i in range(ord(max(s))-95):
            func(s+chr(97+i))

func('a')
for a in sorted(ans):
    print(a)


Measured memory_bytes: 13600
use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn input_tuple() -> (u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1])
}

fn main() {
    let k: u64 = input();
    let (a, b) = input_tuple();
    for i in a..(b+1) {
        if i % k == 0 {
            println!("OK");
            return;
        }
    }
    println!("NG");
}


Measured memory_bytes: 2164
import java.util.*;
public class Main {
    public static void main(String[] args){
      // 入力
      Scanner sc = new Scanner(System.in);
      int N = sc.nextInt();
      long result = 0L;
      int DIV = 1000000007;
      long pow10 = 1L;
      long pow9 = 1L;
      long pow8 = 1L;
      for(int i = 1; i <= N; i++){
        pow10 = (pow10 * 10) % DIV;
        pow9 = (pow9 * 9) % DIV;
        pow8 = (pow8 * 8) % DIV;
      }
      pow9 = (pow9 * 2) % DIV;
      result = pow10 - pow9;
      if(result < 0){
        result += DIV;
      }
      result = (result + pow8) % DIV;
      System.out.println(result);
    }
    
 
}

Measured memory_bytes: 35656
#!/usr/bin/env python3

n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
assert len(a1) == len(a2) == n

def down_at_i(i0):
    res = 0
    for k in range(i0 + 1):
        res += a1[k]
    for k in range(i0, n):
        res += a2[k]
    return res

res = 0
for i in range(n):
    res = max(res, down_at_i(i))

print(res)
        


Measured memory_bytes: 3064
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<stack>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<bitset>
#include<iomanip>
using namespace std;

typedef stack<int> IntStack;
typedef queue<int> IntQueue;

const double pi = 3.141592653589793;


//文字0~9をint型0~9に変換
int char_to_int(char c)
{
	if (c == '0') return 0;
	if (c == '1') return 1;
	if (c == '2') return 2;
	if (c == '3') return 3;
	if (c == '4') return 4;
	if (c == '5') return 5;
	if (c == '6') return 6;
	if (c == '7') return 7;
	if (c == '8') return 8;
	if (c == '9') return 9;
	else return -1;
}
//a^b mod MODを計算
long long int ModPower(long long int a, long long int b, long long int MOD)
{
	if (b == 0) return 1;
	else if (b % 2 == 0)
	{
		long long int d = ModPower(a, b / 2, MOD);
		return (d*d) % MOD;
	}
	else
	{
		return (a*ModPower(a, b - 1, MOD)) % MOD;
	}
}
//nCr mod MODを計算
long long int ModCombi(long long int n, long long int r, long long int MOD)
{
	if (n == 0 || r == 0) return 1;

	long long int Kn = 1, Kr = 1, Knr = 1;

	long long int temp = 1;
	for (long long int i = 1; i <= n; i++)
	{
		temp *= i;
		temp %= MOD;
		if (i == n) Kn = temp;
		if (i == r) Kr = temp;
		if (i == n - r) Knr = temp;
	}

	long long int x = ModPower(Kr, MOD - 2, MOD);
	long long int y = ModPower(Knr, MOD - 2, MOD);

	long long int ans;
	ans = Kn * x;
	ans %= MOD;
	ans *= y;
	ans %= MOD;

	return ans;
}


/*ここまでテンプレ*//*ここまでテンプレ*//*ここまでテンプレ*//*ここまでテンプレ*/



int main()
{
	char S[6];
	cin >> S;

	bool a = true;
	for (int i = 0; i < 3; i++)
	{
		if (S[i] == S[i + 1]) a = false;
	}

	if (a) cout << "Good";
	else cout << "Bad";

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <map>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <bitset>
#include <functional>
using namespace std;
const constexpr int INF = 1e9;

long long N, A;

string S, T;
long long dp[51][51][2510];
int a[51];
void solve(){
    for(int i=0; i<N; ++i) cin >> a[i];
    
    dp[0][0][0]=1;
    for(int i=0; i<N; ++i){
        for(int j=0; j<N; ++j){
            for(int k=0; k<N*A; ++k){
                if(k + a[i] <= A*N) dp[i+1][j+1][k+a[i]] += dp[i][j][k]; 
                dp[i+1][j][k] += dp[i][j][k];
                //カードを引く/引かない
            }
        }
    }
    long long ans=0;
    for(int i=1; i<=N; ++i){
        ans += dp[N][i][i*A];
    }
    cout << ans << endl;
        
}
int main() {
    cin >> N >> A;
    solve();
	return 0;
}

Measured memory_bytes: 50304
c = [list(map(int, input().split())) for _ in range(3)]
a = [0] * 3
b = [0] * 3
b[0] = c[0][0]
for i in range(1, 3):
    a[i] = c[i][0] - b[0]
for i in range(1, 3):
    b[i] = c[0][i] - a[0]
for i in range(3):
    for j in range(3):
        if a[i] + b[j] != c[i][j]:
            print('No')
            exit(0)
print('Yes')


Measured memory_bytes: 38384
#include<iostream>
#include<cmath>

using namespace std;
int main()
{
    int a,b,c,d,e,f;
    cin >> a >> b >> c >> d >> e >> f;
    int cnt=a+b*5+c*10+d*50+e*100+f*500;
    if(cnt/1000!=0){
        cout << "1" << endl;
    }else{
        cout << "0" << endl;
    }
    
    return 0;
}


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

using ll=long long;
int dp[3010][3010];

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s, t;
  cin >> s >> t;
  rep(i,s.size()){
    rep(j,t.size()){
      if(s[i]==t[j]) dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j]+1);
      dp[i+1][j+1] = max(dp[i+1][j+1], dp[i+1][j]);
      dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j+1]);
    }
  }
  
  string res = "";
  int i = s.size();
  int j = t.size();
  while(i>0 && j>0){
    if(dp[i][j]==dp[i-1][j]){
      i--;
    }
    else if(dp[i][j]==dp[i][j-1]){
      j--;
    }
    else{
      res = s[i-1] + res;
      i--; j--;
    }
  }
  cout << res << endl;
     
  
}

Measured memory_bytes: 35584
#include <bits/stdc++.h>
    using namespace std;
    using ll = long long;
    #define rep(i, n) for (int i = 0; i < (int)n; i++)
    #define ALL(a) (a).begin(), (a).end()
    const ll mod = 1e9 + 7;
     
    int dp[5005][5005];
     
    int main()
    {
        int n;
        string s;
        cin >> n >> s;
        for (int i = n - 1; i >= 0; i--)
        {
            for (int j = n - 1; j >= 0; j--)
            {
                if (s[i] != s[j])
                    dp[i][j] = 0;
                else
                    dp[i][j] = dp[i + 1][j + 1] + 1;
            }
        }
        int ans = 0;
        rep(i, n) rep(j, n)
        {
            
            int now = min(dp[i][j], abs(j - i));
            ans = max(ans, now);
        }
        cout << ans << endl;
        return 0;
    }

Measured memory_bytes: 98048
#include <bits/stdc++.h>//stayCalmNeverSettle
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define endl "\n"
#define pb push_back
#define x first
#define y second
using namespace std;
typedef long long ll;

const ll M = 1e9+7;
const int N = 110;
int arr[N];

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    multiset<int> s;
    int s1 = 2,s2 = 2,s3 = 2;
    for(int i=1;i<100;i++){
    	for(int j=1;j<100;j++){
    		for(int k=1;k<100;k++){
    			int x = i+j;
    			int y = j+k;
    			int z = i+k;
    			s.insert(x*x+y*y+z*z);
    		}
    	}
    }
    for(int i=1;i<=n;i++){
    	cout << s.count(2*i) << endl;
    }
}

Measured memory_bytes: 49100
#include <bits/stdc++.h>
using namespace std;
 
int gcd(int x,int y){
    if(y==0)return x;

    return gcd(y,x%y);
}
int lcm(int x,int y){
    return x*y/gcd(x,y);
}

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

int main(){

    string S,T;
    cin>>S>>T;



    for(int i=0;i<=S.length();i++){
        if(S==T){
            cout<<"Yes"<<endl;
            return 0;
        }
        T =T[T.length()-1] + T.substr(0,T.length()-1);

    }
    cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
if __name__ == '__main__':
    n = int(input())

    arr = list(map(int, input().split()))

    dp = [[10 ** 9 for j in range(2)] for i in range(n)]
    dp[0][0] = 1 # increase
    dp[0][1] = 1 # decrease

    for i in range(1, n):
        if arr[i] > arr[i-1]:
            dp[i][0] = min(dp[i-1][0], dp[i-1][1] + 1)
            dp[i][1] = min(dp[i-1][0], dp[i-1][1]) + 1
        elif arr[i] < arr[i-1]:
            dp[i][0] = min(dp[i-1][0], dp[i-1][1]) + 1
            dp[i][1] = min(dp[i-1][0] + 1, dp[i-1][1])
        else:
            dp[i][0] = dp[i-1][0]
            dp[i][1] = dp[i-1][1]
    # print(dp)
    print(min(dp[-1]))

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

int main() {
  int n,ans = 0;
  string a,b,c;
  cin >> n >> a >> b >> c;
  for(int i = 0;i < n;i++){
    int cnt = 0;
    if(a[i] == b[i]) cnt++;
    if(b[i] == c[i]) cnt++;
    if(c[i] == a[i]) cnt++;
    if(cnt == 0) ans += 2;
    if(cnt == 1) ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 764
n = int(input())
x = map(float, input().strip().split())
y = map(float, input().strip().split())
d = tuple(map(lambda x,y:abs(x-y), x, y))
print(sum(d))
print(sum(map(pow, d, [2]*n))**0.5)
print(sum(map(pow, d, [3]*n))**(1/3))
print(max(d))

Measured memory_bytes: 7812
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<map>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(){
    int64_t n,a,b;
    cin>>n>>a>>b;
    if((b-a)%2==0) cout<<(b-a)/2<<endl;
    else{
        int64_t c=min(a-1,n-b)+1+(b-a-1)/2;
        cout<<c<<endl;
    }
}


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

int main() {

  double a,b,c,d,sum;
  string s,t;
  cin>>a;
sum=0;
  for(int i=0;i<a;i++){
  	cin>>b>>s;
    if(s=="JPY"){
    	sum+=b;
    }
    else{
    	sum += 380000*b;
    }
  
  }
  
  cout<<sum<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll inf=1000000000000000000;
long double pi=3.14159265358979323846L;
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
ll gya[1000010];
ll kai[1000010];
ll beki(ll n,ll k,ll md){
  ll ret=1;
  ll now=n;
  while(k>0){
    if(k%2==1){
      ret*=now;
      ret%=md;
    }
    now*=now;
    now%=md;
    k/=2;
  }
  return ret;
}
ll gyaku(ll n,ll md){
  return beki(n,md-2,md);
}
int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    ll n;cin>>n;
    ll c[n];rep(i,0,n)cin>>c[i];
    sort(c,c+n);
    ll ans=0;
    rep(i,1,n+1){
        ll y=c[i-1];
        ll sum=beki(4,i-1,mod);
        sum*=beki(2,n-i+1,mod);
        sum%=mod;
        sum*=y;
        sum%=mod;
        ll t=0;
        if(i<n)t=(n-i)*beki(2,n-i-1,mod);
        t%=mod;
        t+=beki(2,n-i,mod);
        t%=mod;
        sum*=t;
        sum%=mod;
        ans+=sum;
        ans%=mod;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 1792
#include                        <bits/stdc++.h>
#include                        <ext/pb_ds/assoc_container.hpp>
#define lb                      lower_bound
#define ub                      upper_bound
#define fe(x)                   (*(x.begin()))
#define le(x)                   (*(x.rbegin()))
#define pb                      push_back
#define load(node,n)            bool operator < (const node &n) const
#define fbo(x,id)               (*(x.find_by_order(id)))
#define ook(y)                  order_of_key(y)
#define all(x)                  (x).begin(),(x).end()
#define FOR(i,n)                for(int i = 1; i<=n; i++)
#define REP(i,n)                for(int i = 0; i<n;  i++)
#define TT                      long long TC;  scanf("%lld",&TC);  while(TC--)
#define read                    freopen("input.txt","r",stdin)
#define write                   freopen("output.txt","w",stdout)
#define set(x)                  tree<x,null_type,less<x>,rb_tree_tag,tree_order_statistics_node_update>
using                           namespace __gnu_pbds;
using                           namespace std;
typedef                         long long ll;
typedef                         pair<ll,ll> pll;
typedef                         pair<int,int> pii;

#define mx 10002

ll ara[mx];

ll fn(ll a,ll b,ll c){
    if(a==b && b==c)    return 1;
    if(a!=b && b==c)    return 3;
    if(a==b && b!=c)    return 3;
    return 6;
}

main(){
//read;

ll cnt = 0;

for(ll i = 1; i<mx; i++){
    for(ll j = i; j<mx; j++){
        for(ll k = j; k<mx; k++){
            ll a = i*i+j*j+k*k+i*j+j*k+k*i;
            if(a>=mx)   break;
            ara[a]+=fn(i,j,k);
        }
    }
}

ll n;
cin>>n;
for(ll i = 1; i<=n; i++)
    cout<<ara[i]<<endl;


return 0;
}


Measured memory_bytes: 3612
import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static final int MOD = 1000000007;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		int m = parseInt(sc.next());
		sc.close();
		out.println(m>=n?"Yes":"No");
	}
}


Measured memory_bytes: 23636
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1001001001;
const long long mod=998244353;

int main(){
  string s;
  cin>>s;
  string ans;
  for(int i=0;i<s.size();i++){
    if((i+1)%2==1){ans+=s[i];}
  }
  cout<<ans<<endl;
  return 0;                       
}

Measured memory_bytes: 3728
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int a,b,c;

int main(){
	cin>>a>>b>>c;
	if(a==b&&b==c&&c==a) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

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

int main(){
  int a,b,c;
  cin>>a>>b>>c;
  int sum=a+b+c;
  if((3*max({a,b,c})-sum)%2==0)
    cout<<(3*max({a,b,c})-sum)/2<<endl;
  else
    cout<<(3*(max({a,b,c})+1)-sum)/2<<endl;
}

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

using namespace std;

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

typedef pair<int,int> pi;

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

 long n;
  cin >> n;
  vector<pi> p(n);
  rep(i,0,n){
    long a;
    cin >> a;
    p[i]=make_pair(a,i+1);
  }
  sort(p.begin(),p.end());
  
  rep(i,0,n-1) cout << p[i].second << " ";
     cout << p[n-1].second << endl;
  
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    long int sum = 0;
    cin >> N;

    for (int i = 1; i <= N; i++) {
        if (i % 15 == 0) {

        } else if (i % 3 == 0) {

        } else if (i % 5 == 0) {

        } else {
            sum += i;
        }
    }
    cout << sum << endl;
}


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

using namespace std;

int main()
{
    long long x, k, d;
    cin >> x >> k >> d;
    x = abs(x);
    long long ans = LLONG_MAX;
    long long times = x / d;
    if (times >= k)
    {
        cout << x - k * d << "\n";
        return 0;
    }
    k -= times;
    if (k % 2 == 0)
        cout << x % d << "\n";
    else
        cout << d - x % d << "\n";

    return 0;
}

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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
// #define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    string a, b, c; cin >> a >> b >> c;
    char diff = 'A'-'a';
    cout << char(a[0]+diff) << char(b[0]+diff) << char(c[0]+diff) << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 7728
N=int(input())
P=list(map(int,input().split()))

List=[]
x=P[0]
for i in range(N):
    if x >= P[i]:
        x=P[i]
        List.append(P[i])
    else:
        List.append(x)

ans=1       
for i in range(N-1):
    if List[i] != List[i+1]:
        ans = ans+1

print(ans)

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

int main(){
  string S;
  cin >> S;
  int A=0,B=0,C=0,N=S.size();
  for(int i=0;i<N;i++){
    if(S[i]=='a'){
      A++;
    }else if(S[i]=='b'){
      B++;
    }else{
      C++;
    }
  }
  //cout << A << " " << B << " " << C << endl;
  int D=min(min(A,B),C);
  D=max(A-D,max(B-D,C-D));
  if(D>1){
    cout << "NO" << endl;
  }else{
    cout << "YES" << endl;
  }
}

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

const int MAX_N = 200005;
const int INF = 1001001001;

vector<int> A, ans;
vector<int> to[200005];
int dp[MAX_N];

void dfs(int v, int p = -1) {
  int i = lower_bound(dp, dp + MAX_N, A[v]) - dp;
  int old = dp[i];
  dp[i] = A[v];
  ans[v] = i;
  if (p != -1) ans[v] = max(ans[v], ans[p]);
  for (int u : to[v]) {
    if (u == p) continue;
    dfs(u, v);
  }
  dp[i] = old;
}

int main() {
  int N;
  cin >> N;
  A = ans = vector<int>(N);
  rep(i, N) cin >> A[i];
  rep(i, N - 1) {
    int u, v;
    cin >> u >> v;
    u--; v--;
    to[u].push_back(v);
    to[v].push_back(u);
  }
  rep(i, MAX_N) dp[i] = INF;
  dp[0] = -INF;
  dfs(0);

  rep(i, N) cout << ans[i] << endl;
  return 0;
}


Measured memory_bytes: 30780
#include<cstdio>
#include<vector>
#include<stack>
using namespace std;

static const int MAX = 100000;
static const int WHITE = 0;
//static const int BLACK = 1;

vector<int> V[MAX];
//int n;
int color[MAX] = {0};

void dfs(int u,int c)
{
	stack<int> S;
	S.push(u);
	color[u] = c;
	while(!S.empty())
	{
		int v = S.top();
		S.pop();
		for(int i=0; i<V[v].size(); i++)
		{
			int k = V[v][i];
			if(color[k] == WHITE)
			{
				S.push(k);
				color[k] = c;
			}

		}
	}
}

int main()
{
	int m,n;
	scanf("%d%d", &n, &m);
	int u,v;
	for(int i=0; i<m; i++)
	{
		scanf("%d%d", &u, &v);
		V[u].push_back(v);
		V[v].push_back(u);
	}

	int c = 1;
	for(int i=0; i<n; i++)
	{
		if(color[i] == WHITE)
			dfs(i,c++);
	}

	int q;
	scanf("%d", &q);
	for(int i=0; i<q; i++)
	{
		scanf("%d%d",&u,&v);
		if(color[u] == color[v])
			printf("yes\n");
		else
			printf("no\n");
	}

	return 0;
}


Measured memory_bytes: 8376
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
ans = [0 for i in range(n)]
c = 1
if n==2:
  ans[0] = 1
for i in range(1,n-1):
  if a[i]==a[i-1]:
    c += 1
  else:
    ans[a[i-1]-1] = c
    c = 1
  if i==n-2:
    ans[a[i]-1] = c
  
for i in range(n):
  print(ans[i])


Measured memory_bytes: 32320
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second
#define mp make_pair
 
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
  int A, B; cin >> A >> B;
  cout << 6 - A - B << endl;

  return 0;
}


Measured memory_bytes: 256
h, w = map(int, input().split())
grid=[]    
for _ in range(h):
    grid.append(list(map(str, input().split())))

for i in range(h):
    for j in range(w):
        if grid[i][j] == "snuke":
            ans = chr(65 + j) + str(i + 1)
            break
            

print(ans)

Measured memory_bytes: 9124
function main()
    a = parse(Int64, readline())
    b = parse(Int64, readline())
    c = parse(Int64, readline())
    x = parse(Int64, readline())

    ans = 0
    for i = 0:a ,j = 0:b, k = 0:c
        if 500i + 100j + 50k == x
            ans += 1
        end
    end

    println(ans)
end

main()


Measured memory_bytes: 110908
import bisect
    
def main():
    while True:
        d = int(input())
        if d == 0:
            break
        n = int(input())
        m = int(input())
        s = [0] + [int(input()) for i in range(n - 1)] + [d]
        s.sort()
        
        print(sum(dist(s, int(input())) for i in range(m)))

def dist(s, o):
    i = bisect.bisect_right(s, o)
    return min(o- s[i - 1], s[i] - o)
        
if __name__=="__main__":
	main()


Measured memory_bytes: 10728
#pragma warning(disable:4996)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>

#pragma region 定義
#define i_cin(X) scanf("%d", &X)
#define i_cin2(X,Y) scanf("%d %d",&X,&Y)
#define i_cin4(X,Y,Z,W) scanf("%d %d %d %d",&X,&Y,&Z,&W)
#define i_cin3(X,Y,Z) scanf("%d %d %d",&X,&Y,&Z)
#define l_cin(X) scanf("%ld",&X)
#define f_cin(X) scanf("%f",&X)
#define l_cin2(X,Y) scanf("%ld %ld",&X,&Y)
#define s_cin(X) scanf("%s",&X)
#define c_cin(X) scanf("%c",&X);
#define ll_cin(X) scanf("%lld", &X)
#define ull_cin(X) scanf("%llu", &X)
#define lf_cin(X) scanf("%lf", &X)

#define  i_cout(X) printf("%d\n",X)
#define  f_cout(X) printf("%g\n",X)
#define  i_cout2(X,Y) printf("%d %d\n",X,Y)
#define  l_cout(X) printf("%ld\n",X)
#define  s_cout(X) printf("%s\n",X)

#define  c_cout(X) printf("%c",X)


#define  ll_cout(X) printf("%lld\n",X)
#define  ull_cout(X) printf("%llu\n",X)



typedef long long  ll;
typedef unsigned long long  ull;

#define rept(x, s, n) for (int x = s; x < n; x++)

#define S_RTN(S)  s_cout(S);return 0


#define _itoa(A,N) sprintf(A, "%d", N);

int i_cins(int n, int* A);
int l_cins2(int n, long* A, long* B);
int s_dsort(const void* a, const void* b);
int s_asort(const void* a, const void* b);

int  _gcd(int a, int b);
int  _swp(int* a, int* b);
int _cknum(char* a, int n);
int _atoi(char* s, int len);


int s_asorts(const void* a, const void* b);

//昇順
int s_asorts(const void* a, const void* b) {
	return(strcmp((char*)a, (char*)b));
}
int s_dsort(const void* a, const void* b) {
	return(*(int*)b - *(int*)a);
}
int s_asort(const void* a, const void* b) {
	return(*(int*)a - *(int*)b);
}
int l_cins2(int n, long* a, long* b) {
	int i;
	rept(i, 0, n) {
		l_cin2(*(a + i), *(b + i));
	}
	return 0;
}
int i_cins(int n, int* a) {
	int i;
	for (i = 0; i < n; i++) {
		i_cin(*(a + i));
	}

	return 0;
}
int _gcd(int a, int b) {
	int r, tmp;
	if (a < b) { tmp = a; a = b; b = tmp; }
	r = a % b;
	while (r) {
		if (!r) break;
		a = b; b = r;
		r = a % b;
	}
	return(b);
}

long _max(long a, long b) {
	return a > b ? a : b;
}
long _min(long a, long b) {
	return a < b ? a : b;
}
int _swp(int* a, int* b)
{
	int tmp;
	tmp = *b; *b = *a; *a = tmp;
	return 0;
}

int _cknum(char* a, int n) {
	int i;
	char t = '0';

	for (i = 0; i < n; i++) {
		if (a[i] < '0' || a[i]>'9') return 1;
	}
	return 0;
}


int _atoi(char* s, int len) {
	char tmp[20];
	memcpy(tmp, s, len);
	tmp[len] = 0x00;
	return (atoi(tmp));
}

#pragma endregion

//159-D
static int a[200001];
static ll c[200001];

int main(void) {
	int n,i;
	ll  t = 0;

	i_cin(n);
	
	for (i = 1; i <= n; i++) {
		i_cin(a[i]);
		c[a[i]] ++;
	}

	for(i=1;i<=n;i++){
		if (!c[i]) continue;
		t +=( c[i] * (c[i] - 1) / 2);
	}
	for (i = 1; i <= n; i++) 
		printf("%lld\n",t-(c[a[i]]-1));

	return 0;





}



//#define _N 1000000000

//int main(void)
//{
//
//	int  n,i;
//	ull   tmp=1;
//
//	i_cin(n);
//
//	for (i = 1; i <= n; i++) {
//		if (!(tmp % ((ull)_N + 7)))
//			tmp = 1;
//		tmp *= (ull)i;
//	}
//	tmp %= ((ull)_N + 7);
//		
//	ull_cout(tmp);
//	return 0;
//}



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

int	main()
{
	int64_t	X;
	cin >> X;
	int64_t	cur = 100;
	int64_t	year = 0;
	while (cur < X) {
		++year;
		cur += cur / 100;
	}
	cout << year << endl;
}


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

int main() {
  int A,B,C;
    cin >>A>>B>>C;
  
  if(A-B==0){
    cout<<C<<endl;
  }
  if(B-C==0){
    cout<<A<<endl;
  }
  if(A-C==0){
    cout<<B<<endl;
  }
  
}

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

constexpr int inf = 1e9;

int main() {
    int n, m; cin >> n >> m;
    vector<vector<int>> g(n);
    for(int i = 0; i < m; ++i) {
        int u, v; cin >> u >> v;
        g[u - 1].push_back(v - 1);
        g[v - 1].push_back(u - 1);
    }

    vector<vector<int>> d(n, vector<int>(2, inf));
    d[0][0] = 0;
    deque<tuple<int, int>> que;
    que.emplace_back(0, 0);
    while(!que.empty()) {
        int v, stable;
        tie(v, stable) = que.front(); que.pop_front();
        if(stable == 0) {
            for(auto to : g[v]) {
                if(d[to][0] == d[v][0]) { // change stable
                    d[v][1] = d[v][0];
                    que.emplace_back(v, 1);
                }
                if(d[to][0] == inf) {
                    d[to][0] = d[v][0] + 1;
                    que.emplace_back(to, 0);
                }
            }
        } else {
            for(auto to : g[v]) {
                if(d[to][1] != inf) continue;
                if((d[to][0] & 1) == (d[v][1] & 1)) {
                    d[to][1] = d[v][1];
                    que.emplace_front(to, 1);
                } else {
                    d[to][1] = d[v][1] + 1;
                    que.emplace_back(to, 1);
                }
            }
        }
    }

    int ans = 0;
    for(int i = 0; i < n; ++i) {
        ans = max(ans, d[i][1]);
    }

    cout << (ans == inf ? -1 : ans) << endl;
}



Measured memory_bytes: 15064
N = int(input())
A = list(map(int,input().split()))

A.sort()

i = 0

if N%2 == 1:
  if A[0] != 0:
    print(0)
    exit(0)
  i = 1

cnt = 0

while i < N:
  if i+1 == A[i] and i+1 == A[i+1]:
    cnt += 1
    i = i + 2
    continue
  else:
    print(0)
    exit(0)
    
ans = 1
for j in range(cnt):
  ans = ans * 2 % int(1e9 +7)
  
print(ans)

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


using namespace std;

#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for(ll i=st; i<ed; i++)
#define repn(i, st, ed) for(ll i=st; i<=ed; i++)
#define repb(i, ed, st) for(ll i=ed; i>=st; i--)
#define all(v) v.begin(),v.end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

typedef long long ll;
typedef unsigned long long int llt;
typedef long double ld;

const long double PI  =3.141592653589793238463;
const int N = 1e5 + 10;
const ll INF = 1LL << 60;

template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}



// Main Code

int main()
{
	ll n, x, d;
	cin>>n>>x>>d;
	if(d == 0)
	{
		if(x == 0) cout<<1<<endl;
		else cout<<n+1<<endl;
		return 0;
	}
	map<int, vector<pair<ll, ll>>> mp;
	rep(k, 0, n+1)
	{
		ll left = (k*(k-1)) / 2;
		ll right = (n*(n-1)) / 2 - ((n-k)*(n-k-1)) / 2;
		int rem = (k*x) % d;
		if(rem < 0) rem += d;
		mp[rem].pb({k*x/d + left, k*x/d + right});
	}
	ll ans = 0;
	for(auto z: mp)
	{
		auto v = z.s;
		vector<pair<ll ,ll>> vp;
		for(auto p: v)
		{
			vp.pb({p.f, 1});
			vp.pb({p.s+1, -1});
		}
		sort(all(vp));
		ll cnt = 0;
		ll pre = INF;
		for(auto p: vp)
		{
			if(cnt > 0) ans += p.f - pre;
			cnt += p.s;
			pre = p.f;
		}
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 22144
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int n,p[11],a,i,m;
	cin>>n;
	for(i=0;i<n;i++){
		cin>>p[i];	
	}
	sort(p,p+n,greater<int>());
	p[0]/=2;
	a=0;
	for(i=0;i<n;i++){
		a+=p[i];
	}
	cout<<a<<endl;
	return 0;
}	

Measured memory_bytes: 256
#include <iostream>
#include<cmath>
#include<stack>
#include<queue>
#include<string>
#include<algorithm>
using namespace std;


int main(){
    int n,q,t;
    cin>>n>>q;
    string name;
    queue<pair<string,int> > Q;
    for(int i=0;i<n;i++){
        cin>>name>>t;
        Q.push(make_pair(name,t));
        
    }
    int a;
    
    pair<string ,int> u;
    int elaps =0;
    while(!Q.empty()){
        u=Q.front();
        Q.pop();
        a=min(q,u.second);
        u.second-=a;
        elaps+=a;
        if(u.second>0){
            Q.push(u);
        }else{
            cout<<u.first<<" "<<elaps<<endl;
        }
        
        
    }
    
    
    
    return 0;
}



Measured memory_bytes: 6340
/*
 * 2397.cc: Three-way Branch
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_W = 75;

typedef long long ll;

const ll MOD = 1000000009;

/* typedef */

typedef vector<int> vi;
typedef map<ll,vi> mlvi;

template <typename T, const int N>
struct Matrix {
  int n;
  T m[N][N];

  Matrix(): n(0) {}
  Matrix(int _n): n(_n) {};

  void init() { memset(m, 0, sizeof(m)); }
  void unit() {
    init();
    for (int i = 0; i < n; i++) m[i][i] = 1;
  }
  void bidiag() {
    init();
    if (n == 1) m[0][0] = 1;
    else {
      m[0][0] = m[0][1] = 1;
      m[n - 1][n - 2] = m[n - 1][n - 1] = 1;
      for (int i = 1; i < n - 1; i++)
	m[i][i - 1] = m[i][i] = m[i][i + 1] = 1;
    }
  }

  Matrix<T,N> operator*(const Matrix<T,N>& m0) {
    Matrix<T,N> mm(n);
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) {
        mm.m[i][j] = 0;
        for (int k = 0; k < n; k++)
	  mm.m[i][j] = (mm.m[i][j] + (m[i][k] * m0.m[k][j] % MOD)) % MOD;
      }
    return mm;
  }

  Matrix<T,N> pow(T e) {
    Matrix<T,N> mm(n), m0 = *this;
    mm.unit();

    while (e > 0) {
      if (e & 1) mm = mm * m0;
      m0 = m0 * m0;
      e >>= 1;
    }
    return mm;
  }

  void print() {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) printf("%lld ", m[i][j]);
      putchar('\n');
    }
  }
};

typedef Matrix<ll,MAX_W> matrix;

/* global variables */

/* subroutines */

/* main */

int main() {
  for (int tn = 1;; tn++) {
    int w, n;
    ll h;
    cin >> w >> h >> n;
    if (w == 0) break;

    mlvi xys;
    
    for (int i = 0; i < n; i++) {
      int x;
      ll y;
      cin >> x >> y;
      x--, y--;
      if (y == 0) continue;

      mlvi::iterator mit = xys.find(y);
      if (mit == xys.end())
	xys[y].push_back(x);
      else
	mit->second.push_back(x);
    }

    matrix m(w), mb(w);
    m.unit();
    //m.print();
    mb.bidiag();
    ll cy = 0;
    
    for (mlvi::iterator mit = xys.begin(); mit != xys.end(); mit++) {
      vi &xs = mit->second;
      const ll &y = mit->first;

      if (y > cy + 1)
	m = mb.pow(y - cy - 1) * m;

      matrix mo = mb;
      for (int i = 0; i < xs.size(); i++) {
	int &x = xs[i];
	if (x > 0) mo.m[x][x - 1] = 0;
	mo.m[x][x] = 0;
	if (x < w - 1) mo.m[x][x + 1] = 0;
      }
      m = mo * m;

      cy = y;
    }

    if (h - 1 > cy)
      m = mb.pow(h - 1 - cy) * m;
    //m.print();
    
    printf("Case %d: %lld\n", tn, m.m[w - 1][0]);
  }

  return 0;
}

Measured memory_bytes: 1544
#include<bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
#define w1 first
#define w2 second
#define ls (x<<1)
#define rs (x<<1|1)
#define pb push_back
#define mid ((l+r)>>1)
#define SZ(x) ((x).size())
#define All(x) (x).begin(),(x).end()
#define rep(i,a,b) for(short (i)=(a);(i)<=(b);(i)++)
#define rep2(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define per(i,a,b) for(int (i)=(a);(i)>=(b);(i)--)
#define Rep(p,x) for(int (p)=head[(x)];(p);(p)=nxt[(p)])
template<class T>void read(T&num){
	num=0;T f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')num=num*10+ch-'0',ch=getchar();
	num*=f;
}
const int maxn=1e2+5;
short n,m,Ex,Ey;
short a[maxn][maxn],s[maxn][maxn];
short f[maxn][maxn][maxn][maxn];
char str[maxn][maxn];
short S(short x1,short x2,short y1,short y2){
	if(x1>x2||y1>y2)return 0;
	return s[x2][y2]-s[x2][y1-1]-s[x1-1][y2]+s[x1-1][y1-1];
}
#define max(x,y) ((x)>(y)?(x):(y))
short DP(short U,short D,short L,short R){
	if(U>D||L>R)return 0;
	short &res=f[U][D][L][R];
	if(res!=-1)return res;
	res=0;
	short Ub=D-(n-Ex),Db=U+(Ex-1),Lb=R-(m-Ey),Rb=L+(Ey-1);
	res=max(res,DP(U+1,D,L,R)+S(max(U,Ub),min(U,Db),max(L,Lb),min(R,Rb)));
	res=max(res,DP(U,D-1,L,R)+S(max(D,Ub),min(D,Db),max(L,Lb),min(R,Rb)));
	res=max(res,DP(U,D,L+1,R)+S(max(U,Ub),min(D,Db),max(L,Lb),min(L,Rb)));
	res=max(res,DP(U,D,L,R-1)+S(max(U,Ub),min(D,Db),max(R,Lb),min(R,Rb)));
	return res;
}
int main(){
	read(n);read(m);
	rep(i,1,n){
		scanf("%s",str[i]+1);
		rep(j,1,m)s[i][j]=s[i-1][j]+s[i][j-1]-s[i-1][j-1]+(str[i][j]=='o');
		rep(j,1,m)if(str[i][j]=='E')Ex=i,Ey=j;
	}
	rep(Lx,1,n)rep(Ly,1,m)rep(U,1,n-Lx+1)rep(L,1,m-Ly+1){
		short D=U+Lx-1,R=L+Ly-1,&res=f[U][D][L][R],Ub=D-(n-Ex),Db=U+(Ex-1),Lb=R-(m-Ey),Rb=L+(Ey-1);
		res=max(res,f[U+1][D][L][R]+S(max(U,Ub),min(U,Db),max(L,Lb),min(R,Rb)));
		res=max(res,f[U][D-1][L][R]+S(max(D,Ub),min(D,Db),max(L,Lb),min(R,Rb)));
		res=max(res,f[U][D][L+1][R]+S(max(U,Ub),min(D,Db),max(L,Lb),min(L,Rb)));
		res=max(res,f[U][D][L][R-1]+S(max(U,Ub),min(D,Db),max(R,Lb),min(R,Rb)));
	}
	cout<<f[1][n][1][m]<<endl;
	return 0;
}

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

int main() {
	// your code goes here
	int n,a=0,b=0,c=0,d=0;
	string s;
	cin>>n;
	while(n--)
	{
		cin>>s;
		if(s=="AC")
		a++;
		if(s=="WA")
		b++;
		if(s=="TLE")
		c++;
		if(s=="RE")
		d++;
		
	}
	cout<<"AC x "<<a<<endl;
	cout<<"WA x "<<b<<endl;
	cout<<"TLE x "<<c<<endl;
	cout<<"RE x "<<d<<endl;
	return 0;
}

Measured memory_bytes: 3616
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
using namespace std;

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=n;i>0;i--)
	{
	    double b;
		b=sqrt(i);
	    if(int(b)==b)
	    {
	   	  printf("%d\n",i);
	   	  return 0;
	    }
	}
}

Measured memory_bytes: 256
n, k = map(int, input().split())
a = list(map(int, input().split()))
b = [0]*n
for i in range(n):
    b[a[i]-1] += 1
c = [i for i in b if i != 0]
c.sort()
if len(c) - k > 0:
    print(sum((c[0:len(c)-k])))
else:
    print(0)

Measured memory_bytes: 32096
#include "bits/stdc++.h"
using namespace std;
int main() {
	int A, B;
	cin >> A >> B;
	if (A == 1) A = 14;
	if (B == 1) B = 14;
	if (A < B) {
		cout << "Bob" << endl;
	}
	else if (A == B) {
		cout << "Draw" << endl;
	}
	else {
		cout << "Alice" << endl;
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<string.h>
#include<queue>
#include<map>
#include<vector>
#include <cstdlib>
#include<algorithm>
#include <cstdio>
#include <cctype>
using namespace std;
const long long INF=10000000000000LL;
typedef long long ll;
typedef pair<ll,ll> P;
ll N,M,K=1;
ll T,a,b;
ll A,B,C,Q,l,r;
bool D[100005];
ll S[100005]={};
string str;
map<string,int> m;

int main(){
	cin>>A>>B;
	cout<<(A+B)%24<<endl;
	return 0;
}


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

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

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

constexpr int dx[4] = {-1, 0, 0, 1}, dy[4] = {0, -1, 1, 0};
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
constexpr long long LINF = 1e18;
constexpr double EPS = 1e-10;
constexpr double PI = M_PI;

void solve() {
    int N;
    cin >> N;
    vector<int> H(N);
    for (int i=0; i<N; ++i) cin >> H[i];
    int ans = 0, tmp = 0;
    for (int i=1; i<N; ++i) {
        if (H[i-1] >= H[i]) ++tmp;
        else {
            chmax(ans, tmp);
            tmp = 0;
        }
    }
    chmax(ans, tmp);
    cout << ans << endl;
}

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

    solve();

    return 0;
}


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

int main() {
	int sum;
	string s,t;
	cin>>s>>t;
	for(int i=0;i<3;i++){
		if(s[i]==t[i])
			sum++;
	}
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<set>
#include<stack>
using namespace std;

int N, a[50], b[50];
set<int> S;
vector<int> ans;

bool is_solvable(){
    bool edge[51][51] = {};
    for(int i = 0; i <= 50; i++){
        for(auto it = S.begin(); it != S.end(); it++){
            edge[i][i % (*it)] = true;
        }
    }
    /*for(int i = 0; i <= 50; i++){
        for(int j = 0; j <= 50; j++){
            cout << edge[i][j];
        }
        cout << endl;
        }*/
    bool solvable = true;
    for(int i = 0; i < N; i++){
        stack<int> st;
        bool visited[51] = {};
        st.push(a[i]);
        bool tmp = false;
        while(!st.empty()){
            int now = st.top();
            st.pop();
            visited[now] = true;
            if(now == b[i]){
                tmp = true;
            }
            for(int j = 0; j <= 50; j++){
                if(edge[now][j] && !visited[j]){
                    st.push(j);
                }
            }
        }
        //cout << a[i] << ", " << tmp << endl;
        solvable &= tmp;
    }
    return solvable;
}

int main(){
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> a[i];
    }
    for(int i = 0; i < N; i++){
        cin >> b[i];
    }
    for(int i = 1; i <= 50; i++){
        S.insert(i);
    }
    if(!is_solvable()){
        cout << -1 << endl;
        return 0;
    }
    for(int i = 50; i >= 1; i--){
        S.erase(i);
        if(!is_solvable()){
            ans.push_back(i);
            S.insert(i);
        }
    }
    long long ans = 0;
    for(auto it = S.begin(); it != S.end(); it++){
        //cout << *it << endl;
        ans += (1LL << (*it));
    }
    cout << ans << endl;

}


Measured memory_bytes: 256