akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<algorithm>
using namespace std;

#define   M             100005
#define   ll            long long
#define   PI            atan(1.0)*4
#define   mst(x,v)      memset(x,v,sizeof(x))
#define   inf           (int)1e9

typedef   pair<int,int> P;

ll a[M],b[M];


int main() {

	ll n,temp;
	ll pst=0,ngt=0;
	scanf("%lld",&n);
	
	for(int i=0;i<n;i++) scanf("%lld",&a[i]);
	for(int i=0;i<n;i++) scanf("%lld",&b[i]);
	
	ll f=0;
	
	for(int i=0;i<n;i++) {
		temp=b[i]-a[i];
		
		if(temp>0) f+=temp/2;
		if(temp<0) f+=temp;
	}
	
	
	if(f>=0)    puts("Yes");
	else        puts("No"); 
//	printf("%d\n",f);
}


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

int a[10100],answer=0,n;

int main()
{
  cin>>n;
  for(int i=1; i<=2*n; i++)
    cin>>a[i];
  sort(a+1,a+1+2*n);
  for(int i=1; i<=2*n; i+=2)
    answer+=a[i];
  cout<<answer<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>
#include <set>
#include <map>

using namespace std;

typedef long long ll;

int main()
{
  string s;
  cin >> s;
  if (s.size() % 2) s += " ";
  for (int i = 0; i < s.size(); ++i) {
    char want = 'h';
    if (i % 2) want = 'i';
    if (s[i] != want) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long long qp(long long a, long long b) {
	long long res = 1;
	while (b) {
		if (b & 1)
			res = res * a % mod;
		a = a * a % mod;
		b >>= 1;
	}
	return res;
}
struct Matrix {
	int mat[2][2];
	Matrix() {
		mat[0][0] = mat[0][1] = mat[1][0] = mat[1][1] = 0;
	}
	Matrix operator * (const Matrix &oth) const {
		Matrix res;
		for (int i = 0; i < 2; i++)
			for (int k = 0; k < 2; k++)
				for (int j = 0; j < 2; j++)
					res.mat[i][j] = (res.mat[i][j] + 1ll * mat[i][k] * oth.mat[k][j]) % mod;
		return res;
	}
};
Matrix mp(Matrix a, long long b) {
	Matrix res;
	res.mat[0][0] = res.mat[1][1] = 1;
	while (b) {
		if (b & 1)
			res = res * a;
		a = a * a;
		b >>= 1;
	}
	return res;
}
int n, m, c_lr, c_ud, c_b, c_n_lr, c_n_ud;
char s[1005][1005];
long long K;
int main() {
	scanf("%d%d%lld", &n, &m, &K);
	if (!K) {puts("1"); return 0;}
	for (int i = 1; i <= n; i++) {
		scanf(" %s", s[i] + 1);
		for (int j = 1; j <= m; j++)
			if (s[i][j] == '#')
				c_b++;
	}
	for (int i = 1; i <= n; i++) {
		if (s[i][1] == '#' && s[i][m] == '#') c_lr++;
		for (int j = 1; j < m; j++)
			if (s[i][j] == '#' && s[i][j + 1] == '#') c_n_lr++;
	}
	for (int j = 1; j <= m; j++) {
		if (s[1][j] == '#' && s[n][j] == '#') c_ud++;
		for (int i = 1; i < n; i++)
			if (s[i][j] == '#' && s[i + 1][j] == '#') c_n_ud++;
	}
	if (c_lr && c_ud) {puts("1"); return 0;}
	if (!c_lr && !c_ud) {printf("%lld\n", qp(c_b, K - 1)); return 0;}
	if (c_ud) {c_lr = c_ud; c_n_lr = c_n_ud;}
	Matrix matrix;
	matrix.mat[0][0] = c_lr; matrix.mat[0][1] = c_n_lr;
	matrix.mat[1][0] = 0; matrix.mat[1][1] = c_b;
	matrix = mp(matrix, K - 1);
	printf("%d\n", (matrix.mat[1][1] - matrix.mat[0][1] + mod) % mod);
	return 0;
}

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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

int main(){
  int h,w,n; cin>>h>>w>>n;
  int sr, sc;cin>>sr>>sc;
  string s,t;cin>>s>>t;

  vector<string> cc = {"UD", "DU", "LR", "RL"};

  rep(i, 4){
    char ct=cc[i][0], ca=cc[i][1];
    int csr=sr, csc=sc;  
    rep(j, n){
      if(ct=='U' || ct=='D'){

        if(s[j]==ct) if(ct=='U')csr--;else csr++;
        if(csr==0 || csr==h+1) { cout<<"NO"<<endl; return 0; }
        if(t[j]==ca)if(ca=='U'){
          csr--; csr = max(csr, 1);
        }else{
          csr++; csr = min(csr, h);
        }

      }else{

        if(s[j]==ct) if(ct=='L')csc--;else csc++;
        if(csc==0 || csc==w+1) { cout<<"NO"<<endl; return 0; }
        if(t[j]==ca)if(ca=='L'){
          csc--; csc=max(csc, 1);
        }else{
          csc++; csc = min(csc, w);
        }

      }
    }
  }

  cout<<"YES"<<endl;

  return 0;
}


Measured memory_bytes: 776
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		String[] sW = W.split(" ");

		int A = Integer.parseInt(sW[0]);
		int B = Integer.parseInt(sW[2]);
		long ans = 0;
		if("+".equals(sW[1])){
			ans = A+B;
		}else{
			ans = A-B;
		}
		System.out.println(ans);
	}




}


Measured memory_bytes: 21972
import sys
class Tree():
    def __init__(self):
        self.root = None
    def insert(self, key):
        z = Node(key)
        y = None
        x = self.root
        while x:
            y = x
            if z.key < x.key:
                x = x.left
            else:
                x = x.right
        z.parent = y
        if y == None:
            self.root = z
        elif z.key < y.key:
            y.left = z
        else:
            y.right = z
    def print(self):
        print('',' '.join(map(str, self.root.inwalk())))
        print('',' '.join(map(str, self.root.prewalk())))
     
class Node():
    def __init__(self, key):
        self.key = key
        self.parent = self.left = self.right = None
    def prewalk(self):
        ret = [self.key]
        if self.left:
            ret += self.left.prewalk()
        if self.right:
            ret += self.right.prewalk()
        return ret
    def inwalk(self):
        ret = []
        if self.left:
            ret += self.left.inwalk()
        ret += [self.key]
        if self.right:
            ret += self.right.inwalk()
        return ret
tree = Tree()
n = sys.stdin.readline()
for line in sys.stdin:
    if line[0] == 'i':
        tree.insert(int(line.split()[1]))
    else:
        tree.print()


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

int main() {
    string t;
    cin >> t;
    int n = t.size();
    for (int i = 0; i < n; i++){
        if(t[i] == '?'){
            cout << 'D';
        } else {
            cout << t[i];
        }
    }
    cout << endl;
}

Measured memory_bytes: 3748
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <deque>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <set>
#include <map>


//マクロ
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
#define REPS(i,n) for(int i=1; i<=(int)(n); ++i)
#define RREP(i,n) for(int i=(int)(n)-1; i>=0; --i)
#define RREPS(i,n) for(int i=(int)(n); i>0; --i)
#define FOR(i,s,e) for(int i=(int)(s); i<(int)(e); ++i)
#define RFOR(i,s,e) for(int i=(int)(e)-1; i>=(int)(s); --i)
#define All(a) (a).begin(),(a).end()
#define RAll(a) (a).rbegin(),(a).rend()
#define dump(x)  cerr << #x << " = " << (x) << endl;

//定数
#define INF 1e9
#define INFL 1e18
#define MOD (int)(1e9+7)

typedef long long ll;
typedef unsigned long long ull;
/*
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
//*/
using namespace std;
using Graph = vector<vector<int>>;

//とりあえず書いておく変数
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

//今回の変数


//使用する関数
template<class T>bool chmax(T &a, const T &b) {
	if (a < b) { a = b; return 1; }
	return 0;
}
template<class T>bool chmin(T &a, const T &b) {
	if (a > b) { a = b; return 1; }
	return 0;
}



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

	int a, b, c;
	cin >> a >> b >> c;
	cout << c <<" "<< a << " " << b << endl;

}

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

