akhauriyash/Code-Regression huggingface dataset:
#python3
from collections import deque 
def main():
    n, q = map(int, input().split())
    to = [[] for _ in range(n)]
    for _ in range(n-1):
        a, b = map(lambda x: int(x)-1, input().split())
        to[a].append(b)
        to[b].append(a)

    node = [0 for _ in range(n)]

    for _ in range(q):
        p, x = map(int, input().split())
        node[p-1] += x

    dq = deque() 
    dq.append(0)
    done = [0 for _ in range(n)]
    done[0] = 1
    while len(dq) > 0:
        x = dq.popleft()
        for i in to[x]:
            if done[i] == 1:
                continue
            node[i] += node[x]
            done[i] = 1 
            dq.append(i)

    for i in range(n):
        print(node[i]) if i == n-1 else print(node[i], end=' ')
main()


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

#define rep(X,N) for(ll X = 0LL; X < (N); X++)
#define ALL(V) (V).begin(),(V).end()
#define endl "\n"

using namespace std;
typedef long long ll;

const double PI = 3.1415926535897932384626;
const ll MODN = 1000000007;
const ll MODN2 = 998244353;
const double EPS = 1e-10;

int main(){

    int n;
    cin >> n;
    string s;
    cin >> s;

    int red = 0;
    int white = 0;

    rep(i, n){
        if(s[i] == 'R'){
            red++;
        }else{
            white++;
        }
    }

    int l = 0;
    int r = n - 1;

    int count = 0;

    while(l < r){
        if(s[l] == 'W'){
            while(l < r){
                if(s[r] == 'R'){
                    count++;
                    r--;
                    break;
                }
                r--;
            }
        }
        l++;
    }

    cout << min(count, min(red, white)) << endl;

    return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <limits>
#include <algorithm>
#include <functional>

using namespace std;

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

	long long N, T;
	cin >> N >> T;

	long long prev;
	cin >> prev;

	long long result = 0;
	for (int i = 1; i < N; i++)
	{
		long long curr;
		cin >> curr;

		result += min(T, curr - prev);
		prev = curr;
	}

	cout << result + T;;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
const long long int MOD=1e9+7;


using namespace std;

long long n, ans;
vector<int> a;

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


void solve(){
    sort(a.begin(), a.end());
    bool check = true;
    if(n%2 == 0){
        for(int i=0;i<n;i++){
            if((i/2)*2 + 1 != a[i]){
                check = false;
                break;
            }
        }
    }
    else{
        for(int i=0;i<n;i++){
            if(a[i] != (((i+1)/2)*2)){
                check = false;
                break;
            }
        }
    }
    if(!check){
        cout << 0 << endl;
    }
    else{
        cout << modpow(2, n/2, MOD) << endl;
    }
}


int main(){
    int tmp;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> tmp;
        a.push_back(tmp);
    }
    solve();
}

Measured memory_bytes: 892
#include <iostream>
#include <cstdio>
#include <utility>
#include <algorithm>
using namespace std;

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

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

int a[10][10];

int distance(int sy, int sx, int gy, int gx)
{
	return max(abs(sy - gy), abs(sx - gx));
}

bool inside(int y, int x)
{
	return 0 <= y and y < 8 and 0 <= x and x < 8;
}

void place(int y, int x, int c, int vec)
{
	int ty = -1, tx = -1;
	int ny = y + dy[vec], nx = x + dx[vec];

	while (1) {
		ny += dy[vec];
		nx += dx[vec];
		if (not inside(ny, nx)) break;
		if (a[ny][nx] == c) {
			ty = ny, tx = nx;
			break;
		}
	}

	if (ty != -1) {
		int cury = y + dy[vec], curx = x + dx[vec];

		int counter = 0;
		while (1) {
			if (a[cury][curx] == !c) {
				counter++;
			}

			if (cury == ty and curx == tx) break;

			cury += dy[vec];
			curx += dx[vec];
		}

		if (distance(y, x, ty, tx) - 1 == counter) {
			int cury = y + dy[vec], curx = x + dx[vec];
			while (1) {
				a[cury][curx] = c;
				cury += dy[vec];
				curx += dx[vec];
				if (cury - dy[vec] == ty and curx - dx[vec] == tx) break;
			}
		}
	}
}

int calc(int y, int x, int c)
{
	int sum = 0;

	for (int i = 0; i < 8; ++i) {
		int ty = -1, tx = -1;

		int ny = y + dy[i], nx = x + dx[i];

		while (1) {
			ny += dy[i];
			nx += dx[i];
			if (not inside(ny, nx)) break;
			if (a[ny][nx] == c) {
				ty = ny, tx = nx;
				break;
			}
		}

		if (ty != -1) {
			int cury = y + dy[i], curx = x + dx[i];

			int counter = 0;
			while (1) {
				if (a[cury][curx] == !c) {
					counter++;
				}

				if (cury == ty and curx == tx) {
					break;
				}

				cury += dy[i];
				curx += dx[i];
			}

			if (distance(y, x, ty, tx) - 1 == counter) {
				sum += counter;
			}
		}
	}

	return sum;
}

