akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
  #include "_DEBUG.hpp"
#endif
#define int long long
const int INF = 1LL << 60;

signed main(){

  int d, t, s; cin >>d >> t >> s;

  if(t * s >= d){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }

  return 0;
}

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

#define ll long long
#define fast_io ios::sync_with_stdio(0); cin.tie(0)
#define infl 1e18L+9
#define inf 1e9L+9
#define sz(a) ((int)a.size())
#define all(a) a.begin(),a.end()

const int mod=1e9L+7; 

void solve(){
  int n; cin>>n; 
  int b[n]; 
  int a[n]; 
  for(int i=0;i+1<n;i++){
    cin>>b[i]; 
  }
  b[n-1]=1e7; 
  int ans=0; 
  for(int i=0;i<n;i++){
    if(i>0)
      a[i]=min(b[i],b[i-1]); 
    else 
      a[i]=b[i]; 
    ans+=a[i]; 
  }
  cout<<ans<<endl; 
}

int main()
{
	fast_io;
	clock_t beg=clock(); 
	solve(); 
	clock_t end=clock(); 
	fprintf(stderr,"%.2lf sec\n",(double)(end-beg)/CLOCKS_PER_SEC); 
	return 0;
}

Measured memory_bytes: 256
/*
Á·Ï°Ìâ£ºOsenbei_AOJ 0525

×¢£º´ËÌâÓÃÁËbitset 
ÓÉÓÚÐÐ±È½ÏÉÙ£¬ËùÒÔÓÃdfsÈ·¶¨ÐÐµÄÇé¿öÖ®ºó£¬ÔÙ±éÀúÈ·¶¨×îÓÅµÄÁÐ¡£ 
*/
#include <cstdio>  
#include <algorithm>  
#include <bitset>  
  
using namespace std;  
  
const int MAX_R = 10;  
const int MAX_C = 10000;  
  
int R, C;  
bitset<MAX_C> a[MAX_R];  
  
int ans;  
  
void dfs(int k){  
    if(k == R){  
        //row certain  
        int result = 0;            //the max value of this condition
        for(int j = 0; j < C; j ++){  
            int upNum = 0;            //up numbers counting
            for(int i = 0; i < R; i ++){  
                if(a[i][j]) upNum++;  
            }  
            result += max(upNum, R-upNum);  //Whether filp or not, choose bigger one
        }  
        ans = max(ans, result);  
        return;  
    }  
    //without fliping  
    dfs(k + 1);  
    //flip  
    a[k].flip();  
    dfs(k + 1);  
  
}  
  
void solve(){  
    ans = 0;  
    dfs(0);  
    printf("%d\n", ans);  
}  
  
int main(int argc, char const *argv[]){  
  
    while(scanf("%d %d", &R, &C)){  
        if(R == 0 && C == 0) break;  
  
        for(int i = 0; i < R; i ++){  
            for(int j = 0; j < C; j ++){  
                bool tmp;  
                scanf("%d", &tmp);  
                a[i][j] = tmp;  
            }  
        }  
        solve();  
    }  
  
    return 0;  
}  


Measured memory_bytes: 2592
#include<iostream>
#include<map>
#include<string>

std::map<std::string,int> m;

int main()
{
	std::string s;
	std::getline( std::cin, s );
	
	int b = 0, e = 0;
	
	for( int i = 0; i < s.size(); i++ ){
		if( s[i] != ' ' ) e++;
		else{
			std::string s2 = s.substr( b, e - b );
			b = ++e;
			e = b;
			
		 	if( m.find( s2 ) != m.end() ){
				m.find( s2 )->second++;
			}
			else{
			 	m.insert( std::make_pair<std::string,int>( s2, 1 ) );
			}
		}
	}
	
	std::string s2 = s.substr( b, e - b + 1 );
	if( m.find( s2 ) != m.end() ){
		m.find( s2 )->second++;
	}
	else{
	 	m.insert( std::make_pair<std::string,int>( s2, 1 ) );
	}
	
	int len = 0, count = 0;
	for( std::map<std::string,int>::iterator it = m.begin(); it != m.end(); it++ ){
		count = std::max( count, it->second );
		len = std::max( len, (int)it->first.size() );
	}
	
	for( std::map<std::string,int>::iterator it = m.begin(); it != m.end(); it++ ){
		if( count == it->second ){
			std::cout << it->first << " ";
		}
	}
	for( std::map<std::string,int>::iterator it = m.begin(); it != m.end(); it++ ){
		if( len == it->first.size() ){
			std::cout << it->first << std::endl;
		}
	}
	
 	return 0;
}

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