int main() {
  string str;
  cin >> str;
  string ans = "No";
  for (int i = 0; i < str.size()-1; i++) {
    if (str.at(i) == 'C') {
      for (int j = i+1; j < str.size(); j++) {
        if (str.at(j) == 'F') {
          ans = "Yes";
        }
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m;i<n;i++)
#define c(n) cin>>n
#define co(n) cout<<n<<endl
using namespace std;

int main(){
  long a,b=2,c=0,d=0,e,n,m=0;
  string s="No";
  cin >> n;
  rep(i,0,100){
    rep(j,0,100){
      if(4*i+7*j==n) s="Yes";
    }
  }
  co(s);
    
  return 0;
}

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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n;
    cin >> n;
    cout << n * n << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
typedef long long ll;
#define mod 1000000007
int cnt[26];
ll dp[26];
char s[maxn];
int main()
{
	int n;
	scanf("%d",&n);scanf("%s",s);
	for(int i=0;i<n;i++)cnt[s[i]-'a']++;
	dp[0]=cnt[0]+1;
	for(int i=1;i<26;i++)
		dp[i]=dp[i-1]*(cnt[i]+1)%mod;
	printf("%lld\n",(dp[25]-1+mod)%mod);
	return 0;
}

Measured memory_bytes: 384
#include <iostream>

using namespace std;

int main () {
    int n;
    int a[200];

    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];

    int cnt = 0;
    while (true) {
        
        bool flag = false;
        for (int i = 0; i < n; i++) {
            if (a[i] % 2 != 0) {
                flag = true;
                break;
            }
        }

        if (flag) break;

        for (int i = 0; i < n; i++) {
            a[i] /= 2;
        }
        cnt++;
    }

    cout << cnt << endl;
}

Measured memory_bytes: 256
import java.util.*;
import java.lang.*;

class Main {
    public static void main (String[] args)  {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        String S = scanner.next();
        int numOccurences = 0;
        for (int i=0;i<N;i++){
            if (S.charAt(i)=='A'&&(i+2)<N){
                if (S.charAt(i+1)=='B'&&S.charAt(i+2)=='C'){
                    numOccurences++;
                }
            }
        }
        System.out.println(numOccurences);
    }
}



Measured memory_bytes: 23252
N, Y = map(int, input().split())

def main():
    for num_10000 in range(Y//10000+1):
        for num_5000 in range(N+1-num_10000):
            num_1000 = N - num_10000 - num_5000
            if num_10000*10000 + num_5000*5000 + num_1000*1000 == Y:
                print(num_10000, num_5000, num_1000)
                return
    print('-1 -1 -1')

if __name__ == "__main__":
    main()

Measured memory_bytes: 3060
#include <stdio.h>

int main(void)
{
	int a[3];
	int i;
	int c;

	scanf("%d %d %d", &a[0], &a[1], &a[2]);

	for (i = 0; i < 3; i++){
		if (a[i] == 5){
			c++;
		}
		else if (a[i] == 7){
			c = c + 2;
		}
	}
	if (c == 4){
		printf("YES\n");
	}
	else {
		printf("NO\n");
	}

	return (0);
}




Measured memory_bytes: 128
fun main(args: Array<String>) {
  val sc = if (args.size > 1) java.util.Scanner(java.io.File(args[1])) else java.util.Scanner(System.`in`)
  solve(sc)
}

var ct = 0
var cx = 0
var cy = 0

fun solve(sc: java.util.Scanner) {
  (1..sc.nextInt()).forEach {
    if (!solveOne(sc)) {
      println("No")
      return
    }
  }
  println("Yes")
}

private fun solveOne(sc: java.util.Scanner): Boolean {
  val t = sc.nextInt()
  val x = sc.nextInt()
  val y = sc.nextInt()
  val dt = t - ct
  val d = (x - cx).abs() + (y - cy).abs()
  if (dt < d || (dt % 2) != (d % 2)) {
    return false
  }
  ct = t
  cx = x
  cy = y
  return true
}

private fun Int.abs() = if (this < 0) -this else this


Measured memory_bytes: 95564
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>
#include <set>
#include <map>

using namespace std;

typedef long long ll;

int FindPrefix(string s, string t) {
  int i = 0;
  while (i < s.size() && i < t.size() && s[i] == t[i]) i++;
  return i;
}

int main()
{
  string s;
  cin >> s;
  string t = "keyence";
  int prefix = FindPrefix(s, t);
  reverse(s.begin(), s.end());
  reverse(t.begin(), t.end());
  int suffix = FindPrefix(s, t);
  cout << (prefix + suffix >= t.size() ? "YES" : "NO") << endl;
  return 0;
}


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

int main(){
  int n,p;
  int prime[200000];

  for(int i=0;i<200000;i+=2)prime[i] = 0;
  for(int i=1;i<200000;i+=2)prime[i] = 1;
  prime[1] = 0;
  prime[2] = 1;

  int c = 3;
  while(c*c<200000){
    for(int i=3*c;i<200000;i+=c)prime[i] = 0;
    while(!prime[++c]);
  }

  while(1){
    cin >> n >> p;
    if(n<0 && p<0)break;

    vector<int> e;
    for(int i=0;i<p;i++){
      while(!prime[++n]);
      e.push_back(n);
    }

    vector<int> c;
    for(int i=0;i<(int)e.size();i++){
      for(int j=i;j<(int)e.size();j++){
	c.push_back(e[i] + e[j]);
      }
    }

    sort(c.begin(),c.end());
    cout << c[p-1] << endl;
  }
}

Measured memory_bytes: 1748
#include <stdio.h>
int ans[200000];
int main(void){
    int n,i,x;
    scanf("%d",&n);
    for(i=0;i<n-1;i++){
        scanf("%d",&x);
        ans[x-1]++;
    }
    for(i=0;i<n;i++){
        printf("%d\n",ans[i]);
    }
    return 0;
}

Measured memory_bytes: 2516
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include<math.h>
using namespace std;


int main() {
  int N,A;
  int c = 0;
  int cpre;
  cin >> N;
  for(int i=0;i<N;i++){
    cin >> A;
    while(A%2==0){
      c += 1;
      A /= 2;
    }
    if(i==0){
      cpre = c;
    }
    if(cpre >= c){
      cpre = c;
    }
    c = 0;
  }
  cout << cpre << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int a;
		int b;
		while(true) {
			a=sc.nextInt();
			b=sc.nextInt();
			if(a==0&&b==0) {
				break;
			}
			System.out.println(Math.min(a, b)+" "+Math.max(a, b));
		}
	}

}


Measured memory_bytes: 36136
cards = {'S': set(), 'H': set(), 'C': set(), 'D': set()}
n = int(raw_input())
for i in range(n):
    pattern, rank = map(str, raw_input().split())
    cards[pattern].add(int(rank))
result = list(cards['S'].symmetric_difference(set(range(1, 14))))
for i in result:
    print("S " + str(i))
result = list(cards['H'].symmetric_difference(set(range(1, 14))))
for i in result:
    print("H " + str(i))
result = list(cards['C'].symmetric_difference(set(range(1, 14))))
for i in result:
    print("C " + str(i))
result = list(cards['D'].symmetric_difference(set(range(1, 14))))
for i in result:
    print("D " + str(i))

Measured memory_bytes: 6376
#include <stdio.h>

int m[101][101];
int p[101];

int main()
{
  int n,i,j,k,l,q;
  scanf("%d",&n);
  
  for(i=1;i<=n;i++)
    {
      scanf("%d",&p[i-1]);
      scanf("%d",&p[i]);
    }

  for(i=1;i<=n;i++){m[i][i]=0;}
  for(l=2;l<=n;l++)
    {
      for(i=1;i<=n-l+2;i++)
	{
	  j=i+l-1;
	  m[i][j]=1000000;
	  for(k=i;k<=j-1;k++)
	    {
	      q=m[i][k]+m[k+1][j]+(p[i-1]*p[k]*p[j]);
	      if(m[i][j]>q){m[i][j]=q;}
	    }
	}
    }
  printf("%d\n",m[1][n]);
  return 0;
}
  



Measured memory_bytes: 2112
function Main(input) {
    var H = parseInt(input[0], 10);
    var N = parseInt(input[1], 10);
    var A = input.slice(2).map(a => parseInt(a, 10));

    var sum = 0;

    for (var i = 0; i < N; i++) {
        sum += A[i];
    }

    console.log(sum >= H ? 'Yes' : 'No');
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));

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

int main() {
    string s;
    cin >> s;
    int cnt1 = 0; 
    int cnt2 = 0;
    char a = '0';
    for(int i = 0; i < (int)s.size(); i++)
    {
        if (s.at(i) == a) cnt1++;
        else cnt2++;

        if (a == '0') a = '1';
        else a = '0';
    }
    cout << min(cnt1, cnt2) << endl;
}

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

using namespace std;

int main() {
	int n;
	cin >> n;
	int arr[n];
	for (int i = 0; i < n; i++) {
	    cin >> arr[i];
	}
	int res = 0;
	for (int i = 0; i < n; i++) res = __gcd(res, arr[i]);
	cout << res;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define repa(i,a,n) for(int i=a;i<=n;i++)
#define repb(i,a,n) for(int i=a;i>=n;i--)
#define trav(a,x) for(auto a=x.begin();a!=x.end();a++)
#define all(x) x.begin(),x.end()
#define fst first
#define snd second
#define pb push_back
#define mp make_pair
typedef long double ld;
typedef pair <int,int> pii;
typedef vector <int> vi;
typedef long long ll;


void solve()
{
	int d,t,s;
	cin>>d>>t>>s;
	if(s*t>=d)
	{
		cout<<"Yes"<<endl;
	}else
	{
		cout<<"No"<<endl;
	}
}
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ll t=1;
	//cin>>t;
    for(int i=0;i<t;i++)
    {
		//cout<<"Case #"<<i+1<<":"<<endl;
		solve();
	}
    return 0;
}


Measured memory_bytes: 3660
#include <bits/stdc++.h>
#define endl        '\n'
#define pi          2*acos(0.0)
#define pb(a)       push_back(a)
#define db          double
#define ld          long double
#define ll          long long
#define ull         unsigned long long
#define mod         1000000007
#define inf         1000000000000000001
#define sqr(x)      (x) * (x)
#define gcd(a, b)   __gcd(a, b)
#define lcm(a, b)   ((a/gcd(a,b)) * b)
#define debug(x) 	cerr << #x << " = " << (x) <<endl
#define all(x)      (x).begin(), (x).end()
#define unsyncIO    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)


using namespace std;

int main()
{
    //freopen("/home/taalpatar_shepai/Documents/my_codes/out.txt", "w", stdout);
    unsyncIO;
    ll a,t,ans;
    db b;
    cin >> a >> b;
    t = b * 100 + 0.5;
    ans = (a * t) / 100;
    cout << ans << endl;
    //printf("%.0Lf", truncl(a * b));

    return 0;
}

Measured memory_bytes: 3748
//                   ********** YATIN KWATRA **********

// AC BAKSHI RABBA

#include <bits/stdc++.h>
#define ll                      long long 
#define ld                      long double
#define ull                     unsigned long long 
#define FIO                     ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl                    "\n"
#define fo(i,a,b)               for(int i = a; i<=b ; i++)
#define rfo(i,a,b)              for(int i = a; i>=b ; i--)
#define vii                     vector<int>
#define vll                     vector<ll>
#define pq                      priority_queue
#define uom                     unordered_map                
#define all(v)                  v.begin(),v.end()
#define mp                      make_pair
#define pb                      push_back
#define pob                     pop_back
#define ff                      first
#define ss                      second
#define pii                     pair<int,int> 
#define pll                     pair<long,long>
#define mll                     map<ll,ll>
#define mii                     map<int,int>
#define vvii                    vector<vii>
#define vvll                    vector<vll>
#define mod                     1000000007
#define pi                      3.1415926535897932384626433832795

using namespace std;

void INPUT() 
{  
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

/*
    
   -> Check For Overflows
   -> Out of Bounds
   -> Initialisations of global arrays and variables
   -> Its not Always Complex, Try to simplify
   -> write it down and try to solve
   -> Have Faith in urself and in ur approach
   -> If it seems totally out of reach, switch to next :)
   -> And Come Back later, if possible 
*/



int cnt,n,m,k;

void solve()
{ 
  
    cin >> n >> m >> k;

    vector<vector<char>> v(n+1,vector<char>(m+1));

    fo(i,0,n-1)
    {
      fo(j,0,m-1) cin >> v[i][j];
    }

    ll ans = 0LL;
    ll blck = 0;


    fo(i,0,(1<<n)-1)
    {
      fo(j,0,(1<<m)-1)
      {
        blck = 0;

        fo(p,0,n-1)
        {
          fo(q,0,m-1)
          {
            if(!(i&(1<<p)) and !(j&(1<<q)) and v[p][q] == '#') blck++;  
          }
        }

        if(blck == k) ans++;
      }
    }

    cout << ans << endl;
       
}
int main() {
    
    FIO
    INPUT();
    
    int t;
    t = 1;
  //  cin >> t;
    
    while(t--)
    {
       solve();
    }
    return 0;
}


Measured memory_bytes: 3660
# coding: utf-8
# Your code here!

input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]

input_line = input()
Line2 = input_line.split()
Line2 = [int(s) for s in Line2]

tokuhyou = sum(Line2) / 4 / Line[1]

Line2.sort(reverse=True)

# print(Line2[Line[1]-1],tokuhyou)


if Line2[Line[1]-1] >= tokuhyou:
    print("Yes")
else:
    print("No")

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

int main(){
  long long N, K;
  cin >> N >> K;
  vector<long long> A(N);
  vector<long long> perm(N);
  for (int i=0;i<N;i++){
    cin >> A[i];
    perm[i] = i;
  }
  vector<long long> V = A;
  vector<long long> p(N, 0);
  vector<long long> v(N, 0);
  while (K != 0){
    if (K % 2 == 1){
      for (int i=0;i<N;i++){
        p[i] = 0;
        p[i] = perm[V[i]-1];
      }
      for (int i=0;i<N;i++){
        perm[i] = p[i];
      }
    }
    for (int i=0;i<N;i++){
      v[i] = 0;
      v[i] = V[V[i]-1];
    }
    for (int i=0;i<N;i++){
      V[i] = v[i];
    }
    K /= 2;
  }
  cout << perm[0]+1 << endl;
  return 0;
}

Measured memory_bytes: 11180
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder();
 
            while (true)
            {
                string input = Console.ReadLine();
 
                if (string.IsNullOrEmpty(input)) break;
 
                int[] nums = Array.ConvertAll(input.Split(' '), int.Parse);
                string sum = (nums[0] + nums[1]).ToString();
                sb.AppendLine(sum.Length.ToString());
            }
            Console.Write(sb);
        }
    }
}