int main()
{
	rep(i, 8) rep(j, 8) {
		char c; cin >> c;
		if (c == 'o') {
			a[i][j] = 1;
		} else if (c == 'x') {
			a[i][j] = 0;
		} else {
			a[i][j] = -1;
		}
	}

	while (1) {
		bool did1 = false, did2 = false;

		// mami
		int mami_max = 0, my = -1, mx = -1;
		rep(y, 8) rep(x, 8) {
			if (a[y][x] != -1) continue;
			if (mami_max < calc(y, x, 1)) {
				mami_max = calc(y, x, 1);
				my = y, mx = x;
			}
		}

		if (my != -1) {
			a[my][mx] = 1;
			rep(i, 8) {
				place(my, mx, 1, i);
			}
			did1 = true;
		}
		
		// witch
		int witch_max = 0, wy = -1, wx = -1;
		for (int y = 7; y >= 0; --y) for (int x = 7; x >= 0; --x) {
			if (a[y][x] != -1) continue;
			if (witch_max < calc(y, x, 0)) {
				witch_max = calc(y, x, 0);
				wy = y, wx = x;
			}
		}

		if (wy != -1) {
			a[wy][wx] = 0;
			rep(i, 8) {
				place(wy, wx, 0, i);
			}
			did2 = true;
		}

		if ((not did1) and (not did2)) break;
	}

	rep(i, 8) {
		rep(j, 8) {
			if (a[i][j] == 1) {
				printf("o");
			} else if (a[i][j] == 0)  {
				printf("x");
			} else {
				printf(".");
			}
		}
		puts("");
	}
}



Measured memory_bytes: 3092
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
    int n;
    cin >> n;
    int d[n];
    for (int i=0; i<n; i++) {
        cin >> d[i];
    }
    sort(d, d+sizeof(d)/sizeof(d[0]));
    cout << d[n/2] - d[n/2 - 1] << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define show(x) cout << #x << " = " << (x) << endl;
#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int mod = 1000000007;
const double EPS = 1e-9;
const int INF = 1<<30;
const ll INFLL = 1LL<<60;
//cout << fixed << setprecision(10);

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 () {
  int n;
  cin >> n;
  vector<string> s(n);
  rep(i,n) cin >> s[i];
  
  vi cnt(26);
  for (char c = 'a'; c <= 'z'; ++c) {
    int mi = INF;
    rep(i,n) {
      int tmp = 0;
      rep(j,s[i].size()) {
        if (s[i][j] == c) tmp++;
      }
      mi = min(mi,tmp);
    }
    cnt[c-'a'] += mi;
  }

  string ans;
  for (char c = 'a'; c <= 'z'; ++c) {
    rep(_,cnt[c-'a']) {
      ans += c;
    }
  }

  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
using System;

class P
{
    public static void Main()
    {
        double r = double.Parse(Console.ReadLine());
        double pi = 3.141592653589793238;
        double area = (r * r) * pi;
        double circum = (2 * r) * pi;
        Console.WriteLine(area.ToString("f6") + " " + circum.ToString("f6"));
        
    }
}


Measured memory_bytes: 15968
#include <iostream>
#include <queue>

int main()
{
    int n, m;
    std::cin >> n >> m;

    std::priority_queue<int> q;
    for (int i = 0; i < n; i++) {
        int temp;
        std::cin >> temp;

        q.push(temp);
    }

    for (int i = 0; i < m; i++) {
        int temp = q.top() / 2;
        q.pop();
        q.push(temp);
    }

    long long ans = 0;
    while (q.size()) {
        ans += q.top();
        q.pop();
    }

    std::cout << ans << std::endl;
}


Measured memory_bytes: 892
#include <iostream>
#include <set>
#include <string>

#define rep(i,s,N) for(int i=s;i<N;i++)
using namespace std;

int main(void)
{
	int N; cin >> N;
	set<string> arare;
	rep(i, 0, N) {
		string tmp; cin >> tmp;
		arare.insert(tmp);
	}
	cout << (arare.size() == 4 ? "Four" : "Three") << endl;

	return 0;
}

Measured memory_bytes: 256
import java.io.InputStream;
import java.io.PrintStream;
import java.util.*;

public class Main {

  public static void main(String[] args) {
    solve(System.in, System.out);
  }

  static void solve(InputStream is, PrintStream os) {
    Scanner sc = new Scanner(is);

    /* read */
    String s = sc.next();
    if (s.equals("Sunny")) {
      os.println("Cloudy");
    } else if (s.equals("Cloudy")) {
      os.println("Rainy");
    } else {
      os.println("Sunny");
    }
  }
}

Measured memory_bytes: 19668
#include <iostream>

using namespace std;

int main()
{
    int a,b;
    cin>>a>>b;
    for(int i=0;i<=a;i++)
    {
             if(2*(i)+4*(a-i)==b)
            {
                cout<<"Yes";
                return 0;
            }
    }
    cout<<"No";

    return 0;
}

Measured memory_bytes: 3476
/**
 *      purpose : 
 *      author  : kyomukyomupurin
 *      created : 
**/

// input/output
#include <fstream>
#include <iostream>
#include <sstream>
// container class
#include <array>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
// math, algorithm
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
// etc
#include <bitset>
#include <cassert>
#include <cctype>
#include <cstring>
#include <chrono>
#include <ext/random>
#include <ext/rope>
#include <functional>
#include <iomanip>
#include <random>
#include <utility>
// using-directive
using namespace std;
// alias template
using int64 = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vl = std::vector<int64>;
using pii = std::pair<int, int>;
using pii = std::pair<int, int>;
using pll = std::pair<int64, int64>;
// text macro replacement
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(_) (_).begin(), (_).end()
#define rall(_) (_).rbegin(), (_).rend()
#define print(_) std::cout << (_) << '\n'
#define debug(_) std::cerr << #_ << ": " << (_) << '\n'
// variadic template
template<typename T> inline void chmin(T &a, T b) {if (a > b) a = b; return;}
template<typename T> inline void chmax(T &a, T b) {if (a < b) a = b; return;}
template<typename T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  os << "{";
  for (size_t i = 0; i < vec.size(); ++i) {
    os << vec[i] << ",}"[i == vec.size() - 1];
  }
  return os;
}
template<typename T, typename U> std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << "{" << p.first << " " << p.second << "}";
}
// constant
const int INF = (1<<30) - 1;  // 1.073741823e9
const int64 INF64 = (1LL<<62) - 1;  // 4.611686018427387903e18
const int MOD = 1000000007;