#define REP(i, n) for(int i = 0; i < n; i++)
#define int long long
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    ll uoo = M / N;
    ll ans = 0;
    for (int i = uoo; i >= 1; --i) {
        if(M % i != 0){
            continue;
        }
        if(M / i >= N){
            ans = i;
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll; 

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define test() int t;cin>>t;while(t--)
#define all(v) v.begin(),v.end()
#define prinp(p) cout<<p.first<<" "<<p.second<<endl
#define prinv(V) for(auto v:V) cout<<v<<" ";cout<<endl
#define take(V,f,n) for(int in=f;in<f+n;in++) cin>>V[in]
#define what(x) cerr<<#x<<" = "<<x<<endl
#define KStest() int t,t1;cin>>t;t1=t;while(t--)
#define KScout cout<<"Case #"<<t1-t<<": "
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MOD = 1e9+7,MAX = 1e6+5;
const ll INF = 1e18+5;

int main()
{
	int k;
	cin>>k;
	if(k%2==0||k%5==0) cout<<-1<<endl;
	else
	{
		int curr = 7;
		int step = 1;
		while(curr%k)
		{
			curr*=10;
			curr+=7;
			curr%=k;
			step++;
		}
		cout<<step<<endl;
	}
}	

Measured memory_bytes: 3636
#include "bits/stdc++.h"

#define REP(i,n) for(ll i=0;i<n;++i)
#define RREP(i,n) for(ll i=n-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<n;++i)
#define RFOR(i,m,n) for(ll i=n-1;i>=m;--i)
#define ALL(v) (v).begin(),(v).end()
#define PB(a) push_back(a)
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(i, (v).size()) { cout << v[i]; if (i != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }
///(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)///
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	while (1) {
		int h, w;
		cin >> h >> w;
		if (!h)break;
		vector<string> v(h);
		REP(i, h)cin >> v[i];
		set<string> st;
		string ans = "";
		REP(i, h) {
			REP(j, w) {
				REP(k, 8) {
					int ni = i, nj = j;
					string s;
					s += v[i][j];
					REP(l, INF) {
						if (!st.insert(s).second) {
							if (ans.size() < s.size())ans = s;
							else if (ans.size() == s.size() && ans > s)ans = s;
						}
						ni = (ni + dx[k] + h) % h, nj = (nj + dy[k] + w) % w;
						if (ni == i&&nj == j)break;
						s += v[ni][nj];

					}
				}
			}
		}
		if (ans.size() <= 1)cout << 0 << endl;
		else cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 35676
#include<stdio.h>
#include<string.h>
char s[101111];
int main() {
    scanf("%s",s);
    int n = strlen(s);
    int cnt1=0,cnt2=0;
    for(int i=0;i<n;++i) {
        if(s[i]-'0' == i%2) {
            cnt1++;
        }else {
            cnt2++;
        }
    }
    printf("%d\n",cnt1<cnt2?cnt1:cnt2);
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
using ll = long long;
using ull = unsigned long long;
using namespace std;
#define int long long
#define CONTAINS_VEC(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
#define CONTAINS_SET(m, a) (m).find((a)) != m.end()
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }

signed main()
{
	int N, T;
	cin >> N >> T;

	int ans = INT_MAX;
	REP(i, N)
	{
		int c, t;
		cin >> c >> t;

		if (t <= T)
		{
			ans = min(ans, c);
		}
	}

	if (ans == INT_MAX)
	{
		cout << "TLE" << endl;
	}
	else
	{
		cout << ans << endl;
	}
}



Measured memory_bytes: 3120
import java.util.*;

public class Main{
    static int N;
    static int P;
    static int[] A;
    static long count;
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        N = sc.nextInt();
        P = sc.nextInt();
        A = new int[N];
        long odd = 0;
        for(int i = 0; i < N; i++){
            A[i] = sc.nextInt();
            if(A[i] % 2 == 0){}
            else
                odd++;
        }
        sc.close();

        if(odd == 0 && P == 0)
            System.out.println((long)Math.pow(2,N));
        if(odd == 0 && P == 1)
            System.out.println(0);
        if(odd != 0)
            System.out.println((long)Math.pow(2, N-1));
        
        
    }
}

Measured memory_bytes: 21844
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    int n; cin>>n;
    vector<int> ans(n,0);
    rep(i,n){
        int a; cin>>a;
        ans[a-1]=i+1;
    }
    rep(i,n) printf("%d ",ans[i]);
    printf("\n");
}


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

/* using */
using namespace std;

/* main constructor */
struct Fast
{
    Fast()
    {
        std::cin.tie(0);
        ios::sync_with_stdio(0);
        //cout << fixed << setprecision(12);
    }
} fast;

/* template */
template <class T>
bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0; }
template <class T>
bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0; }

/* define */
#define REP(i, x, n) for (int i = x; i < (int)(n); ++i)
#define RREP(i, x, n) for (int i = x - 1; i >= (int)(n); --i)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) REP(i, 1, n + 1)
#define rrep(i, n) RREP(i, n, 0)
#define each(i, n) for (auto &i : n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define eunique(x) \
    sort(all(x));  \
    (x).erase(unique(all(x)), (x).end())
#define int long long
#define mp make_pair
#define r0 return 0

/* function */
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }

/* const */
const int inf = 1e9 + 7;
const int dxl[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dyl[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dxs[4] = {1, 0, -1, 0};
const int dys[4] = {0, 1, 0, -1};

/* main */
signed main(void)
{
    string a;
    string b;
    cin >> a >> b;
    a += b;
    int n= stoi(a);
    int num = sqrt(n);
    if (n == pow(num, 2))
    {
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    return 0;
}


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

int main() {
  string S, T; cin >> S >> T;
  int ans = 2000;
  rep(i, S.size() - T.size() + 1) {
    int temp = 0;
    rep(j, T.size()) {
      if (S[i+j] != T[j]) temp++;
    }
    ans = min(ans, temp);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3144
_,K,*A=`dd`.split.map &:to_i
d=Hash.new(0)
A.map{|i|d[i]+=1}
l=d.to_a.sort{|a,b|a[1]<=>b[1]}
r=0
(d.size-K).times.map{|i|r+=l[i][1]}
p r

Measured memory_bytes: 44128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
 
#define ALL(obj) (obj).begin(),(obj).end()
#define SPEED cin.tie(0);ios::sync_with_stdio(false);
 
template<class T> using PQ = priority_queue<T>;
template<class T> using PQR = priority_queue<T,vector<T>,greater<T>>;
 
constexpr long long MOD = (long long)1e9 + 7;
constexpr long long MOD2 = 998244353;
constexpr long long HIGHINF = (long long)1e18;
constexpr long long LOWINF = (long long)1e15;
constexpr long double PI = 3.1415926535897932384626433;
 
template <class T> vector<T> multivector(size_t N,T init){return vector<T>(N,init);}
template <class... T> auto multivector(size_t N,T... t){return vector<decltype(multivector(t...))>(N,multivector(t...));}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
template <class T> void chmax(T& a, const T b){a=max(a,b);}
template <class T> void chmin(T& a, const T b){a=min(a,b);}
void YN(bool flg) {cout << (flg ? "YES" : "NO") << endl;}
void Yn(bool flg) {cout << (flg ? "Yes" : "No") << endl;}
void yn(bool flg) {cout << (flg ? "yes" : "no") << endl;}

int main() {
	string S; cin >> S;
	for(int i = 0; i < S.size(); ++i) {
		cout << 'x';
	}
	cout << endl;

    return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const mod = 1000000007

// 1MB
const ioBufferSize = 1 * 1024 * 1024

var sc = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	sc.Split(bufio.ScanWords)
	return sc
}()

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func max(x ...int) int {
	m := x[0]
	for i := 1; i < len(x); i++ {
		if m < x[i] {
			m = x[i]
		}
	}

	return m
}

func main() {
	a, b, c := nextInt(), nextInt(), nextInt()

	m := max(a, b, c)
	if m%2 == (a+b+c)%2 {
		fmt.Println((3*m - a - b - c) / 2)
	} else {
		fmt.Println((3*(m+1) - a - b - c) / 2)
	}
}


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

int main() {
    int  n;
    cin >> n; 
    vector<int>arr(n);

    for (int i = 0; i < n; ++i)
    {
        cin >> arr[i];
    }
    int sum{ 0 };
    vector<int>dp(n,0);
    dp[0] = 0;
    dp[1] = abs(arr[1] - arr[0]);
    for(int i = 2; i < n; ++i)
    {
        dp[i] = INT_MAX;
        for (int j = i - 1; j >= i - 2; j--)
        {
            dp[i] = min(dp[i], abs(arr[i] - arr[j]) + dp[j]);
        }
    }
    cout << dp[n-1];
}

Measured memory_bytes: 3900
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
    int d;
    cin >> d;
    vector<int> c(26);
    for (int i = 0; i < 26; i++)
        cin >> c[i];
    vector<vector<int>> s(d, vector<int>(26));
    for (int i = 0; i < d; i++)
        for (int j = 0; j < 26; j++)
            cin >> s[i][j];
    
    vector<int> t(d);
    vector<int> last(26, 0);
    for (int i = 1; i <= d; i++) {
        int mx = -1000000000, ti = 0;
        for (int k = 0; k < 26; k++) {
            int sd = s[i-1][k];
            for (int l = 0; l < 26; l++) {
                if (l == k)
                    continue;
                sd -= c[l] * (i - last[l]);
            }
            if (sd > mx) {
                mx = sd;
                ti = k;
            }
        }
        last[ti] = i;
        t[i-1] = ti;
    }
    
    for (int i = 0; i < d; i++)
        cout << t[i]+1 << endl;
    
    return 0;
}


Measured memory_bytes: 3680
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {($($a:expr),*) => {println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
#[allow(unused_macros)]
macro_rules! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);
impl<T: PartialEq> Eq for Total<T> {}
impl<T: PartialOrd> Ord for Total<T> { fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering { self.0.partial_cmp(&other.0).unwrap() }}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;


fn main() {
    input! {
        x: i32,
        a: i32,
        b: i32,
    }

    println!("{}", (x-a)-((x-a)/b*b));

}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int N=3005,inf=0x3f3f3f3f;
const ld PI=3.1415926535897932384626;
int read(){
	int f=1,g=0;
	char ch=getchar();
	for (;!isdigit(ch);ch=getchar()) if (ch=='-') f=-1;
	for (;isdigit(ch);ch=getchar()) g=g*10+ch-'0';
	return f*g;
}
int n,L,a[N];
ld b[N],ansx,ansy;
int main(){
//	freopen("balance.in","r",stdin);
//	freopen("balance.out","w",stdout);
	n=read();L=read();
	for (int i=1;i<=n;i++) a[i]=read();
	for (int i=1;i<=n;i++)
	for (int j=i+1;j<=n;j++)
	if (i!=j){
		ansx+=(n+i*2-j*2)*cosl(PI*(a[i]+a[j])/L);
		ansy+=(n+i*2-j*2)*sinl(PI*(a[i]+a[j])/L);
	}
	ll s=(ll)n*(n-1)*(n-2)/6;
	ansx/=s;ansy/=s;
	printf("%.12Lf %.12Lf\n",ansx,ansy);
	return 0;
}

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

int main() {
  string s,t;
  cin >> s >> t;
  sort(s.begin(),s.end());
  sort(t.begin(), t.end(), greater<int>());
  if(s < t) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mid ((s + e) / 2)
#define makefast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define comp(x) (lower_bound(vec.begin(), vec.end(), x) - vec.begin())
long long M = 1e9 + 7;
//>>>>>>>>>>>>>>>>>>>
#define int long long
const int N = 5e3 + 7;

int dp[N * N];
int s;
int a[4], b[4];

int32_t main() {
	makefast;
	cin >> s;
	for (int i = 1; i <= 3; i++)
		cin >> a[i];
	for (int i = 1; i <= 3; i++)
		cin >> b[i];
	dp[0] = 0;
	for (int i = 1; i <= s; i++) {
		dp[i] = i;
		for (int j = 1; j <= 3; j++)
			if (i >= a[j])
				dp[i] = max(dp[i], dp[i - a[j]] + b[j]);
	}
	s = dp[s];
	dp[0] = 0;
	for (int i = 1; i <= s; i++) {
		dp[i] = i;
		for (int j = 1; j <= 3; j++)
			if(i >= b[j])
				dp[i] = max(dp[i], dp[i - b[j]] + a[j]);
	}
	cout << dp[s];
	return 0;
}


Measured memory_bytes: 195584
#include <stdio.h>

int main(void)
{
  int i,x;
  int n;

  scanf("%d",&n);

  for(i=1; i<=n; i++){ 
    if(i % 3 == 0){
      printf(" %d",i);
    }
    for(x=i; x>0; x=x/10){
      if((x % 10 == 3)&&(i % 3 != 0)){
	printf(" %d",i);
	break;
      }    
    }
  }
  
  puts("");
  
  return(0);
}

Measured memory_bytes: 608
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
 
  int left = a + b;
  int right = c + d;
  
  if(left > right)
  {
    cout << "Left" << endl;
  }
  else if(left == right)
  {
    cout << "Balanced" << endl;
  }
  else
  {
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 384
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
int main(){
  char S[11];
  int max=0;
  int len;
  scanf("%s",S);
  for(int i = 0;S[i] != '\0';i++){
    len = 0;
    for(int j = i;S[j] != '\0';j++){
      if(S[j] != 'A'&& S[j] != 'T'&&S[j] != 'C'&&S[j] != 'G') break;
      len++;
    }
    if(max < len) max = len;
  }
  printf("%d\n",max);
  return 0;
}

Measured memory_bytes: 128
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>
#include <string>
using namespace std;

int main()
{
    int a,b;
    
    int k;
    
    cin >> a>>b>>k;
    
    for(int i=0; i<k; i++){
        if(i%2==0){
            if(a%2==1)a--;
            b += a/2;
            a /=2;
        }
        else{
            if(b%2==1)b--;
            a += b/2;
            b /= 2;
        }
        
    }
    
    cout << a << " " <<b << endl;
    return 0;
}


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

using namespace std;

using ll = long long;
const int limit = 100010;
using edge = struct {
    int to;
    ll cost;
};
vector <edge> tree[limit];
ll depth[limit];

void dfs(int v, int p, ll d) {
    depth[v] = d;
    for (auto &e : tree[v]) {
        if (e.to == p) continue;
        dfs(e.to, v, d + e.cost);
    }
}


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

    for (int i = 0; i < n - 1; ++i) {
        int a, b, c;
        cin >> a >> b >> c;
        a--, b--;
        tree[a].push_back({b, c});
        tree[b].push_back({a, c});
    }

    int q, k;
    cin >> q >> k;
    k--;

    dfs(k, -1, 0);
    for (int i = 0; i < q; ++i) {
        int x, y;
        cin >> x >> y;
        x--, y--;
        cout << depth[x] + depth[y] << endl;
    }

    return 0;
}


Measured memory_bytes: 14336
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <tuple>
#include <utility>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
const int INF = 1000000000;
const int MOD = 1000000007;
int main(){
	int a,b,c;
	cin >> a >> b >> c;
	cout << a * b / 2 << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;

void solve() {
  string s;
  cin >> s;
  int ret = 0;
  for(int i = 0; i < s.size(); i++) ret += s[i] == '2';
  cout << ret << endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t N;
  cin >> N;
  map<int64_t, int64_t> uniq;
  // map<int, int> uniq;
  for (int64_t i = 0; i < N; i++) {
    int64_t x;
    cin >> x;
    if (uniq.count(x) == 0) {
      uniq[x] = 0;
    }
    uniq[x]++;
  }
  vector<int64_t> search;
  unordered_set<int64_t> notdiv;
  for (auto x : uniq) {
    search.push_back(x.first);
    notdiv.insert(x.first);
  }
  int64_t maxnum = search[search.size() - 1];
  for (auto s : search) {
    for (int64_t i = 2;; i++) {
      int64_t v = s * i;
      if (v > maxnum) {
        break;
      }
      if (notdiv.count(v) > 0) {
        notdiv.erase(v);
      }
    }
  }
  int64_t result = 0;
  for (auto nd : notdiv) {
    if (uniq.at(nd) == 1) {
      result++;
    }
  }
  cout << result << endl;
}


Measured memory_bytes: 25676
//  [amitdu6ey]
// g++ -std=c++11 -o2 -Wall filename.cpp -o filename
#include <bits/stdc++.h>
#define hell 1000000009
#define bug1(x) cout<<"$ "<<x<<" $"<<endl
#define bug2(x) cout<<"% "<<x<<" %"<<endl
#define bug3(x) cout<<"# "<<x<<" #"<<endl
#define ll long long
#define pb push_back
#define mp make_pair
#define tr(z) for(auto it=z.begin(); it!=z.end(); it++)
#define rloop(i,a,b) for(long long i=a; i>=b;i--)
#define loop(i,a,b) for(long long i=a; i<b; i++)
#define vbool vector< bool >
#define vvbool  vector< vector<bool> >
#define vchar vector<char>
#define vi vector<int>
#define vvi vector< vector<int> >
#define pll pair<long long, long long>
#define vll vector<long long>
#define vvl vector< vector<long long> >
#define ninf numeric_limits<long long>::min()
#define pinf numeric_limits<long long>::max()
#define comp(a,b) (abs(a-b)<1e-9) // to compare doubles
using namespace std;

ll a[100009][3];
ll dp[100009][3];
ll n;


ll f(ll x, ll l){
    if(dp[l][x]!=0) return dp[l][x];
    else if(l>=n)    return 0;
    else if(x==0)    return dp[l][x]=a[l][x]+max(f(1,l+1),f(2,l+1));
    else if(x==1)    return dp[l][x]=a[l][x]+max(f(0,l+1),f(2,l+1));
    else if(x==2)    return dp[l][x]=a[l][x]+max(f(0,l+1),f(1,l+1));
}

void solve(){
    cin>>n;
    loop(i,0,n){
        loop(j,0,3){
            cin>>a[i][j];
        }
    }
    loop(i,0,10009){
        loop(j,0,3){
            dp[i][j]=0;
        }
    }
    cout<<max({f(0,0), f(1,0), f(2,0)})<<"\n";
    return;
}

int main(){
    ios_base::sync_with_stdio(0);
    cout.tie(0);
    cin.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int test_cases=1;
    //cin>>test_cases;
    while(test_cases--){
      solve();
    }
    return 0;
}


Measured memory_bytes: 9600
import java.util.Scanner;
public class Main{
	static public void main(String[] args){
		m1();
	}
	static public void m1(){
		Scanner scanner = new Scanner(System.in);

		String s = scanner.next();
	  	String result;
		if(s.endsWith("s")){
			result = s + "es";
		}else{
			result = s + "s";
		}
		System.out.println(result);

	}
	static public void m2(){
	}
}


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

#define REP(i, n) for(int64_t i = 0; i < n; i++)
#define REPR(i, n) for(int64_t i = n; i >= 0; i--)
#define FOR(i, m, n) for(int64_t i = m; i < n; i++)
#define FORR(i, m, n) for(int64_t i = m; i >= n; i--)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill( (T*)array, (T*)(array+N), val );
}
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;}
const ll INF= 1ll << 60;
const ll MOD = 1000000007;
double EPS = 1e-10;
//----------------------------------------------------------

int H, W, N;

int main(){
    cin >> H >> W >> N;
    int cnt=0;
    int ans=0;
    if(H < W){
        for(int i=1;i<=H;i++)
        {
        ans = i*W;
        cnt++;
        if(ans >= N)break;
        }
    }
    else{
        for(int i=1;i<=W;i++)
        {
        ans = i*H;
        cnt++;
        if(ans >= N)break;
        }
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
def main():
    input = sys.stdin.readline
    N,K,Q=map(int, input().split())
    *A,=map(int, input().split())

    ans=10**10
    from heapq import heappop, heappush
    A.append(-1)
    for y in A:
        if y==-1: break
        c=[]
        t=[]
        for a in A:
            if a >= y:
                heappush(t, a)
            else:
                for _ in range(len(t)-(K-1)):
                    heappush(c, heappop(t))
                t=[]
        if len(c) < Q: continue
        x=[heappop(c) for _ in range(Q)][-1]
        ans = min(ans, x-y)
    print(ans)

if __name__ == '__main__':
    main()

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

int main() {
  int n, mx = 0;
  string s;
  cin >> n;
  map<string, int> m;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    ++m[s];
    if (m[s] > mx) mx = m[s];
  }
  for (auto p : m) {
    if (p.second == mx) cout << p.first << endl;
  }
}

Measured memory_bytes: 25216
from math import tan, degrees, cos, sin, atan
a, b, x = map(int, input().split())
x = x/(a**2)

if x < b/2:
  alpha = degrees(atan((b**2)/(2*a*x)))
elif x > b/2:
  alpha = degrees(atan((2*b - 2*x)/a))
else:
  alpha = degrees(atan(b/a))

print(alpha)

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

#define ll long long
#define ull unsigned long long
#define mii make_pair<int, int>
#define mll make_pair<ll, ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define all(v) (v).begin(), (v).end()

ofstream out("debug.txt");

const int MxN = 1e5, md = 1e9 + 7;

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

    int n;
    cin >> n;
    vl v(n), dp(n, 0);
    for (auto &a : v)
        cin >> a;
    dp[0] = v[0];
    for (int i = 1; i < v.size(); ++i)
        dp[i] = (dp[i - 1] + v[i]) % md;
    ll sum = 0;
    for (int i = 0; i < n - 1; ++i)
        sum = (sum + ((dp[n - 1] - dp[i] + md) % md * v[i]) % md) % md;
    cout << sum << '\n';
}

Measured memory_bytes: 6336
using System;
using System.Collections.Generic;
using System.Linq;


namespace AtC
{
    class Program
    {
        static void Main(string[] args)
        {
            var b = Console.ReadLine()[0];

            switch (b)
            {
                case 'A':
                    Console.WriteLine('T');
                    break;
                case 'C':
                    Console.WriteLine('G');
                    break;
                case 'G':
                    Console.WriteLine('C');
                    break;
                case 'T':
                    Console.WriteLine('A');
                    break;
            }
        }
    }
}

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



int main(){
    int k, s;
    cin >> k >> s;
    int ans = 0;
    rep(i, k+1){
        rep(j, k+1){
            int m = s - i- j;
            if(0 <= m && m <= k) ans++;
        }
    }
    cout << ans << "\n";
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
	int H=0;
	int W=0;

	do{
		scanf("%d %d",&H,&W);
		if(H*W==0)break;
		for(int i=0;i<H;i++){
			for(int j=0;j<W;j++){
				if((i+j)%2==0){
					printf("#");
				}
				else{
					printf(".");
				}
			}
			puts("");
		}
		puts("");
	}while(H*W!=0);

	return 0;
}



Measured memory_bytes: 2108
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main()
{
	int N;
	cin >> N;
	vector<int> A(N), B(N), C(N);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> B[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> C[i];
	}
	sort(B.begin(), B.end());
	sort(C.begin(), C.end());
	vector<ll> cnt(N), sum(N + 1);
	for (int i = 0; i < N; i++) {
		cnt[i] = C.end() - upper_bound(C.begin(), C.end(), B[i]);
		sum[i + 1] = sum[i] + cnt[i];
	}
	ll res = 0;
	for (int i = 0; i < N; i++) {
		int id = upper_bound(B.begin(), B.end(), A[i]) - B.begin();
		res += sum[N] - sum[id];
	}
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 2944
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(),v.end()
#define repf(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define MOD 998244353 

using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

ordered_set<ll> ors;

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

ll power(ll a, ll n, ll m)
{
    ll ans=1;
    while(n)
    {
        if(n&1) ans=(ans*a)%m;
        n>>=1;
        a=(a*a)%m;
    }
    return ans;
}

ll invmod(ll a, ll m)
{
    return power(a,m-2,m);
}

ll lp[100001];
vector<ll> pr;

void prime()
{
    repf(i,1,100001) lp[i]=i;
    repf(i,2,100001)
    {
        if(lp[i]==i)
        {
            for(ll j=2*i;j<100001;j+=i)
            {
                if(lp[j]==j) lp[j]=i;
            }
        }
    }
    repf(i,2,100001) if(lp[i]==i) pr.pb(i);
}


void solve(ll tt) {
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    ll x=max(a,b),y=max(c,d);
    ll ans=x*y;
    y=min(c,d);
    ans=max(ans,x*y);
    x=min(a,b);
    ans=max(ans,x*y);
    y=max(c,d);
    ans=max(ans,x*y);
    cout<<ans<<endl;
} 


int main()
{
    IOS;
    prime();
    ll t=1;
    // cin>>t;
    repf(tt,1,t+1) {
        solve(tt);
    }
}     

Measured memory_bytes: 4560
#include<stdio.h>

int main (void)
{
  int i,j,H,W;

  while (1) {
    scanf("%d",&H);
    scanf("%d",&W);
    if (W == 0 && H == 0) break;
    for (i = 0; i < H; i++) {
      for (j = 0; j < W; j++) {
	if ((i + j) % 2 == 0) printf("#");
	else printf(".");
      }
      printf("\n");
    }
    printf("\n");
  }  
  
  return 0;
}

Measured memory_bytes: 572
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N; cin >> N;
  vector<double> x(N);
  vector<string> u(N);
  for(int i=0;i<N;i++){
    cin >> x[i] >> u[i];
  }
  double cnt=0;
  for(int i=0;i<N;i++){
    if(u[i] == "JPY"){
      cnt += x[i];
    }else{
      cnt += x[i]*380000;
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <climits>
#include <sstream>
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 vector<int> dx = {1, 0};
const vector<int> dy = {0, 1};
const long long INF = 1LL<<60;
int H, W;
vector<string> fi;

long long solve(){
    vector<vector<long long>> dp(H, vector<long long>(W,INF));
    
    if(fi[0][0] == '#')dp[0][0] = 1;
    else dp[0][0] = 0;
    
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W;j++){
            for(int dir = 0; dir < 2; dir++){
                int ni = i + dx[dir], nj = j + dy[dir];
                if(ni >= H || nj >= W)continue;
                int add = 0;
                if(fi[ni][nj] == '#' && fi[i][j] == '.')add = 1;
                chmin(dp[ni][nj],dp[i][j] + add);
            }
        }
    }
    return dp[H-1][W-1];
}



int main(){
    
    cin >> H >> W;
    fi.resize(H);
    for(int i = 0; i < H ; i++)cin >> fi[i];
    cout << solve() << endl;
    
}

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

int main(){
	int cnt = 0;
	bool* isPrime = new bool[10000000];
	isPrime[0] = isPrime[1] = false;
	for(int i = 2; i < 10000000; i++){
		isPrime[i]=true;
	}
	for(int i = 2; i*i < 10000000; i++){
		if(isPrime[i]){
			for(int j = i*i; j < 10000000; j += i){
				isPrime[j] = false;
			}
		}
	}
	while(true){
		int n;
		cin >> n;
		if(cin.eof() || n == 0){
			break;
		}
		for(int i = n; i >= 13; i--){
			if(isPrime[i] && isPrime[i-2] && isPrime[i-6] && isPrime[i-8]){
				cout << i << endl;
				break;
			}
		}
	}
	delete[] isPrime;
	return 0;
}


Measured memory_bytes: 10768
#include <iostream>
#include <stdio.h>
using namespace std;

int main()
{
    int n,m,sum=0,i,les=100;
    int ax[100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&m);
        sum += m;
        if(m%10!=0&&m<les){
            les = m;
        }
    }
    if(sum%10!=0){
        printf("%d",sum);
        return 0;
    }
    if(les==100){
        printf("0");
        return 0;
    }
    printf("%d",sum-les);
    return 0;
}


Measured memory_bytes: 256
import math

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

x = a*12.5
y = b*10

if x >= y:
	if x < y+10:
		ans = math.ceil(x)
	else:
		ans = -1
else:
	if y < x + 12.5:
		ans = math.ceil(y)
	else:
		ans = -1

print(ans)


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

#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 reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))

using namespace std;

using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); return a / gcd(a, b) * b; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

void solve() {
  int h, w;
  cin >> h >> w;
  vstr a(h);
  cin >> a;
  vstr out(h);
  rep(i, h) out[i] = string(w, '-');
  vi32 cnt(26);
  rep(i, h) rep(j, w) cnt[a[i][j] - 'a']++;
  rep(i, h) rep(j, w) {
    set<pair<int, int>> se;
    se.emplace(i, j);
    se.emplace(i, w - j - 1);
    se.emplace(h - i - 1, j);
    se.emplace(h - i - 1, w - j - 1);
    int c = 0;
    each(p, se) {
      if (out[p.first][p.second] == '-') c++;
    }
    if (c == 0) continue;
    bool ok = false;
    rep(k, 26) {
      if (cnt[k] == 0) continue;
      if (c == 1 && cnt[k] % 4 == 1 ||
          c == 2 && cnt[k] % 4 == 2 ||
          c == 4 && cnt[k] % 4 == 0) {
        ok = true;
        cnt[k] -= c;
        each(p, se) {
          out[p.first][p.second] = (char) (k + 'a');
        }
        break;
      }
    }
    if (ok) continue;
    rep(k, 26) {
      if (cnt[k] >= c) {
        ok = true;
        cnt[k] -= c;
        each(p, se) {
          out[p.first][p.second] = (char) (k + 'a');
        }
        break;
      }
    }
    if (!ok) no();
  }
  yes();
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include<time.h>
using namespace std;
typedef long long int llint;
typedef vector<int> vint;
typedef vector<llint> vllint;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<llint, llint>> vpllint;
#define rep(i,n) for(int i=0;i<n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define yes(ans) if(ans)cout<<"yes"<<endl;else cout<<"no"<<endl;
#define Yes(ans) if(ans)cout<<"Yes"<<endl;else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl;else cout<<"NO"<<endl;
#define POSSIBLE(ans) if(ans)cout<<"POSSIBLE"<<endl;else cout<<"IMPOSSIBLE"<<endl;

class UnionFind {
public:
	//親の番号を格納する。親だった場合は-(その集合のサイズ)
	vector<int> Parent;

	//作るときはParentの値を全て-1にする
	//こうすると全てバラバラになる
	UnionFind(int N) {
		Parent = vector<int>(N, -1);
	}

	//Aがどのグループに属しているか調べる
	int root(int A) {
		if (Parent[A] < 0) return A;
		return Parent[A] = root(Parent[A]);
	}

	//自分のいるグループの頂点数を調べる
	int size(int A) {
		return -Parent[root(A)];//親をとってきたい
	}

	//AとBをくっ付ける
	bool connect(int A, int B) {
		//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
		A = root(A);
		B = root(B);
		if (A == B) {
			//すでにくっついてるからくっ付けない
			return false;
		}

		//大きい方(A)に小さいほう(B)をくっ付けたい
		//大小が逆だったらひっくり返しちゃう。
		if (size(A) < size(B)) swap(A, B);

		//Aのサイズを更新する
		Parent[A] += Parent[B];
		//Bの親をAに変更する
		Parent[B] = A;

		return true;
	}
};

//aとbの最大公約数を求めるよ
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

// 返り値: a と b の最大公約数
// ax + by = gcd(a, b) を満たす (x, y) が格納される
long long extGCD(long long a, long long b, long long& x, long long& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}

bool check(int a, int b) {
	return a > b;
}

int main() {
	int n;
	cin >> n;
	vector<vector<int>>a(n, vector<int>(3));
	rep(i, n) {
		rep(j, 3) {
			cin >> a[i][j];
		}
	}
	int tmp;
	for (tmp = 0; tmp < n; tmp++) {
		if (a[tmp][2] != 0) {
			break;
		}
	}
	int high;
	rep(i, 101) {
		rep(j, 101) {
			high = a[tmp][2] + abs(a[tmp][0] - i) + abs(a[tmp][1] - j);
			rep(k, n) {
				int hh;
				hh = high - abs(a[k][0] - i) - abs(a[k][1] - j);
				if (hh <= 0) {
					hh = 0;
				}
				if (hh != a[k][2]) {
					break;
				}
				if (k == n - 1) {
					cout << i << " " << j << " " << high << endl;
					return 0;
				}
			}
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
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; }
// ---------------------------------------------------------------------------

bool uruu(int year){
    if(year % 4 == 0) {
        if (year % 100 == 0) {
            return year % 400 == 0;
        }else{
            return true;
        }
    }else{
        return false;
    }
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    vector<int> month = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    vector<vector<int>> G(14, vector<int> (10));
    vector<int> t = {6,2,5,5,4,5,6,3,7,6};
    for(int i=0; i<14; i++){
        G[i] = t;
    }
    vector<vector<int>> _(7);
    _[0] = {0,2,3,5,6,7,8,9};
    _[1] = {0,4,5,6,8,9};
    _[2] = {0,1,2,3,4,7,8,9};
    _[3] = {2,3,4,5,6,8,9};
    _[4] = {0,2,6,8};
    _[5] = {0,1,3,4,5,6,7,8,9};
    _[6] = {0,2,3,5,6,8,9};
    int N;
    cin >> N;
    int K;
    cin >> K;
    set<pair<int,int>> se;
    for(int i=0; i<K; i++){
        int a,b;
        cin >> a >> b;
        if(se.count(P(a,b))) continue;
        for(int j=0; j<_[b].size(); j++){
            G[a][_[b][j]]--;
        }
        se.insert(P(a,b));
    }
    vector<ll> time_num(50,0);
    for(int i=0; i<24; i++){
        for(int j=0; j<60; j++){
            for(int k=0; k<60; k++){                
                int sum = 0;
                sum += G[8][i/10];
                sum += G[9][i%10];
                sum += G[10][j/10];
                sum += G[11][j%10];
                sum += G[12][k/10];
                sum += G[13][k%10];
                time_num[sum]++;
            }
        }
    }
    // for(int i=0; i<50; i++){
    //     cout << time_num[i] << "\n";
    // }
    ll ans = 0;
    for(int y=0; y<10000; y++){
        for(int m=1; m<=12; m++){
            bool uru = (m==2 and uruu(y));
            for(int d=1; d<=month[m]+uru; d++){
                int sum = 0;
                int year = y;
                sum += G[0][year/1000];
                year %= 1000;
                sum += G[1][year/100];
                year %= 100;
                sum += G[2][year/10];
                sum += G[3][year%10];
                sum += G[4][m/10];
                sum += G[5][m%10];
                sum += G[6][d/10];
                sum += G[7][d%10];
                if(sum > N) continue;
                if(N-sum > 50) continue;
                ans += time_num[N-sum];
            }
        }
    }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 3224
#define _USE_NATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <random>
#include <tuple>


using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
#define EPS 1e-9
const int INF = 1050000000;
const long long LINF = 1LL << 60;
const ll MOD = 1e9 + 7;
const int MINF = -1050000000;

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


int main() {
	
	string s;
	cin >> s;
	rep(i, 3) {
		if (s[i] == '7') {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 3624
#include <stdio.h>
#include <iostream>
using namespace std;
typedef long long ll;
const int N=305,mod=998244353;
int a[N];
ll f[N*N],g[N*N];
int main(){
	int n,i,j,m=0;
	ll ans=0,pw=1;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]),m+=a[i],pw=pw*3%mod;
	f[0]=g[0]=1;
	for(i=1;i<=n;i++)
		for(j=m;j>=0;j--){
			f[j]=f[j]*2%mod;
			if(j>=a[i]) f[j]=(f[j]+f[j-a[i]])%mod,g[j]=(g[j]+g[j-a[i]])%mod;
		}
	for(i=(m+1)/2;i<=m;i++)
		if(i*2==m) ans=(ans+f[i]*3-g[i]*3)%mod;
		else ans=(ans+3*f[i])%mod;
	cout<<(pw-ans+mod)%mod;
	return 0;
}


Measured memory_bytes: 1664