Measured memory_bytes: 9080
N=int(input())
S=input()
rgb={"R":0,"G":0,"B":0}
for s in S:
    rgb[s]+=1
sum=rgb["R"]*rgb["G"]*rgb["B"]

for i in range(0,N-2):
    for interval in range(1,(N-i+1)//2):
        if S[i]!=S[i+interval] and S[i+interval]!=S[i+2*interval] and S[i]!=S[i+2*interval]:
            sum-=1
print(sum)

Measured memory_bytes: 9152
n,k,c = map(int, input().split())
s = input()
sr = s[::-1]
lcnt = [0]*n
rcnt = [0]*n

last_i = -10**8
cnt = 0
for i in range(n):
    if s[i] == 'o' and i - last_i > c:
        cnt += 1
        last_i = i
    lcnt[i] = cnt


last_i = -10**8
cnt = 0
for i in range(n):
    if sr[i] == 'o' and i - last_i > c:
        cnt += 1
        last_i = i
    rcnt[i] = cnt
rcnt = rcnt[::-1]


for i in range(n):
    if s[i] == 'x': continue
    if i > 0: l = lcnt[i-1]
    else: l = 0
    if i < n-1: r = rcnt[i+1]
    else: r = 0
    if l+r < k:
        print(i+1)


Measured memory_bytes: 80060
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int K = reader.nextInt();
		int ans = 0;
		while (N > 1) {
			N -= K - 1;
			ans++;
		}

		reader.close();
		System.out.print(ans);
	}
}