int n;
vector<vi> graph(101010);

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

  cin >> n;
  rep(i, n - 1) {
    int a, b; cin >> a >> b;
    graph[a].emplace_back(b);
    graph[b].emplace_back(a);
  }

  bool visited1[n + 1] = {};
  int level1[n + 1] = {};
  level1[1] = 0;
  visited1[1] = true;
  queue<int> q1;
  q1.push(1);
  while (!q1.empty()) {
    int top = q1.front(); q1.pop();
    for (int next : graph[top]) {
      if (visited1[next]) continue;
      visited1[next] = true;
      q1.push(next);
      level1[next] = level1[top] + 1;
    }
  }

  bool visited2[n + 1] = {};
  int level2[n + 1] = {};
  level2[n] = 0;
  visited2[n] = true;
  queue<int> q2;
  q2.push(n);
  while (!q2.empty()) {
    int top = q2.front(); q2.pop();
    for (int next : graph[top]) {
      if (visited2[next]) continue;
      visited2[next] = true;
      q2.push(next);
      level2[next] = level2[top] + 1;
    }
  }
  int cnt1 = 0, cnt2 = 0;

  for (int i = 2; i <= n - 1; ++i) {
    if (level1[i] <= level2[i]) ++cnt1;
    else ++cnt2;
  }

  if (cnt1 > cnt2) {
    cout << "Fennec" << '\n';
  } else {
    cout << "Snuke" << '\n';
  }

  return 0;
}

Measured memory_bytes: 6912
#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 count=0;

      for(int i=1;i<n-1;i++)
      {
          if(arr[i] > arr[i-1] && arr[i] < arr[i+1])
           count++;

           else if(arr[i] < arr[i-1] && arr[i] > arr[i+1])
            count++;
      }

     cout<<count;
}


Measured memory_bytes: 256
#include <cmath>
#include <string>
#include <iostream>
#include <algorithm>
#include<vector>
#include<cstring>
#include<set>
#include <cstdio>
#include<queue>
#include<map>
#define WHITE 0
#define GRAY  1
#define BLACK 2
#define endl '\n'
#define forup(i,a,n) for( int i =a; i < n; i++)
#define llforup(i,a,n) for( ll i =a; i < n; i++)
#define fordown(i,a,n) for( int i =a; i >= n; i--)
#define fornot(i,a,n) for( int i=a;!n;i++)
#define mod  (ll)(1e9+7)
#define ifempty(a)  if(!a)
using namespace std;
typedef long long ll;
inline int readnum()
{
	int p, data = 0; char ch = 0;
	while ((ch != ' - ') && ch < '0' || ch>'9') ch = getchar();//相当于正则表达式的搜索，跳过不需要的字符
	if (ch == '- ')p = -1, ch = getchar();
	else p = 1;
	while (ch >= '0' && ch <= '9') data = data * 10 + ch - '0', ch = getchar();//搜索需要的字符
	return data * p;
}
//E-mail 374656045@qq.com
#define MAX (unsigned)1e5+1
struct Rectangle { int pos; ll height; };
Rectangle stack[MAX];
class solve {
private:
	int tot; int top = 0; int temp; ll area;//防溢出
	ll maxv=0;
	char ch;
public:
	solve()
	{
		tot = read();
		stack[top].height = read();
		for (int i = 1; i <= tot; i++)
		{
			temp = read();
			if (temp > stack[top].height) { stack[++top].height = temp; stack[top].pos = i; }
			else if (temp < stack[top].height)
			{
				while (temp < stack[top].height)
				{
					area = stack[top].height * (i - stack[top].pos);
					top--;
					if (area > maxv)maxv = area;
					if (top == -1)break;//边界检查
				}
				stack[++top].height = temp;
			}
		}
		printf("%lld\n", maxv);
	}
	inline int read()//正数版
	{
		int data = 0;
		ch = getchar();
		while (ch != ' '&&ch!='\n'&& ch!=EOF)
		{
			data = data * 10 + ch - '0';
			ch = getchar();
		}
		return data;
	}


};
int main(void)
{
	//ios_base::sync_with_stdio(0); cin.tie(0);//慎用，cin和scanf混用会导致非MSC++WA
#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	solve solution;
#ifdef DEBUG
	fclose(stdin);//关闭文件 
	fclose(stdout);//关闭文件 
#endif
	return 0;

}