Measured memory_bytes: 22612
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let mut s = read_as_string().chars().collect::<Vec<char>>();

    s[3] = '8';

    for i in 0..s.len(){
        print!("{}", s[i]);
    }
    println!("");
}


Measured memory_bytes: 4352
#include<iostream>
#include<vector>
#include<cassert>
#include<string>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<tuple>
#include<numeric>
using namespace std;

typedef pair<int,int> pii;
typedef long long ll;
typedef ll int__;
#define rep(i,j) for(int__ i=0;i<(int__)(j);i++)
#define repeat(i,j,k) for(int__ i=(j);i<(int__)(k);i++)
#define all(v) v.begin(),v.end()

template<typename T>
ostream& operator << (ostream &os , const vector<T> &v){
    rep(i,v.size()) os << v[i] << (i!=v.size()-1 ? " " : "\n"); return os;
}

template<typename T>
istream& operator >> (istream &is , vector<T> &v){
    rep(i,v.size()) is >> v[i]; return is;
}


bool solve(){
    int n, m; cin >> n >> m;
    vector<int> a(m); cin >> a;
    int ans = max(a[0] - 1, n - a.back());
    rep(i, m-1){
        ans = max(ans, (a[i+1] - a[i]) / 2);
    }
    cout << ans << endl;
    return false;
}

int main(){
    ios::sync_with_stdio(false);
    while(solve());
    return 0;
}

Measured memory_bytes: 3252
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
int n,T;
vector<int> M,L,K;
bool check(int x){
  int cnt = 0;
  vector<int> call(n,0);
  vector<int> compute = M;
  vector<int> used(n,0);

  for(int t=0;t<=T;t++){

    for(int i=0;i<n;i++) if(used[i] && compute[i] && --compute[i] == 0) cnt--;
    for(int i=0;i<n;i++) if(t-call[i] == L[i] + K[i]) call[i] = t; 
    
    for(int i=0;i<n && cnt < x ;i++){
      if(used[i]) continue;
      if(t - call[i] <= L[i]) used[i] = 1,cnt++;
    }
  }
    
  for(int i=0;i<n;i++) if(compute[i] > 0) return 0;
  return 1;
}

  
signed main(){
  while(1){
    int sum = 0;
    cin>>n>>T;
    if( n == 0 && T == 0) break;
    M.clear(),L.clear(),K.clear();
    M.resize(n),L.resize(n),K.resize(n);
    for(int i=0;i<n;i++) cin>> M[i]>>L[i]>>K[i],sum += M[i];
    
    //for(int i=0;i<=n;i++) cout<<i<<" "<<check(i)<<endl;

    int ans = sum / T;
    for(;check(ans) == 0;ans++);
    cout<<ans<<endl;
  }
    
  return 0;
}

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

using namespace std;
#define int long long
#define pb push_back 

int n;
vector<int> h;
int dp[100001];
int v[100001];

int s1(int i){
	if(i==n-1){
		return abs(h[n]-h[i]);
	}
	// if(i==n-2){
	// 	return min(abs(h[n]-h[n-2]), abs(h[n-1]-h[n-2])+abs(h[n-1]-h[n-2]));
	// 	// return abs(h[n]-h[n-2]);
	// }
	if(i==n){
		return 0;
	}
	if(v[i]){
		return dp[i];
	}

	v[i]=1;

	int thing1 = abs(h[i+1]-h[i])+ s1(i+1);
	int thing2 = abs(h[i+2]-h[i])+ s1(i+2);

	dp[i] = min(thing2, thing1);
	return dp[i];

}

signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	h.resize(n+1);
	h[0]=0;	
	for(int i=1; i<=n; i++){
		cin>>h[i];
	}		

	cout<<s1(1)<<'\n';
}


Measured memory_bytes: 7296
#include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
using namespace std;

int main()
{
    int H, W, N;
    cin >> H >> W >> N;
    vector<int> a(N);
    REP(i, N) cin >> a[i];
    a.insert(a.begin(), 0);

    vector<vector<int> > c(H, vector<int>(W, 0));

    int index = 1;
    for (int i = 0; i < H; i++) {
        if (i % 2 == 0) {
            for (int j = 0; j < W; j++) {
                c[i][j] = index;
                if (--a[index] == 0)
                    index++;
            }
        } else {
            for (int j = W - 1; j >= 0; j--) {
                c[i][j] = index;
                if (--a[index] == 0)
                    index++;
            }
        }
    }

    REP(i, H) {
        REP(j, W) {
            printf("%d ", c[i][j]);
        }
        printf("\n");
    }
}


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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define P pair<int,int>
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define possible(n) cout << ((n) ? "possible" : "impossible"  ) << endl
#define Size(n) (n).size()

typedef long long ll;

using namespace std;

const int INF = 1e9,MOD = 1e9 + 7;
const ll LINF = 1e18;

//long long int kaizyo(long long int hh){
  //  cmp=1;
    //while(hh>1){
      //  cmp=(cmp*hh)%MOD;
        //hh--;
    //}
    //return cmp;
//}
//long long int ruizyo(long long int aa, long long int bb){
  //  if(aa==0){
    //    return 1;
    //}
    //else if(aa%2==0){
      //  long long int tt=ruizyo(aa/2,bb);
        //return (tt*tt)%MOD;
    //}
    //else{
      //  return (ruizyo(aa-1,bb)*bb)%MOD;
    //}
//}フェルマ－のア


//while(x!=0){
            //sum+=x%10;
           // x/=10;
        //}
        //各桁の和

//pair<int,int> p[100000];
//P r[100000];
//cin >> tmp;
//p[i]=make_pair(tmp,i);
//cout << p[i].second+1 << endl;//ペアの右側つまりiを出力

//s.find(w[i])==string::npos
//findの使い方

//for(int i=0;i<n;i++){
   // b[i]=x%2;
    //x/=2;
  //}二進数

//bool f[100001];//1000000以下の素数を調べよう！
//rrep(i,2,100001){
  //      f[i]=false;
    //}
//rrep(i,2,100001){
  //      if(!f[i]){
    //        for(int j=i+i;j<=100000;j+=i){
      //          f[j]=true;
        //    }
        //}
    //}
    //for(int i=3;i<=100000;i+=2){
      //  if(!f[i]){
        //    c[i]++;
      //  }
   // }