Measured memory_bytes: 4680
#define _USE_MATH_DEFINES // for C++  
#include <cmath> 
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <array>
#include <iterator>
#include <utility>
#include <set>
#include <random>
#include <map>
#include <stack>
#include <queue>
#include <list>
#include <functional>
#define LL long long


using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    cout << (a + b) % 24 << endl;
    return 0;
}   


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] array = new int[n][2];
        for (int i = 0; i < n; i++) {
            array[i][0] = sc.nextInt();
            array[i][1] = i+1;
        }
        
        Arrays.sort(array, (a, b) -> Integer.compare(a[0], b[0]));
        
        for (int i = 0; i < n; i++) {
            System.out.print(array[i][1]);
            
            if (i != n-1) {
                System.out.print(" ");
            } else {
                System.out.println();
            }
        }
    }
}


Measured memory_bytes: 62928
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#define int long long
using namespace std;
int a, b, c, d, e, f;
vector<int>t;
signed main()
{
	cin >> a >> b;
	int i;
	for (i = 0; i < b; i++)
	{
		t.push_back(i + 1);
	}
	for (i = b-1; i >=0; i--)
	{
		t.push_back(a-i-1);
	}
	int j = 1;
	for (i = 2 * b - 1; i >= 0; i-=2)
	{
		cout << j << ' ' << t[i] + j << '\n';
		j++;
	}
}

Measured memory_bytes: 5240
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main()
{
    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;

    //注文してから届く時間
    vector<int> Time = {a, b, c, d, e};
    //注文してから次の注文
    vector<int> nextTime(5);
    for (int i = 0; i < 5; ++i){
        if(Time[i]%10 == 0)
            nextTime[i] = Time[i];
        else{
            nextTime[i] = Time[i] - Time[i] % 10 + 10;
        }
    }

    int besttime = 1 << 30;

    for (int i = 0; i < 5; ++i){
        int sumTime = 0;
        for (int j = 0; j < 5; ++j){
            if(i==j){
                sumTime += Time[i];
            }
            else
            {
                sumTime += nextTime[j];
            }
        }
        besttime = min(besttime, sumTime);
    }
    cout << besttime << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
constexpr int MOD = 1'000'000'007;
//inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    string s;
    cin >> s;
    int n = s.size();
    REP(i,0,n/2) {
        if (s[i] != s[n-1-i]) {
            cout << "No" << endl;
            return;
        }
    }
    REP(i,0,(n-1)/2/2) {
        if (s[i] != s[(n-1)/2-1-i]) {
            cout << "No" << endl;
            return;
        }
        if (s[i+(n+1)/2] != s[(n-1)/2-1-i+(n+1)/2]) {
            cout << "No" << endl;
            return;
        }
    }
    cout << "Yes" << endl;
}

signed main() {
    solve();
    
    return 0;
}

Measured memory_bytes: 256
import std.stdio, std.string, std.conv;
import std.algorithm, std.array;
import std.math;
 
auto solve(string s_)
{
    auto NA = s_.split.map!(to!int)();
    immutable N=NA[0], A=NA[1];
    immutable xs=readln.split.map!(to!int).array();
    immutable M=N*A+1;
    auto dp = new long[][](N+1,M); dp[0][0]=1;
    foreach(int k,x;xs)
    {
        foreach_reverse(j;0..k+1)
            foreach(i;0..max(0,M-x))
                dp[j+1][i+x]+=dp[j][i];
    }
    long c=0;
    foreach(i;1..N+1) c+=dp[i][i*A];
    return c;
}

void main(){ for(string s; (s=readln.chomp()).length;) writeln(solve(s)); }

Measured memory_bytes: 1276
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string s;
    cin >> s;
    if(s == "RSS" || s == "SRS" || s == "SSR" || s == "RSR") cout << 1 << endl;
    if(s == "RRR") cout << 3 << endl;
    if(s == "SSS") cout << 0 << endl;
    if(s == "RRS" || s == "SRR")cout << 2 << endl;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "-----------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause")
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
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; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T>inline istream& operator>>(istream& is, deque<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }

int main() {
    init();

    int k; cin >> k;
    VL dis(k, LLINF);
    dis[1] = 1;
    deque<int> q;
    q.push_back(1);
    while (!q.empty()) {
        int now = q.front(); q.pop_front();
        ll d = dis[now];
        if (chmin(dis[(now * 10) % k], d)) {
            q.push_front((now * 10) % k);
        }
        if (chmin(dis[(now + 1) % k], d + 1)) {
            q.push_back((now + 1) % k);
        }
    }

    cout << dis[0] << "\n";
}

Measured memory_bytes: 1280
#include "bits/stdc++.h"
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(s) s.begin(), s.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<string> vs;
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
const int DIV = 1e9+7;

int x, a, b;

int main()
{
    cin >> x >> a >> b;
    int ans = x;
    ans -= a;
    ans = ans % b;
    cout << ans << endl;

}

Measured memory_bytes: 256
#![allow(non_snake_case)]

pub fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().parse().ok().unwrap()
}

pub fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

pub fn read_tuple<T: std::str::FromStr + Copy>() -> (T, T) {
    let v: Vec<T> = read_vec();
    (v[0], v[1])
}

fn main() {
    let N: usize = read();
    let mut red = Vec::new();
    for i in 0..N {
        red.push(read_tuple::<i32>());
    }
    red.sort();
    let mut blue = Vec::new();
    for i in 0..N {
        blue.push(read_tuple::<i32>());
    }
    blue.sort();
    let mut ans = 0;
    for (c, d) in blue {
        let mut max_b = -1;
        let mut j = 0;
        for i in 0..red.len() {
            let (a, b) = red[i];
            if a < c && b < d {
                if b > max_b {
                    max_b = b;
                    j = i;
                }
            } else if a >= c {
                break;
            }
        }
        if max_b >= 0 {
            red.remove(j);
            ans += 1;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
using ll = long long;

#define REP(i, a) for (int i = 0; i < (a); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (a)-1; i >= (b); --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define SIZE(obj) (int)(obj).sizeT()
#define YESNO(cond, yes, no) \
    { cout << ((cond) ? (yes) : (no)) << endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(), (list).rend())
#define ASSERT(cond, mes) assert(cond&& mes)

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template <typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

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

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a) n = a;
    if (n > b) n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u / GCD(u, v) * v;
}

template <typename T>
std::vector<T> enum_div(T n) {
    std::vector<T> ret;
    for (T i = 1; i * i <= n; ++i) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) { ret.push_back(n / i); }
        }
    }
    return ret;
}

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

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

struct ToUpper {
    char operator()(char c) {
        return toupper(c);
    }
};

struct ToLower {
    char operator()(char c) {
        return tolower(c);
    }
};

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

    int K, T;
    cin >> K >> T;
    vector<int> A(T);
    cin >> A;

    RSORT(A);
    cout << max(0, A[0] - 1 - (K - A[0])) << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
	
	public void solve(){
		Scanner sc = new Scanner(System.in);
		int a;
		int b;
		a = sc.nextInt();
		b = sc.nextInt();
		
		System.out.println((a*b)+" "+((a+b)*2));
	}
	public static void main(String[] args){
		Main obj = new Main();
		obj.solve();
	}
}

Measured memory_bytes: 17156
#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <limits>
#include <stack>
#include <math.h>
#define REP(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define RREP(i,n) for(ll i=(n)-1; i>=0; --i)
#define SREP(i,s,n) for(ll i=(s), i##_len=(n); i<i##_len; ++i)
#define ALL(v) (v).begin(),(v).end()

using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

template <typename T>
T gcd(T a, T b) {
    if(a < b) gcd(b, a);
    if (b == 1) return 1;
    T r;
    while ((r=a%b)) {
        a = b;
        b = r;
    }
    return b;
}

bool comp(pair<ll, ll> a, pair<ll, ll> b) {
    return a.second > b.second;
}

struct UnionFind {
    vector<int> par;
    vector<int> rank;
    
    UnionFind(int n = 1) {
        init(n);
    }
    
    void init(int n = 1) {
        par.resize(n); rank.resize(n);
        for (int i = 0; i < n; ++i) {
            par[i] = i;
            rank[i] = 0;
        }
    }
    
    int root(int x) {
        if (par[x] == x) {
            return x;
        }
        else {
            int r = root(par[x]);
            return par[x] = r;
        }
    }
    
    bool issame(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        return true;
    }
};

#define MOD (1000000007)
#define BIGNUM (ll(1e18))

int main(int argc, const char * argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N, M, R;
    cin >> N >> M >> R;
    
    vector<ll> r(R);
    REP(i, R) {
        cin >> r[i];
        r[i]--;
    }
    
    vector<vector<ll>> d(N, vector<ll>(N, BIGNUM));
    REP(i, M) {
        ll A, B, C;
        cin >> A >> B >> C;
        d[A-1][B-1] = C;
        d[B-1][A-1] = C;
    }
    
    for (int k = 0; k < N; k++){
      for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
          d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
        }
      }
    }
    
    sort(ALL(r));
    ll miny = BIGNUM;
    do {
        ll y = 0;
        SREP(i, 1, R) {
            y += d[r[i-1]][r[i]];
        }
        miny = min(miny, y);
    } while (next_permutation(ALL(r)));
    
    cout << miny << endl;
}