//visited=vector<vector<bool>>(10,vector<bool>(10,false));アを全部falseに


long long int n,cnt=0,ans=0,a,b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl=true;

//-------------------------↓↓↓↓↓↓----------------------------

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

       cin >> n;
       pair <int,int> p[200];
       pair <int,int> pp[200];
       rep(i,n){
           cin>>a>>b;
           p[i]=make_pair(b,a);
       }
       rep(i,n){
           cin>>a>>b;
           pp[i]=make_pair(a,b);
       }
       sort(p,p+n);
       reverse(p,p+n);
       sort(pp,pp+n);
       //rep(i,n){
         //  cout << p[i].first << " " << p[i].second << endl;
       //}
       rep(i,n){
           rep(j,n){
               if(pp[i].first>p[j].second&&pp[i].second>p[j].first){
                   // cout << p[i].second << " " << pp[j].first << endl;
                   p[j].first=INF;
                   p[j].second=INF;
                   ans++;
                   break;
               }
           }
       }
       Cout(ans);
return 0;
}


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

int main() {
  string s;
  cin >> s;
  bool isdiff = false;

  rep(i, s.size() - 1) {
    if(s[i] == s[i+1]) isdiff = true;
  }

  if(isdiff) cout << "Bad" << endl; 
  else cout << "Good" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false); cin.tie(0);
#define endl '\n'
#define ll long long int
#define N 1000 + 5
using namespace std;

ll n, t[N], a[N];

int main(){
    IOS;
    cin >> n;
    for(int i=0; i<n; i++)
        cin >> t[i] >> a[i];
    ll T = 1, A = 1;
    for(int i=0; i<n; i++){
        // percent
        ll p = max(T / t[i], A / a[i]);
        if(p * t[i] < T || p * a[i] < A)
            p++;
        T = p * t[i];
        A = p * a[i];
    }
    cout << (T + A) << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int inf=1e9+7;
int main(){
    int n;cin>>n;
    double s=1;
    vector<double>A(n);
    rep(i,n){
        double a;cin>>a;
        A[i]=a;
        s*=a;
    }
    double sig=0;
    rep(i,n)sig+=s/A[i];
    cout<<(double(s/sig))<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<iostream>
using namespace std;
#define ll long long 
#define INF 999999999
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
    ll a,b,c,d; cin>>a>>b>>c>>d;
    ll cd;
    ll ccnt=0,dcnt=0,cdcnt=0,allb,alla,i=1;

    //ユークリッドの互除法
    ll x=c*d,r,maxi,mini;
    maxi=max(c,d);
    mini=min(c,d);

    r=maxi%mini;
    while(r!=0){
        maxi=mini;
        mini=r;
        r=maxi%mini;
    }
    cd=x/mini;

ccnt=b/c;
dcnt=b/d;
cdcnt=b/cd;
allb=b-ccnt-dcnt+cdcnt;
ccnt=(a-1)/c;
dcnt=(a-1)/d;
cdcnt=(a-1)/cd;
alla=(a-1)-ccnt-dcnt+cdcnt;

    cout << allb-alla<<endl;

}



Measured memory_bytes: 256
#include <iostream>
using namespace std;
typedef long long ll;
ll l, ze[200010], ki[200010], gu[200010], a, le[200010], sum[200010], lu[200010], ri[200010], ans;
int main(void){
    // Your code here!
    ans = 100000000000;
    cin >> l;
    for (ll i = 1; i <= l; i++){
        cin >> a;
        sum[i] = sum[i - 1] + a;
        ze[i] = ze[i - 1] + ((a == 0) ? 1 : 0);
        ki[i] = ki[i - 1] + ((a % 2 == 1) ? 1 : 0);
        gu[i] = gu[i - 1] + (((a % 2 == 0) && (a != 0)) ? 1 : 0);
    }
    for (ll i = 1; i <= l; i++){
        le[i] = min((le[i - 1] + 2 * (ze[i] - ze[i - 1]) + (ki[i] - ki[i - 1])), sum[i]);
    }
    for (ll i = 1; i <= l; i++){
        lu[i] = min((lu[i - 1] + gu[i] - gu[i - 1] + ze[i] - ze[i - 1]), le[i]);
    }
    for (ll i = l; i >= 1; i--){
        ri[i] = min((ri[i + 1] + 2 * (ze[i] - ze[i - 1]) + (ki[i] - ki[i - 1])), sum[l] - sum[i - 1]);
    }
    for (ll i = 0; i <= l; i++){
        ans = min(ri[i + 1] + lu[i], ans);
    }
    cout << ans << endl;
}


Measured memory_bytes: 11264
n, k = map(int, input().split())
a = list(map(int, input().split()))
f = list(map(int, input().split()))

a.sort()
f.sort(reverse=True)

H = 0
for i in range(n):
    H = max(H, a[i] * f[i])

if H == 0:
    print(0)
    exit()

H += 1
L = 0
while L < H:
    M = (L + H) // 2
    temp = k
    for i in range(n):
        if a[i] * f[i] > M:
            temp -= a[i] - (M // f[i])
            if temp < 0:
                break
    #print(L, H, M, temp)
    if temp < 0:
        L = M + 1
    else:
        H = M

print(L)


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

void solve()
{
    int n;
    cin>>n;
    vector<int> v, v1, v2;
    for(int i=1; i<=n; i++)
    {
        int x;
        cin>>x;
        v1.push_back(x);
    }
    for(int i=1; i<=n; i++)
    {
        int x;
        cin>>x;
        v2.push_back(x);
    }
    for(int i=1; i<=n; i++)
    {
        v.push_back(i);
    }
    int x=0; int a=-1, b=-1;
    do
    {
        x++;
        if(v==v1)
        {
           a=x;
        }
        if(v==v2)
        {
          b=x;
        }
    }
    while(next_permutation(v.begin(),v.end()));

    cout<<abs(a-b)<<endl;


}
int main()
{
    int t;
    t=1;
    while(t--)
    {
        solve();

    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cassert>
#include<cstring>
#include<unordered_map>
#include<climits>
#include<sstream>
#include<deque>
#include<queue>
#include<sstream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<bitset>

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define all(x) x.begin(),x.end()

using namespace std;

void roll_x(vector<int> &vec) {
  vector<int> tmp(8);
  int f[] = {7,0,3,4,5,2,1,6};
  rep(i,8) tmp[i] = vec[f[i]];
  vec = tmp;
}

void roll_y(vector<int> &vec) {
  vector<int> tmp(8);
  int f[] = {7,6,1,0,3,2,5,4};
  rep(i,8) tmp[i] = vec[f[i]];
  vec = tmp;
}

void roll_z(vector<int> &vec) {
  vector<int> tmp(8);
  int f[] = {3,0,1,2,5,6,7,4};
  rep(i,8) tmp[i] = vec[f[i]];
  vec = tmp;
}

int normalize(vector<int> color) {
  int mini = INT_MAX;
  vector<int> tmp = color;
  rep(_,4) {
    rep(__,4) {
      rep(___,4) {
	int v = 0;
	rep(i,8) { assert(color[i]); v *= 10; v += color[i]; }
	mini = min(mini,v);
	roll_x(color);
      }
      roll_y(color);
    }
    roll_z(color);
  }
  assert( tmp == color );
  return mini;
}

void compute(vector<int> &color) {
  sort(all(color));
  set<int> S;
  do {
    S.insert(normalize(color));
  } while( next_permutation(all(color)) );
  cout << (int)S.size() << endl;
}

int main() {
  string s;
  while( cin >> s ) {
    map<string,int> toInt;
    vector<int> color;
    {
      int id = 1;
      toInt[s] = id++;
      color.push_back(toInt[s]);
      rep(i,7) {
	cin >> s;
	if( toInt.count(s) == 0 ) toInt[s] = id++;
	color.push_back(toInt[s]);
      }
    }
    compute(color);
  }
  return 0;
}

Measured memory_bytes: 3148
/* Blog: https://misteer.hatenablog.com/entry/diverta2019-2-C */

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

int main() {
    /* ----- 入力 ----- */
    int N;
    cin >> N;
    vector<int> A(N);
    for (auto& a : A) cin >> a;
    sort(A.begin(), A.end());

    /* ----- 最大値を求める ----- */
    int sum = 0;
    for (auto& a : A) sum += abs(a);
    if (A.front() > 0) sum -= A.front() * 2;  // 全て正の場合
    if (A.back() < 0) sum += A.back() * 2;    // 全て負の場合
    cout << sum << endl;

    /* ----- 操作列の構成 ----- */
    int acc = A.front();

    // 正の要素を引く
    for (int i = 1; i < N - 1; ++i) {
        if (A[i] >= 0) {
            cout << acc << " " << A[i] << endl;
            acc -= A[i];
        }
    }

    // 正負逆転
    cout << A.back() << " " << acc << endl;
    acc = A.back() - acc;

    // 負の要素を引く
    for (int i = 1; i < N - 1; ++i) {
        if (A[i] < 0) {
            cout << acc << " " << A[i] << endl;
            acc -= A[i];
        }
    }
    return 0;
}


Measured memory_bytes: 2304
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <queue>
#include <sstream>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(a) (a).begin(), (a).end()
#define AALL(a, n) (a), a + n
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)

using namespace std;

typedef long long ll;

const double EPS = 1e-10;
const double PI = acos(-1.0);

inline int toInt(string s) {
	int v;
	istringstream sin(s);
	sin >> v;
	return v;
}

int main() {
	int n;
	scanf("%d", &n);

	ll result = 0;
	REP(i, n - 1) { result += (i + 1LL); }
	printf("%lld\n", result);
	return 0;
}

Measured memory_bytes: 128
main :: IO ()
main = do
    str <- getLine
    let inputs = [read word :: Int | word <- words str]
    putStrLn $ unwords $ map show [area inputs, circum inputs]

area :: [Int] -> Int
area (a:b:_) = a * b

circum :: [Int] -> Int
circum (a:b:_) = 2 * a + 2 * b

Measured memory_bytes: 3396
#include<bits/stdc++.h>
using namespace std;
#define bs ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long int
#define pb push_back
#define forn(k,n) for(int i=k;i<n;i++)
#define forn1(k,n) for(int j=k;j<n;j++)
template<class T> T power(T N,T P)
{ return (P==0)?  1: N*power(N,P-1); }
int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//freopen("error.txt", "w", stderr);
	bs;
	string a,b;
	cin>>a;
	cin>>b;
	string d="";
	d.append(b);
	d.append(a);
	cout<<d<<endl;
	
}


Measured memory_bytes: 256
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    n, m = rli()
    la = rli()
    lcb = []
    for _ in range(m):
        b, c = rli()
        lcb.append((c, b))
    la.sort()
    lcb.sort(reverse=True)
    a_id = 0
    cb_id = 0
    ans = 0
    flag = False
    while a_id < len(la) and cb_id < len(lcb):
        b = lcb[cb_id][1]
        c = lcb[cb_id][0]
        for i in range(b):
            if a_id >= len(la):
                flag = True
                break
            a = la[a_id]
            if a >= c:
                flag = True
                break
            ans += c
            a_id += 1
        if flag:
            break
        cb_id += 1
    ans += sum(la[a_id:])

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 20948
a, b, k = map(int,input().split())
# for i in range(k):
#     if a >= 1:
#         a -= 1
#     elif b >= 1:
#         b -= 1
#     else:
#         continue

tmp = min(k, a)
a -= tmp
k -= tmp
b = max(0, b - k)

print(a, b)

Measured memory_bytes: 9124
#include<stdio.h>
#include <iomanip>
#include <iostream>
#include<string>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include <random>
#include <chrono>

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

using namespace std;
int main() {
	char c;
	cin >> c;
	c++;
	cout << c;

}

Measured memory_bytes: 888
#include <cstdio>
#define abs(x) ((x > 0) ? x : (-(x)))
int H, W, D, A;
int Q, L, R;
int px[90001], py[90001];
int d[90001];
int main() {
  scanf("%d %d %d", &H, &W, &D);
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      scanf("%d ", &A);
      px[A] = i, py[A] = j;
    }
  }
  for (int i = D + 1; i <= H * W; i++)
    d[i] = d[i - D] + abs(px[i] - px[i - D]) + abs(py[i] - py[i - D]);
  scanf("%d", &Q);
  while (Q--) {
    scanf("%d %d", &L, &R);
    printf("%d\n ", d[R] - d[L]);
  }
}