Measured memory_bytes: 640
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
const int maxn=100005,maxe=maxn<<1;
int n,m,fa[maxn],U,V,flg,w[maxn],s[maxn],Q[maxn];
int e,son[maxe],nxt[maxe],lnk[maxn];
long long ans;
inline char nc(){
	static char buf[100000],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
inline int read(){
	int ret=0;bool f=0;char ch=nc();
	while(ch>'9'||ch<'0') f^=ch=='-',ch=nc();
	while(ch<='9'&&ch>='0') ret=ret*10+ch-'0',ch=nc();
	return f?-ret:ret;
}
int getfa(int x){return fa[x]==x?x:fa[x]=getfa(fa[x]);}
inline void add_e(int x,int y){son[++e]=y;nxt[e]=lnk[x];lnk[x]=e;}
inline int abs(int x){return x<0?-x:x;}
inline long long solve(int x){
	w[U]+=x,w[V]+=x*flg;
	memset(s,0,sizeof s);ans=0;
	for (int i=n;i;i--)
	s[Q[i]]+=w[Q[i]],ans+=abs(s[Q[i]]),s[fa[Q[i]]]+=s[Q[i]];
	w[U]-=x,w[V]-=x*flg;
	return ans+abs(x);
}
int main(){
	n=read(),m=read();
	if(n&1){puts("-1");return 0;}
	for (int i=1;i<=n;i++) fa[i]=i;
	for (int i=1;i<=m;i++){
		int u=read(),v=read();
		int fu=getfa(u),fv=getfa(v);
		if(fu==fv) U=u,V=v;else add_e(u,v),add_e(v,u),fa[fu]=fv;
	}
	int hed=fa[1]=0,til=Q[1]=w[1]=1;
	while(hed^til)
	for (int i=lnk[Q[++hed]];i;i=nxt[i]) if(son[i]^fa[Q[hed]])
	Q[++til]=son[i],fa[son[i]]=Q[hed],w[son[i]]=-w[Q[hed]];
	solve(0);flg=w[U]==w[V]?1:-1;
	if(s[1]&&((s[1]&1)==1||!U||w[U]!=w[V])){puts("-1");return 0;}
	if(!U) printf("%lld\n",solve(0));else
	if(w[U]==w[V]) printf("%lld\n",solve(-s[1]/2));else{
		int L=-n,R=n;
		while(L<R){
			int midl=floor(1.0*(L+L+R)/3),midr=ceil(1.0*(L+R+R)/3-1e-9);
			if(solve(midl)<solve(midr)) R=midr-1;else L=midl+1;
		}
		printf("%lld\n",solve(L));
	}
	return 0;
}

Measured memory_bytes: 4096
#include "bits/stdc++.h"
#define PRECISION(x) cout << fixed << setprecision(x)
#define FAST_IO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define ALLR(X) (X).rbegin(), (X).rend()
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define F first
#define S second

using namespace std;
 
template<class T> void max_self(T & a, const T & b) { if(a < b) a = b; }
template<class T> void min_self(T & a, const T & b) { if(a > b) a = b; }
typedef long long LL;
const int INF = 1e9 + 7;
const double PI = acos(-1.0);
const double EPS = (1e-9);



int main(){
	FAST_IO
	
	int N, c, maxClash = 0; cin >> N >> c;
	int time[(int)2e5 + 5], chTime[(int)2e5 + 5];
	unordered_map<int, vector<pair<int, int>>> channel;
	memset(time, 0, sizeof time);
	
	for(int rep = 0; rep < N; ++rep){
		int from, to, ch; cin >> from >> to >> ch;
		channel[ch].EB(from, to);
	}
	
	for(auto &ele : channel){
		memset(chTime, 0, sizeof chTime);
		for(auto &t : ele.S){
			int from = t.F, till = t.S;
			chTime[2 * from - 1]++;
			chTime[2 * till]--;
		}
		
		for(int t = 1; t <= 2e5; ++t){
			chTime[t] += chTime[t - 1];
			if(chTime[t]) time[t]++;
		}
	}
		
	for(auto ele : time) max_self(maxClash, ele);
		
	

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


Measured memory_bytes: 3200
#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include <vector>
#include <cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;

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

const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
ll combi(ll n,ll m) {
  ll ans=1;
  rFOR(i,n,n-m){
    ans*=i;
  }
  FOR(i,1,m+1){
    ans/=i;
  }
  return ans;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n,k;
  	ci(n>>k);
  vll h(n);
  vll dp(n+k+1);
  FOR(i,0,n){
    ci(h[i])
  }
  FOR(i,1,n){
    dp[i]=INF;
  }
  
  FOR(i,0,n){
    FOR(j,1,k+1){
      chmin(dp[i+j],dp[i]+abs(h[i]-h[j+i]));
    }
  }
    co(dp[n-1])
  }


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

int main(){
  int m, f, r;
  while(1){
    cin >> m >> f >> r;
    if(m == -1 && f == -1 && r == -1)     break;
    else if(m == -1 || f == -1) cout << 'F' << endl;
    else if(m + f >= 80) cout << 'A' << endl;
    else if(m + f >= 65) cout << 'B' << endl;
    else if(m + f >= 50 || r >= 50) cout << 'C' << endl;
    else if(m + f >= 30) cout << 'D' << endl;
    else cout << 'F' << endl;
  }
  return 0;
}

Measured memory_bytes: 1156
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <set>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long int lli;

int main(){
	string a,b,c;
	cin>>a>>b>>c;
	cout<<a[0];
	cout<<b[0];
	cout<<c[0];
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919810364364
#define int long long
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first

int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

int x, y, a, b, c;
vector<P> vec;
int cnt1, cnt2, cnt3;
int ans;

signed main() {
	cin >> x >> y >> a >> b >> c;
	for (int i = 0; i < a; i++) {
		int p; 
		cin >> p;
		vec.push_back({ p,1 });
	}
	for (int i = 0; i < b; i++) {
		int p;
		cin >> p;
		vec.push_back({ p,2 });
	}
	for (int i = 0; i < c; i++) {
		int p;
		cin >> p;
		vec.push_back({ p,3 });
	}
	sort(all(vec));
	reverse(all(vec));
	for (int i = 0; i < (int)vec.size(); i++) {
		if (vec[i].second == 1 && cnt1 < x) {
			cnt1++;
			ans += vec[i].first;
		}
		if (vec[i].second == 2 && cnt2 < y) {
			cnt2++;
			ans += vec[i].first;
		}
		if (vec[i].second == 3) {
			cnt3++;
			ans += vec[i].first;
		}
		if (cnt1 + cnt2 + cnt3 == x + y) {
			cout << ans << endl;
			return 0;
		}
	}
}

Measured memory_bytes: 10220
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long int ll;
typedef long double ld;
const ll INF=(1LL<<62);
const ld pi=acosl((ld)-1);
// const ll mod = 1000000007;
const ll mod = 1234567;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
#define endn "\n"

bool solve(){
  ll X,Y,Z;cin>>X>>Y>>Z;
  ll K;cin>>K;
  vector<ll>A(X);
  vector<ll>B(Y);
  vector<ll>C(Z);
  rep(i,X)cin>>A[i];
  rep(i,Y)cin>>B[i];
  rep(i,Z)cin>>C[i];

  priority_queue<ll>que;
  rep(i,X)rep(j,Y)que.push(A[i]+B[j]);

  vector<ll>vAB;
  for(int i=0;!que.empty() and i<4*K;i++){
    vAB.push_back(que.top());
    que.pop();
  }

  priority_queue<ll>ans;
  rep(i,vAB.size())rep(j,Z){
    ans.push(vAB[i]+C[j]);
  }

  rep(i,K){
    cout<<ans.top()<<endl;
    ans.pop();
  }
  
  
  return false;
}

signed main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout<<fixed<<setprecision(30);
  solve();
}


Measured memory_bytes: 149728
#include<bits/stdc++.h>
#define lson (o<<1)
#define rson (o<<1|1)
#define fi first
#define sc second
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
using namespace std;
const double pi=acos(-1);
const double eps=1e-6;
inline int lowbit(int x){return x&(-x);}
inline int read(){
	int f=1,x=0;char ch;
	do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');
	do{x=x*10+ch-'0';ch=getchar();}while(ch>='0'&&ch<='9');
	return f*x;
}
template<typename T> inline T max(T x,T y,T z){return max(max(x,y),z);}
template<typename T> inline T min(T x,T y,T z){return min(min(x,y),z);}
template<typename T> inline T sqr(T x){return x*x;}
template<typename T> inline void checkmax(T &x,T y){x=max(x,y);}
template<typename T> inline void checkmin(T &x,T y){x=min(x,y);}
template<typename T> inline void read(T &x){
x=0;T f=1;char ch;do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');
do x=x*10+ch-'0',ch=getchar();while(ch<='9'&&ch>='0');x*=f;
}
template<typename A,typename B,typename C> inline A fpow(A x,B p,C yql){
	A ans=1;
	for(;p;p>>=1,x=1LL*x*x%yql)if(p&1)ans=1LL*x*ans%yql;
	return ans;
}
struct FastIO{
	static const int S=1310720;
	int wpos;char wbuf[S];
	FastIO():wpos(0){}
	inline int xchar(){
		static char buf[S];
		static int len=0,pos=0;
		if(pos==len)pos=0,len=fread(buf,1,S,stdin);
		if(pos==len)return -1;
		return buf[pos++];
	}
	inline int read(){
		int c=xchar(),x=0;
		while(c<=32&&~c)c=xchar();
		if(c==-1)return -1;
		for(;'0'<=c&&c<='9';c=xchar())x=x*10+c-'0';
		return x;
	}
}io;
//#define read io.read
int main()
{
	int year,month,day;
	string s;
	scanf("%d/%d/%d",&year,&month,&day);
	int n=year*10000+month*100+day;
	if(n<=20190430) cout << "Heisei";
	else cout << "TBD";
	return 0;
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}

ll f(ll x){
	if(x%2){
		return ((x+1)/2)%2;
	}else{
		return x^f(x-1);
	}
}

int main(void){
	ll a,b;
	cin >> a >> b;
	cout << (f(a-1)^f(b)) << endl;
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#ifndef err
#define err(...)(void)0
#endif
using namespace std;
using ll = long long;
using ull = decltype(1ull);
template<class T>int size(T&&a) { return a.size(); }
#define REP(t,a)for(typename make_signed<decltype(a.second)>::type t=a.first,_l##t=a.second;t<_l##t;t++)
#define RREP(t,a)for(typename make_signed<decltype(a.second)>::type t=a.second-1,_l##t=a.first;t>=_l##t;t--)
template<class B>pair<int, B>make_pair(B b) { return{ 0,b }; }
#define rep(t,...)REP(t,make_pair(__VA_ARGS__))
#define rrep(t,...)RREP(t,make_pair(__VA_ARGS__))
#define all(a)begin(a),end(a)
#define rall(a)a.rbegin(),a.rend()
#define var(t, ...) t __VA_ARGS__;in,__VA_ARGS__;

void Calc();
int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr);
  cin.exceptions(istream::failbit | istream::badbit);
  cout << fixed << setprecision(15); Calc(); cout.flush(); return 0;
}
template<class A>void amax(A&a, A b) { a = max(a, b); }
template<class A>void amin(A&a, A b) { a = min(a, b); }
template<class A>int comp(A a, A b) { return a < b ? 1 : b < a ? -1 : 0; }
struct Scanner {
  template<class A = string>A Next() { A a; cin >> a; return a; }
  template<class A = int>vector<A>Array(int n) { vector<A>a(n); for (A&i : a) cin >> i; return a; }
  string Line() const { string s; getline(cin, s); return s; }
  template<class A>Scanner&operator,(A&a) { a = Next<A>(); return *this; }
  template<class A>operator A() { return Next<A>(); }
}in;

/*---------------------------------------------------------------------*/


void Calc() {

  var(int, r, g);
  cout << (g * 2 - r) << endl;




}


Measured memory_bytes: 256
#pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template <typename T>
using pqrev = priority_queue<T, vector<T>, greater<T>>;
#define rep(i, n) for (ll i = 0, i##_end = (n); i < i##_end; i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for (ll i = (a), i##_end = (b); i < i##_end; i++)
#define reprb(i, a, b) for (ll i = (b)-1, i##_end = (a); i >= i##_end; i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
//*
constexpr ll MOD = 1e9 + 7;
/*/
constexpr ll MOD = 998244353;
//*/
constexpr ll INF = 1e+18;
constexpr ld EPS = 1e-12L;
constexpr ld PI = 3.14159265358979323846L;
constexpr ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
constexpr ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
template <typename S, typename T>
constexpr bool chmax(S &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename S, typename T>
constexpr bool chmin(S &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif
template <typename T>
bool print_(const T &a) {
  cout << a;
  return true;
}
template <typename T>
bool print_(const vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back()) {
      cout << " ";
    }
  }
  return false;
}
template <typename T>
bool print_(const vector<vector<T>> &vv) {
  for (auto &v : vv) {
    for (auto &a : v) {
      cout << a;
      if (&a != &v.back()) {
        cout << " ";
      }
    }
    if (&v != &vv.back()) {
      cout << "\n";
    }
  }
  return false;
}
void print() { cout << "\n"; }
template <typename Head, typename... Tail>
void print(Head &&head, Tail &&... tail) {
  bool f = print_(head);
  if (sizeof...(tail) != 0) {
    cout << (f ? " " : "\n");
  }
  print(forward<Tail>(tail)...);
}
#pragma endregion

void Pr(bool f){
  cout << (f ? "Yes" : "No") << "\n";
  exit(0);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  ll h, w, k;
  cin >> h >> w >> k;
  vs s(h);
  rep(i, h){
    cin >> s[i];
  }
  ll ans = 0;
  vvi t(h, vi(w, 0));
  ll n = h+w;
  ll bitN = 1LL << n;
  rep(i, bitN){
    t.assign(h, vi(w, 0));
    rep(j, h){
      if((i >> j) & 1){
        rep(ii, w){
          t[j][ii] = 1;
        }
      }
    }
    repr(j, h, n){
      if((i >> j) & 1){
        rep(ii, h){
          t[ii][j-h] = 1;
        }
      }
    }
    ll c = 0;
    rep(j, h)rep(ii, w){
      c += (t[j][ii] == 0 && s[j][ii] == '#');
    }
    ans += c == k;
  }
  print(ans);
}


Measured memory_bytes: 3656