Measured memory_bytes: 2176
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

count = 0

for i in range(N):
    a = A[i]
    sat = B[a - 1]
    if i != 0:
        if A[i - 1] == a - 1:
            sat += C[a - 2]
    count += sat

print(count)

Measured memory_bytes: 3064
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
 
using namespace std;
 
bool s[15][10005]= {0};
 
int ans=0;
int n, m;
 
void dfs(int x)
{
    if(x==n+1)
    {
        int sum=0;
        int term=0;
        for(int j=1;j<=m;j++)
        {
            for(int i=1;i<=n;i++)
                if(s[i][j]==1)term++;
            sum += term > n-term ? term : n-term;
            term=0;
        }
        ans=max(ans,sum);
        return ;
    }
    dfs(x+1);
    for(int i=1;i<=m;i++)
        s[x][i]=!s[x][i];
    dfs(x+1);
}
 
int main()
{
    //freopen("in.in","r",stdin);
    while(scanf("%d%d",&n,&m)!=EOF)
    {
        if(n==0&&m==0)break;
        ans=0;
        for(int i=1; i<=n; i++)
            for(int j=1; j<=m; j++)
                scanf("%d",&s[i][j]);
        dfs(1);
        printf("%d\n",ans);
    }
    return 0;
}


Measured memory_bytes: 3336
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#include<algorithm>//next_permutation
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define small "abcdefghijklmnopqrstuvwxyz"
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

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

const ll MOD = 1000000007;
const ll MAX = 2000001;

ll mod(ll a){
  return a % MOD;
}

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

ll fac[MAX], finv[MAX], inv[MAX];

void nCrprep() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll nCr(ll n, ll r){
    if (n < r) return 0;
    if (n < 0 || r < 0) return 0;
    return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD;
}

ll nCrcheep(ll n,ll r){
  if(r == 0) return 1;
  else if(r == 1) return n;
  else return nCrcheep(n-1,r-1)*n/r;
}

vector<pair<ll,ll>> prime_factorize(ll n){
  vector<pair<ll,ll>> res;
  
  for(ll i=2; i*i <= n; i++){
    if(n % i != 0) continue;
    
    ll ex = 0;
    while(n % i == 0){
      ex++;
      n /= i;
    }
    
    res.push_back({i,ex});
  }
  
  if(n != 1) res.push_back({n,1});
  
  return res;
  
}




int main(){
  ll n,m; cin >> n >> m;
  vector<tuple<ll,ll,ll>> table(m);
  
  vector<string> num(m);
  
  rep(i,m){
    ll p,year; cin >> p >> year;
    
    table.push_back(make_tuple(p,year,i));
  }
  
  sort(all(table));
  
  ll nowp = 0; ll cnt = 1;
  
  for(auto t : table){
    ll p,year,i;
    p = get<0>(t); year = get<1>(t); i = get<2>(t);
    
    if(nowp != p){
      cnt = 1;
      nowp = p;
    }
    else cnt++;
    
    ll pcnt = 0; ll cntcnt = 0; ll pd = p; ll cntd = cnt;
    while(pd != 0){
      pd /= 10;
      pcnt++;
    }
    while(cntd != 0){
      cntd /= 10;
      cntcnt++;
    }
    
    string a,b,s;
    a = string(6-pcnt,'0')+to_string(p);
    b = string(6-cntcnt,'0')+to_string(cnt);
    
    s = a+b;
    
    num[i] = s;
    
  }
  
  for(auto s : num){
    cout << s << endl;
  }
  
 
  
}

Measured memory_bytes: 11264
import sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

N,T = LI()
A = LI()

m = A[-1]
ans = []
for i in range(N-2,-1,-1):
    ans.append(m-A[i])
    m = max(m,A[i])

print(ans.count(max(ans)))

Measured memory_bytes: 85160
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;

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

bool solve(const vector<int> &H) {
    int h = H[0];
    bool ok = true;
    for (int i = 1; i < (int) H.size(); i++) {
        if (h > H[i]) {
            ok = false;
            break;
        } else if (h == H[i]) {
            ;
        } else {
            h = H[i] - 1;
        }
    }
    return ok;
}

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

    vector<int> H(N);
    for (int i = 0; i < N; i++) {
        cin >> H[i];
    }

    if (solve(H)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 640
#include <iostream>

typedef long long ll;

int main(){
  ll N;
  std::cin >> N;
  ll resa = 0;
  for(ll i = 1 ; i <= N ; i ++){
    ll n = N / i;
    resa += i * n * (n + 1) / 2;
  }
  std::cout << resa << std::endl;
  return 0;
}


Measured memory_bytes: 3628
from itertools import combinations, count
 
n = int(input())
r = range(n)
a = [(set(), set()) for _ in r]
for i in r:
  for _ in range(int(input())):
    x, y = map(int, input().split())
    a[i][y].add(x - 1)
ans = next(i for i in count(n, -1) for x in map(set, combinations(r, i))
           if all(a[j][0].isdisjoint(x) and a[j][1] < x for j in x))
print(ans)


Measured memory_bytes: 3064
import math
def main():
	while True:
		n = int(input())
		if n == 0:
			break
		l = list(map(int, input().split()))
		m = sum(l)/n
		k = []
		for a in l:
			k.append((a- m)**2)
		a = math.sqrt(sum(k)/n)
		print(a)

main()



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


int main() {
    int A,B,C;
  cin>>A>>B>>C;
    if(A+B>=C)cout<<"Yes"<<endl;
    else cout <<"No"<<endl;
}

Measured memory_bytes: 256
N = gets.to_i
ss = []
N.times do
  ss << gets.to_i
end

ans = ss.inject(:+)

ss.sort!.reject! { |v| v % 10 == 0 }
for i in 0..(ss.size - 1) do
  break unless ans % 10 == 0
  s = ss[i]
  ans -= s
end

ans = ans % 10 == 0 ? 0 : ans

puts ans

Measured memory_bytes: 1788