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

public class Main {
    // cost[数字] でコストが出る
    public static int[] cost = { 0, 2, 5, 5, 4, 5, 6, 3, 7, 6 };
    public static String[] dp;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        Integer[] a = new Integer[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        Arrays.sort(a, Comparator.reverseOrder());
        dp = new String[n + 1];
        Arrays.fill(dp, "");
        for (int i = 0; i < n + 1; i++) {
            int max = -1;
            String tar = "";
            int pos = -1;
            for (int j = 0; j < m; j++) {
                int point = i - cost[a[j]];
                if (point < 0)
                    continue;
                if (point != 0 && dp[point] == "") {

                } else {
                    if (max < dp[point].length() + 1) {
                        max = dp[point].length() + 1;
                        tar = String.valueOf(a[j]);
                        pos = point;
                    }
                }
            }
            if (max != -1) {
                dp[i] = tar + dp[pos];
            }
        }
        System.out.println(dp[n]);
    }

}


Measured memory_bytes: 111952
N=int(input())
H=list(map(int, input().split()))

m=0
count=0

for i in range(N-1):
  if H[i] < H[i+1]:
     if m < count:
       m = count
     count = 0
  else:
    count+=1

if m < count:
  m = count

print(m)

Measured memory_bytes: 15020
#![allow(unused_imports)]

use std::cmp;
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::fmt;
use std::io::{self, BufWriter, Read, Write};
use std::ops::{Add, Div, Mul, Sub};
use std::str::{self, FromStr};


fn solve(n: u64) -> u64 {
    let i = (1..n + 1).rev().find(|i| i * i <= n).unwrap_or(1);
    i * i
}


fn main() {
    let stdin = io::stdin();
    let mut sc = Scanner::new(stdin.lock().bytes());
    println!("{}", solve(sc.next()));
}


struct Scanner<R: Read> {
    buf: Vec<u8>,
    bytes: io::Bytes<R>,
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
    fn new(bytes: io::Bytes<R>) -> Self {
        Scanner {
            buf: Vec::with_capacity(1024),
            bytes: bytes,
        }
    }

    fn next<T: FromStr>(&mut self) -> T
    where
        <T as FromStr>::Err: fmt::Debug,
    {
        let buf = &mut self.buf;
        buf.clear();
        self.bytes
            .by_ref()
            .map(Result::unwrap)
            .skip_while(|&c| c == ' ' as u8 || c == '\n' as u8)
            .take_while(|&c| !(c == ' ' as u8 || c == '\n' as u8))
            .foreach(|c| buf.push(c));
        str::from_utf8(&buf).unwrap().parse().unwrap()
    }

    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T>
    where
        <T as FromStr>::Err: fmt::Debug,
    {
        (0..n).map(|_| self.next()).collect()
    }

    fn pairs<T1: FromStr, T2: FromStr>(&mut self, n: usize) -> Vec<(T1, T2)>
    where
        <T1 as FromStr>::Err: fmt::Debug,
        <T2 as FromStr>::Err: fmt::Debug,
    {
        (0..n).map(|_| (self.next(), self.next())).collect()
    }

    fn trios<T1: FromStr, T2: FromStr, T3: FromStr>(&mut self, n: usize) -> Vec<(T1, T2, T3)>
    where
        <T1 as FromStr>::Err: fmt::Debug,
        <T2 as FromStr>::Err: fmt::Debug,
        <T3 as FromStr>::Err: fmt::Debug,
    {
        (0..n)
            .map(|_| (self.next(), self.next(), self.next()))
            .collect()
    }

    fn mat<T: FromStr>(&mut self, m: usize, n: usize) -> Vec<Vec<T>>
    where
        <T as FromStr>::Err: fmt::Debug,
    {
        (0..m).map(|_| self.vec(n)).collect()
    }
}


trait Foreach {
    type Item;
    fn foreach<F: FnMut(Self::Item)>(self, f: F);
}

impl<T, I: Iterator<Item = T>> Foreach for I {
    type Item = T;

    fn foreach<F: FnMut(T)>(self, mut f: F) {
        self.fold((), move |(), x| f(x));
    }
}


#[allow(dead_code)]
fn print_yesno(x: bool, yes: &'static str, no: &'static str) {
    println!("{}", if x { yes } else { no });
}


#[allow(dead_code)]
fn print_foreach<T: fmt::Display, I: IntoIterator<Item = T>>(xs: I) {
    let stdout = io::stdout();
    let mut stdout = BufWriter::new(stdout.lock());
    for x in xs.into_iter() {
        writeln!(stdout, "{}", x).unwrap();
    }
    stdout.flush().unwrap();
}


#[allow(dead_code)]
fn print_or<T: fmt::Display>(x: Option<T>, or: &'static str) {
    if let Some(x) = x {
        println!("{}", x);
    } else {
        println!("{}", or);
    }
}


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

#define FASTIO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
using ll = long long;

int main(){
	FASTIO
	int n;
	cin >>n;
	cout << ((n >= 30) ? "Yes": "No") << endl;
}

Measured memory_bytes: 3652
//**KEEP IT SHORT AND SIMPLE**
#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define FILES freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define REP(i,a,b) for (int i = a; i < b; i++)
#define NL '\n'
#define F first
#define S second
#define dot(a, b) (conj(a) * (b)).real()
#define cross(a, b) (conj(a)* (b)).imag()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef bool bl;
typedef vector < vector<long long> > vvl;
typedef vector <long long> vll;
typedef pair <long long, long long> pll;
typedef map <long long, long long> mll;
typedef map <long long, bool> mlb;
typedef priority_queue<long long, vector<long long>, greater<long long> > minPq;
typedef tuple<ll, ll, ll> line;
typedef complex<double> point;
const double pi = 2 * acos(0.0);
const int OO = 0x3f3f3f3f;
int main()
{
    IO
    ll n, x, y, cnt = 1, sum = 0;
    cin >> n >> x;
    while(n--)
    {
        cin >> y;
        sum += y;
        cnt += (sum <= x);
    }
    cout << cnt;
    return 0;
}


Measured memory_bytes: 256
//====== begin of bisma c++ template======================================================================================
#include<bits/stdc++.h>
#include <assert.h>
using namespace std;
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define repn(a,b,c) for(int a=b;a>=c;a--)
#define ll long long 
#define sum(a,b) a=a+b
#define mem(a, b) memset(a, (b), sizeof(a))


//=======binarysearch===========
int bs(vector<long long>&a,int que){
 auto it=lower_bound(a.begin(),a.end(),que);
 if(*it==que){
    return it-a.begin();
 }
 return -1;
}
//========binarysearch=========



//=======SUBSET WITH BRUTEFORCE=============
void subsets(string S, int n) {
     int nSub = 1<<n; 
     for(int i=0; i<nSub; i++){
     	  cout<<"{ ";//optional
          for(int k=0; k<n; k++){
               //if the k-th bit is set
               if( (1<<k) & i){
                    cout<<S[k]<<" ";
               } 
          }
          cout<<"}\n"; //optional
     }
}
//======SUBSET WITH BRUTE FORCE================

//======permuatate all ===================================
void permutate(){
int n,x;
cin>>n;

vector<int> permutation;
for (int i = 0; i < n; i++) {
	cin>>x;
permutation.push_back(x);
}
do {
 rep(i,0,n-1) cout<<permutation[i];
 cout<<endl;
} while (next_permutation(permutation.begin(),permutation.end()));
}
//====permuatate all=======================


//====check prime =========================

bool isprime(int x)
{
  if ( x == 2 ) return true;
  if ( x  < 2 ) return false;
  for ( int i = 2; i * i <= x; i++ )
    if ( x % i == 0 ) return false;
  return true;
}
//===check prime ========================


//======= the end of bisma c++ template ================================================================================


int main(){

long n;
cin>>n;

long a[n+1];

rep(i,1,n){
  cin>>a[i];
}

long ans=-1;

rep(i,1,n){
  rep(j,i+1,n){
    ans=max(ans,abs(a[i]-a[j]));
  }
}

cout<<ans;

}



Measured memory_bytes: 256
#include<iostream>
#define endl "\n"
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#include<cmath>
using namespace std;
int main()
{
    fastio;
    double n,d;
    cin>>n>>d;
    int count=0;
    while(n--){
        double x,y;
        cin>>x>>y;
        double dist=sqrt(pow(x,2)+pow(y,2));
        if(dist<= d)
            count++;
    }
    cout<<count<<endl;
    return 0;
}


Measured memory_bytes: 3824
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>

int main()
{
    long long N, K;
    std::cin >> N >> K;
    std::vector<std::pair<long long, long long> > ab(N);
    for(int i=0; i<N; i++) scanf(" %lld %lld", &ab[i].first, &ab[i].second);

    std::sort(ab.begin(), ab.end());
    for(int i=0; i<N; i++){
        K -= ab[i].second;
        if(K <= 0){
            std::cout << ab[i].first << std::endl; break;
        }
    }
}

Measured memory_bytes: 1792
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, A, B;
    cin >> N >> A >> B;
    int cnt[3] = {};
    rep(i, N) {
        int p; cin >> p;
        if(p <= A) cnt[0]++;
        else if(p <= B) cnt[1]++;
        else cnt[2]++;
    }
    cout << min({cnt[0], cnt[1], cnt[2]}) << endl;

    return 0;
}


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

int N;
int a[10100];
int main(){
  cin >> N;
  for(int i=0; i <N; ++i){
    cin >> a[i];
  }
  int counter =0;
  for(int i=0; i<N; ++i){
    bool flag =false;
    while(true){
      if (a[i]%2 == 0){
        ++counter;
        a[i]/=2;
      }
      else flag =true;
      if (flag ==true) break;
    }
  }
  cout << counter << endl;
  return 0;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input_byline {
    ($($r:tt)* ) => {
        let stdin = std::io::stdin();
        let mut q = std::collections::VecDeque::new();
        let mut next = || {
            if q.is_empty() {
                let mut s = String::new();
                stdin.read_line(&mut s);
                for v in s.split_whitespace() {
                    q.push_back(v.to_string());
                }
            }
            q.pop_front().unwrap()
        };
        input_inner!{next, $($r)*}
    };

}

#[allow(unused_macros)]
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

trait Printable {
    fn p(&self);
}

impl<T: std::fmt::Display> Printable for T {
    fn p(&self) {
        println!("{}", self);
    }
}

impl<T: std::fmt::Display> Printable for [T] {
    fn p(&self) {
        for i in 0..self.len() {
            if i != 0 {
                print!(" ");
            }
            print!("{}", self[i]);
        }
        println!("");
    }
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap};

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;
#[allow(dead_code)]
const M: usize = 1e9 as usize + 7;

fn main() {
    input! {
        n: usize,
        a: [usize; n],
    }

    let mut ans = 0;
    for i in 0..63 {
        let mut ones = 0;
        let mut zeros = 0;
        for j in 0..n {
            if (a[j] >> i) & 1 == 1 {
                ones += 1;
            } else {
                zeros += 1;
            }
        }
        let mut add = (1 << i) % M;
        add *= ones;
        add %= M;
        add *= zeros;
        add %= M;
        ans += add;
        ans %= M;
    }

    println!("{}", ans);
}


Measured memory_bytes: 8444
import math
a, b, h, m = map(int, input().split())

pi = math.pi
ht = h*pi/6+m*pi/360
mt = m*pi/30

if ht >= mt:
    theta = ht -mt
else:
    theta = mt - ht

ll = a**2 + b**2 -2*a*b*math.cos(theta)

print(math.sqrt(ll))


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

int main() {
    int H, W; // 1 <= H, W <= 100
    cin >> H >> W;
    vector<string> a(H);
    for (int i = 0; i < H; i++) {
        cin >> a.at(i);
    }
    // skipする行を確認する
    vector<bool> skip_H(H), skip_W(W);
    for (int i = 0; i < H; i++) {
        bool tf = true;
        for (int j = 0; j < W; j++) {
            if (a.at(i).at(j)=='#') {tf=false; break;}
        }
        skip_H.at(i) = tf;
    }
    // skipする列を確認する
    for (int j = 0; j < W; j++) {
        bool tf = true;
        for (int i = 0; i < H; i++) {
            if (a.at(i).at(j)=='#') {tf=false; break;}
        }
        skip_W.at(j) = tf;
    }
    for (int i = 0; i < H; i++) {
        if (skip_H.at(i)) {continue;}
        for (int j = 0; j < W; j++) {
            if (skip_W.at(j)) {continue;}
            cout << a.at(i).at(j);
        }
        cout << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i = 0;i < (int)(n);i++)
#define RREP(i,n) for(int i = (int)n-1;i >= 0;i--)
#define FOR(i,s,n) for(int i = s;i < (int)n;i++)
#define RFOR(i,s,n) for(int i = (int)n-1;i >= s;i--)
#define ALL(a) a.begin(),a.end()
#define IN(a, x, b) (a<=x && x<b)
#define BIT(S,i) ((S&(1ll<<i))>0)
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;}
constexpr long long INF = 1e18;

signed main(){
	int N;
	cin>>N;
	int ans = 0;
	auto f = [](auto&&ff,int A,int K){
		if(A < K)return 0;
		if(A % K == 0)return A / K;
		int t = A / K + 1;
		int m = A % K;
		m = (m + t - 1) / t;
		return ff(ff,A - m * t,K);
	};
	REP(i,N){
		int A,K;
		cin >> A >> K;
		ans ^= f(f,A,K);
	}
	if(ans)cout << "Takahashi" << endl;
	else cout << "Aoki" << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include<math.h>
#include<bitset>
#include<iomanip>
using namespace std;

int main() {
	int N, K; cin >> N >> K;
	vector<long long>num(K, 0);
	for (int i = 1; i <= N; i++)num[i%K]++;
	long long ans = 0;
	for (int a = 0; a < K; a++) {
		int b = (K - a) % K;
		int c = (K - a) % K;
		if ((b + c) % K != 0)continue;
		ans += num[a] * num[b] * num[c];
	}
	cout << ans << endl;
}


Measured memory_bytes: 1792
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long LL;

template<typename T>
istream& operator >> (istream& is, vector<T>& vs){
  for(T& v: vs) is >> v;
  return is;
}

int main() {
  int N; cin >> N;
  vector<double> A(N); cin >> A;

  double sum = 0;
  for (int i = 0; i < N; ++i) {
    sum += 1.0 / A[i];
  }
  printf("%.9f\n", 1.0/sum);
}


Measured memory_bytes: 3804
import bisect
s = input()
t = input()
before = -1
len_s = len(s)
ans = 0
cnt = 0
moji = [[] for _ in range(26)]
for i,S in enumerate(s):
        moji[ord(S) - 97].append(i)

for T in t:
        if not moji[ord(T) - 97]:
                print(-1)
                exit()
        if moji[ord(T) - 97][-1] <= before:
                cnt += 1
                before = moji[ord(T) - 97][0]
                continue
        before = moji[ord(T) - 97][bisect.bisect_right(moji[ord(T) - 97],before)]
        # for num in moji[ord(T) - 97]:
        #         if num > before:
        #                 before = num
        #                 break
ans = cnt * len_s + before + 1
print(ans)

Measured memory_bytes: 7540
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();
    int b = sc.nextInt();
    int total = a * b;
    
    if (a >= 10 || b >= 10) {
      System.out.println(-1);
    } else {
      System.out.println(total);
    }
  }
}

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

int main() {
	int A,B,C,K;
	cin >> A >> B >> C >> K;

	while(K--)
		if(B <= A)
			B *= 2;
		else if(C <= B)
			C *= 2;

	if(A<B && B<C)
		cout << "Yes";
	else
		cout << "No";
	cout << endl;
}

Measured memory_bytes: 3632
import java.util.Scanner;

public class Main { 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int productBis = Integer.parseInt(line[0]);
		int neededTime = Integer.parseInt(line[1]);
		int allowedTime = Integer.parseInt(line[2]);
		
		System.out.println((allowedTime/productBis)*neededTime);

		
		
		
	}
}
	
	

Measured memory_bytes: 21844
/*
ID: seekho
PROG: friday
LANG: C++14                 
*/
/* LANG can be C++11 or C++14 for those more recent releases */

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

//find_by_order gives kth-largest element
//order_of_key gives the number of items in the set that are strictly smaller!!

// OT.find_by_order(k-1)
// 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define db4(x, y, z, w) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << "," << #w << "=" << w << endl
#define ll long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define X first
#define Y second
#define sz(x) (int)((x).size())
#define pii pair<int,int>
#define MOD (ll)(998244353)
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
typedef vector<int> vi;
#define inf (ll)(1e18)
#define double long double
#define int long long

//////////////////////
// const int N = 100005;

int32_t main() {

    ios::sync_with_stdio(false);
    cin.tie(0); 
    cout.tie(0);

    int a[5];
    memset(a,0,sizeof a);
    rep(i,3) {
        int x,y;
        cin >> x >> y;
        a[x]++;
        a[y]++;
    }

    repA(i,1,4) {
        if(a[i] >= 3) {
            cout << "NO\n";
            return 0;
        }
    }
    cout << "YES\n";
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        
        // 標準入力の取得
        int N = Integer.parseInt(scan.nextLine());

        List<String> W = new ArrayList<String>(N);
        for (int i = 0; i < N; i++) {
            W.add(scan.nextLine());
        }

        // 重複チェック
        Set<String> Wst = new HashSet<String>(W);
        if(!(Wst.size() == W.size())){
            System.out.println("No");
            return ;
        }
        
        // しりとりできてるかチェック
        String prev = "";
        String next = "";
        for (int i = 0; i < N-1; i++) {
            prev = W.get(i);
            next = W.get(i+1);
            
            if(prev.charAt(prev.length() - 1) != next.charAt(0)){
                System.out.println("No");
                return ; 
            }
        }
        System.out.println("Yes");
        return ; 
    }
}


Measured memory_bytes: 21972
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>

#define pb push_back
#define mp make_pair

using namespace std;

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

int main() {
  ll a, b, c;
  ull k;
  cin >> a >> b >> c >> k;

  if (k % 2 == 0) {
    cout << a-b << endl;
  } else {
    cout << b-a << endl;
  }

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();

		int A[][] = new int[N][M];
		int B[] = new int[M];

		for(int row = 0; row < N; row++){
			for(int col = 0; col < M; col++){
				A[row][col] = sc.nextInt();
			}
		}

		for(int row = 0; row < M; row++){
			B[row] = sc.nextInt();
		}

		int ans;

		for(int row = 0; row < N; row++){
			ans = 0;
			for(int col = 0; col < M; col++){
				ans += A[row][col]*B[col];
			}
			System.out.printf("%d\n", ans);
		}
	}
}




Measured memory_bytes: 41324
a = [list(map(int, input().split())) for i in range(3)]
n =int(input())

for k in range(n):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if a[i][j] == b:
                a[i][j] = 0
    row0 = a[0] == [0, 0, 0]
    row1 = a[1] == [0, 0, 0]
    row2 = a[2] == [0, 0, 0]
    colum0 = [a[0][0], a[1][0], a[2][0]] == [0, 0, 0]
    colum1 = [a[0][1], a[1][1], a[2][1]] == [0, 0, 0]
    colum2 = [a[0][2], a[1][2], a[2][2]] == [0, 0, 0]
    diag0 = [a[0][0], a[1][1], a[2][2]] == [0, 0, 0]
    diag1 = [a[2][0], a[1][1], a[0][2]] == [0, 0, 0]
    if row0 or row1 or row2 or colum0 or colum1 or colum2 or diag0 or diag1:
        print('Yes')
        break
else:
    print('No')

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

#define rep(i,n) for(i=0;i<(n);i++)
#define For(i,a,b) for(i=(a);i<(b);i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const double PI=acos(-1.0);

int main(){
	int i,j,k;
	string s;
	int c=0;
	cin >> s;
	rep(i,3){
		if(s.substr(i,1)=="1") c++;
	}

	cout << c << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<math.h>
#include<list>
#include <algorithm>
#include<set>
#include<vector>
#include<math.h>
#include<map>
#include<string>
using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;

template<typename T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

#define in(x) cin >> x
#define out(x) cout << x
#define outn(x) cout << x << '\n'
#define outs(x) cout << x << ' '
#define rep(i,s,e) for(long i=s;i<e;i++)
#define repeq(i,s,e) for(long i=s;i<=e;i++)


int main() {
	ll n, m,ans=0;
	vector<pair<ll, ll>> vp;
	pair<ll, ll> tmp;
	in(n);
	in(m);

	rep(i, 0, n) {
		in(tmp.first);
		in(tmp.second);
		vp.push_back(tmp);
	}
	
	sort(vp.begin(), vp.end());
	rep(i, 0, n) {
		if (vp[i].second < m) {
			ans += vp[i].second * vp[i].first;
			m -= vp[i].second;
		}
		else {
			ans += vp[i].first * m;
			break;
		}
	}

	outn(ans);
	return 0;
}


Measured memory_bytes: 2420
A,B = map(int,(input().split()))
def xor(n):
    if n%2 == 1:
        if (n+1)%4 == 0:
            return 0
        else:
            return 1
    else:
        if n%4 == 0:
            return n^0
        else:
            return n^1
            
print(xor(A-1)^xor(B))

Measured memory_bytes: 38256
import sys
A,B = map(int,input().split())
s = str(input())
#print(s[:A],s[A+1:A+B+1],s[A])
if s[A] != '-':
    print("No")
    sys.exit()
elif '-' in s[:A] or '-' in s[A+1:A+B+1]:
    print("No")
else:
    print("Yes")

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

int main() {
    std::vector<int> hills;
    
    int n;
    while (std::cin >> n) {
        hills.push_back(n);
    }
    
    std::sort(hills.begin(), hills.end(), std::greater<int>());
    
    for (int i = 0; i < 3; ++i) {
        std::cout << hills[i] << std::endl;
    }
    
    return 0;
}

Measured memory_bytes: 1212
S = input()
S = S[::-1]
#簡単にするためにひっくり返す
N = len(S)

A=[0]*2019
number=0
A[0]=1
#０を２０１９で割った余りは０
d=1

ans=0

for i in S:
  number+=int(i)*d
  A[number%2019]+=1
  d=10*d
  d=d%2019

for i in A:
  ans+=i*(i-1)//2

print(ans)



Measured memory_bytes: 68584
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define REP(i, n) for(int i = 0;i < (n);++i)
#define RREP(i, n) for(int i = (n)-1; i >= 0; --i)

#define endl '\n'
#define pb push_back
#define eb emplace_back
#define pque priority_queue
#define umap unordered_map
#define BIG 2000000000
#define VERYBIG 1000000000000000ll
#define PI 3.1415926
#define coutdb cout<<fixed<<setprecision(15)

const int dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,-1,0,1,1,-1,1,-1};
const long long MOD = 1777777777;

// typedef int_fast64_t ll;
#define int int_fast64_t

template<typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template<typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template<typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}

typedef pair<int, int> INTP;
typedef vector<int> INTV;
struct edge2 {int to, cost;};
struct edge3 {int from, to, cost;};

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

  int A, B; cin >> A >> B;
  cout << max((int)0, A-2*B) << endl;
}

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

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
//template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) {os << p.first << " " << p.second;return os;}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T, class U>bool chmin(T& a, U b) { if (a > b) { a = b; return true; }return false; }
template <class T, class U>bool chmax(T& a, U b) { if (a < b) { a = b; return true; }return false; }

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	string N; cin >> N;
	sort(all(N));
	bool f = N[0] == N[1] and N[2] == N[3] and N[1]!=N[2];
	Yes(f);
	return 0;
}


Measured memory_bytes: 256
package main
import (
	"fmt"
)

func notExist(l []int, i int) bool{
  flag := true
  for _, v := range l {
    if v == i {
      flag = false
      return flag
    }
  }
  return flag
}

func loop (x, n int, l []int) int {
  ans := x
  for i:=0; i <= n; i++ {
    for j := -1; j != 3; j +=2{
      if notExist(l, x + i * j) {
        ans = x + i * j
        return ans
      }
    }
  }
  return ans
}

func main() {
  var x, n, a int
  fmt.Scan(&x)
  fmt.Scan(&n)
  l := make([]int, n)
  for i:=0; i < n; i++ {
    fmt.Scan(&a)
    l[i] = a
  }

  ans := loop(x, n, l)
  fmt.Printf("%d\n", ans) 
}

Measured memory_bytes: 1836
import collections
N = int(input())
A = list(map(int, input().split()))
m = max(A)
A2 = dict(collections.Counter(A))
#print(A2)
Q = int(input())
#BC = [0] * Q
#for i in range(Q):
#  BC[i] = list(map(int, input().split()))

ans = [0] * (10 ** 5)
for i in range(1, 10 ** 5 + 1):
  if i in A2:
    ans[i - 1] = A2[i]
#print(ans)
now = sum(A)
#print(now)
for i in range(Q):
  b, c = map(int, input().split())
  now += ans[b - 1] * (c - b)
  ans[c - 1] += ans[b - 1]
  ans[b - 1] = 0
  #print(ans)
  print(now)
  
  
  
  
  
  


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

// iterator
#define REP(i,from, to) for(lli i=from;i<to;i++)
#define REPE(i,from, to) for(lli i=from;i<=to;i++)
#define REP_R(i,from, to) for(lli i=from;i>to;i--)
#define REPE_R(i,from, to) for(lli i=from;i>=to;i--)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

// input
#define cin1(x)             cin >> x
#define cin2(x, y)          cin >> x >> y
#define cin3(x, y, z)       cin >> x >> y >> z
#define ncin1(n, x)         REP(i, 0, n) {cin1(x[i]);}
#define ncin2(n, x, y)      REP(i, 0, n) {cin2(x[i], y[i]);}
#define ncin3(n, x, y, z)   REP(i, 0, n) {cin3(x[i], y[i], z[i]);}

// output
#define cout1(x)         cout << #x << ": " << x << endl;
#define cout2(x, y)      cout << #x << ": " << x << ", " << #y << ": " << y << endl;
#define cout3(x, y, z)   cout << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl;;
#define ncout1(n, x)     REP(i, 0, n) {cout << #x << "[" << i << "]: "<< x[i] << endl;}

#define coutp(p)         cout << #p << ":" <<  " (" << p.first << ", " << p.second << ")" << endl;

// sort
#define sort_r(x, y)        sort(x, y, greater<lli>()); // 降順(5,4,3,,,)

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

typedef long long int lli;
typedef pair<lli, lli> P;
typedef tuple<lli, lli, lli> tup;



// dp[i][j] := i個目までの鍵で、状態jを叶える最小のコスト
//            状態jとは、x桁目はx個目の宝箱を開けられるか？というやつ
lli dp[1001][4096];

int main() {
    lli n,m;
    cin2(n,m);
    lli a[m], b[m];
    vector<lli> c[m];
    REP(i,0,m) {
        cin >> a[i] >> b[i];
        REP(j,0,b[i]) {
            lli cx;
            cin >> cx;
            c[i].push_back(cx);
        }
    }
    int inf = 10000000;
    REP(i,0,1001) {
        REP(j,0,4096) {
            dp[i][j] = inf;
        }
    }
    dp[0][0] = 0;
    REP(item,0,m) {
        // この item がもたらす効果を bit で表す
        lli item_bit = 0;
        REP(i,0,b[item]) {
            item_bit |= (1<<(c[item][i]-1));
        }
        //cout1(item_bit);

        // この bit をすべての状態に or 演算していく
        REPE(i,0,(1<<(n))-1) {
            dp[item+1][i] = min(dp[item+1][i], dp[item][i]);
            dp[item+1][i|item_bit] = min({
                    dp[item+1][i|item_bit],
                    dp[item][i|item_bit],
                    dp[item][i] + a[item]
                    });
            //cout1(i);
            //cout3(item+1, (i|item_bit), dp[item+1][i|item_bit]);
        }

    }
    if (dp[m][(1<<n)-1] == inf)
        cout << -1 << endl;
    else
        cout << dp[m][(1<<n)-1] << endl;
}


Measured memory_bytes: 32512
#include <stdio.h>
#include <stdlib.h>

#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdint.h>
#include <string.h>

#include <unordered_set>

#define _USE_MATH_DEFINES
#include <math.h>


#include <vector>
#include <list>

#include <set>
#include <map>

#include <unordered_map>

#include <queue>
#include <stack>

#include <string>

#include <vector>

#define sqr(x) (x) * (x)

#include <algorithm>
#include <functional>

#include <bitset>

#include <functional>

#include <chrono>

typedef unsigned int u32;
typedef int i32;

typedef unsigned long long int u64;
typedef int32_t i64;

typedef uint16_t u16;
typedef int16_t i16;

typedef uint8_t u8;
typedef int8_t i8;


using namespace std;
using namespace std::chrono;

struct less_key
{
    bool operator() (pair<i64, i64> p1, pair<i64, i64> p2)
    {
        return p1.first > p2.first || (p1.first == p2.first && p1.second < p2.second);
    }
};

struct pair_hash {
public:
    std::size_t operator()(const std::pair<u64, u64> &x) const
    {
        return std::hash<u64>()(x.first) ^ std::hash<u64>()(x.second);
    }
};
#include <random>

const i64 mod = 1000000007ll;
const i64 smod = 998244353ll;
const i64 inf = 10000000000000007ll;

const double eps = 1e-10;

// del

const i64 MAXN = 300005;

i64 M = 15;

string s;

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(15); cout.setf(ios::fixed);

    cin >> s;

    i64 l = 0;

    for (i64 i = 0; i < s.size(); i++) {
        if (s[i] == 'x') {
            l++;
        }
    }

    if (l >= 8) {
        cout << "NO";
    }
    else {
        cout << "YES";
    }

    return 0;
}

Measured memory_bytes: 256
#include<string>
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include <string.h>
using ll = long long;
 
#define rep(i, n) for(ll i = 0; i < (int)(n); i++)
#define reps(i,x) for(ll i=1;i<=(int)(x);i++)
#define rrep(i,x) for(ll i=((int)(x)-1);i>=0;i--)
#define rreps(i,x) for(ll i=(int)(x);i>0;i--)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define vll vector<ll>
#define vi vector<int>
#define mp make_pair
#define vpll vector<pair<ll,ll>>
#define vpi vector<pair<int,int>>
#define mod 1000000007 
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  rep(i,3){
    if(s[i] == '1')
      ans++;
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

void Main() {
  string s;
  cin >> s;
  pr(s.substr(0,3));
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 3616
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n = int(input())
    
    res = [[0] * 10 for _ in range(10)]
    for i in range(1, n+1):
        s = str(i)
        if s[-1] == '0':
            continue
        res[int(s[0])][int(s[-1])] += 1

    ans = 0
    for i in range(1, 10):
        for j in range(1, 10):
            ans += res[i][j] * res[j][i]
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

int eat_count(int p, int a, int d)
{
  int cnt = 0;
  for(int i = 1; i <= d; i += a) {
    cnt++;
  }
  // cout << cnt << endl;
  return cnt;
}

int main()
{
  int n, d, x;
  vector<int> a;
  cin >> n >> d >> x;
  REP(i, n) {
    int w;
    cin >> w;
    a.push_back(w);
  }
  int sum = 0;
  REP(i, n) {
    sum += eat_count(i, a[i], d);
  }
  cout << sum + x << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
char d[10];
int n,k;
int main()
{
	cin>>n>>k;
	for (int i=0;i<k;i++)
	{
		char f;
		cin>>f;
		d[f-'0']=1;
	}
	for (int i=n;;i++)
	{
		stringstream st;
		string s;
		st<<i;
		st>>s;
		bool flag=false;
		for (int j=0;j<s.size();j++)
		{
			if (d[s[j]-'0']==1)
			{
				flag=true;
			}
		}
		if (!flag)
		{
			cout<<i<<endl;
			return 0;
		}
	}
}

Measured memory_bytes: 256
import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val X, N = sc.nextInt
  val p = Set.fill(N)(sc.nextInt)

  var i = 0
  var x = Int.MaxValue
  var z = 0
  do {
    if (!p.contains(X - i) && i < x) {
      x = i
      z = X - i
    } else if (!p.contains(X + i) && i < x) {
      x = i
      z = X + i
    }
    i += 1
  } while (x == Int.MaxValue)
  println(z)
}


Measured memory_bytes: 55728
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define mp make_pair
#define INF (1LL<<60)
typedef long long Int;

struct node { int x, t, p; };
bool operator<(const node& l, const node& r) {
    return l.t!=r.t ? l.t<r.t : l.x!=r.x ? l.x<r.x : l.p<r.p;
}

int N, V, XL, XR;
node X[4000];

inline bool connect(int i, int j) {
    return abs(X[j].x-X[i].x)<=(long long)V*abs(X[j].t-X[i].t);
}

pair<int, int> pre[10000];
int vis[10000];
Int h[10000];
vector<int> v[10000];
vector<Int> c[10000];

inline void add_edge(int _u, int _v, Int _c) {
    v[_u].push_back(_v);
    c[_u].push_back(_c);
}

int main() {
    scanf("%d%d%d%d", &N, &V, &XL, &XR);
    X[0].x = XL;
    X[1].x = XR;
    rep(i, N) scanf("%d%d%d", &X[i+2].x, &X[i+2].t, &X[i+2].p);
    N += 2;
    sort(X, X+N);
    rep(i, 2) add_edge(0, 2+i*2, 0);
    rep(i, N) {
        const int f = 2+2*i+1;
        add_edge(f-1, f, -X[i].p);
        add_edge(f, 1, 0);
        for(int j=i+1; j<N; j++) if(connect(i, j)) add_edge(f, 2+j*2, 0);
    }
    rep(i, N) h[2+i*2] = INF;
    rep(i, 2) h[2+i*2] = 0, pre[2+i*2] = mp(0, i);
    rep(i, N) {
        const int f = 2+i*2+1;
        h[f] = h[f-1] - X[i].p;
        pre[f] = mp(f-1, 0);
        rep(j, v[f].size()) if(h[v[f][j]] > h[f]) {
            h[v[f][j]] = h[f];
            pre[v[f][j]] = mp(f, j);
        }
    }
    Int a = -h[1];
    int cur = 1;
    while(cur!=0) {
        const int f = pre[cur].first;
        const int k = pre[cur].second;
        add_edge(cur, f, -c[f][k]);
        c[f][k] = INF;
        cur = f;
    }
    set<pair<Int, int> > q;
    q.insert(mp(0, 0));
    while(!q.empty()) {
        const pair<Int, int> vv(*q.begin());
        q.erase(q.begin());
        const int cc = vv.first;
        const int ix = vv.second;
        if(vis[ix]) continue;
        vis[ix] = 1;
        if(ix==1) {
            a -= h[1] + cc;
            break;
        }
        rep(i, v[ix].size()) {
            const Int nc = cc + c[ix][i] + h[ix] - h[v[ix][i]];
            if(vis[v[ix][i]]==0) {
                q.insert(mp(nc, v[ix][i]));
            }
        }
    }
    cout << a << endl;
    return 0;
}

Measured memory_bytes: 176000
#include<stdio.h>
int main()
{
	long long int a,p=100,count=0,sum=0;
	scanf("%lld",&a);
	while(sum!=a){
		sum=p+(p*0.01);
		p=sum;
		count++;
		if(sum>=a){
			break;
		}
	}
	printf("%lld\n",count);
	return 0;
}


Measured memory_bytes: 1732
/*
START BY THE NAME OF ALMIGHTY ALLAH
THIS WONT BE ACCEPTED
STOP_GIVING_UP
*/
#include<bits/stdc++.h>
#define l(i,a,n)for(int i=a;i<n;i++)
#define pb push_back
#define in insert
#define mp make_pair
#define lw(v) sort(v.begin(),v.end());
#define hi(v) sort(v.begin(),v.end(),greater<long long>());
#define all(v) v.begin(),v.end()
#define filein freopen ("input.txt", "r", stdin)
#define fileout freopen ("output.txt", "w", stdout)
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    long long t,r=1,r1=0,r2=0,k=0,a,b,c=1,m,d=0,n,e,f,x=0,g,p=0,q=0,y=0,z=0;
    vector<long long>v;
    vector<long long>u;
    set<long long>s;
    std::vector<int>::iterator it;
    string  s1,s2,s3,s4;
  l(i,0,5)
  {

  cin>>n;
  v.pb(n);
  }
  l(i,0,5)
  {
      if(v[i]==0)
      {
          cout<<i+1<<endl;
      }
  }
}


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

int main() {
  
  int64_t N, T, A, ans; cin >> N >> T >> A;
  
  int64_t minDif = 1000000000; T *= 1000; A *= 1000;
  
  for (int i = 0; i < N; i++) {
    
    int H; cin >> H;
    
    int tmp = T - H * 6;
    
    if (abs(A - tmp) < minDif) {
      minDif = abs(A - tmp);
      ans = i + 1;
    }
    
  }
  
  cout << ans << endl;
  
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

using namespace std;

typedef long long ll;

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

int main(void) {
	ll res,n,x,a;
	cin >> n >> x;
	cin >> res;
	res = abs(res - x);
	for(ll i = 1;i < n;i++) {
		cin >> a;
		res = gcd(res,abs(a-x));
	}
	cout << res << endl;
}


Measured memory_bytes: 256
main :: IO ()
main = do
  n <- readLn :: IO Int
  print $ solve n

solve :: Int -> Int
solve n
  | n < 3 * 5 * 7 = 0
  | n < 3 ^ 3 * 5 = 1
  | n < 3 * 5 * 11 = 2
  | n < 3 ^ 3 * 7 = 3
  | n < 3 * 5 * 13 = 4
  | otherwise = 5


Measured memory_bytes: 508
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] arr = s.toCharArray();
		sc.close();

		int ans0 = 0;
		for (int i = 0; i < arr.length; i++) {
			if (i % 2 == 0 && arr[i] == '1') {
				ans0++;
			} else if (i % 2 == 1 && arr[i] == '0') {
				ans0++;
			}
		}

		int ans1 = 0;
		for (int i = 0; i < arr.length; i++) {
			if (i % 2 == 0 && arr[i] == '0') {
				ans1++;
			} else if (i % 2 == 1 && arr[i] == '1') {
				ans1++;
			}
		}

		System.out.println(Math.min(ans0, ans1));
	}
}


Measured memory_bytes: 27248
//****************************//
/**********  main *************/
//****************************//
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;
typedef long long ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define REP(i, n) for(i = 0; i < n; i++)
#define FOR(i, a, b) for(i = a; i < b; i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())

double pi = 3.141592653589793;

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

int main() {

    cin.tie(0);
    ios::sync_with_stdio(false);

    int x ;
    cin >> x ;

    x >= 30 ? (cout << "Yes" << endl) : (cout << "No" << endl);



    return 0;
}


Measured memory_bytes: 3644
n, k = map(int, input().split())
xy = [list(map(int, input().split())) for _ in range(n)]

xy.sort()

ans = float("inf")
for i in range(n):
    for j in range(i + k - 1, n):
        width = xy[j][0] - xy[i][0]
        y = [e for _, e in xy[i:j+1]]
        y.sort()
        for e1, e2 in zip(y, y[k-1:]):
            height = e2 - e1
            area = width * height
            ans = min(ans, area)

print(ans)


Measured memory_bytes: 3064
import java.util.*

enum class Directions(val dir: Pair<Int,Int>) {
    U(0 to 1),
    D(0 to -1),
    L(-1 to 0),
    R(1 to 0),
}

enum class Warp(val dir: Pair<Int,Int>) {
    U21(-2 to 2), U22(-1 to 2), U23(0 to 2), U24(1 to 2), U25(2 to 2),
    U11(-2 to 1), U12(-1 to 1),                  U14(1 to 1), U15(2 to 1),
    LR1(-2 to 0),                                                      LR5(2 to 0),
    D11(-2 to -1), D12(-1 to -1),                   D14(1 to -1), D15(2 to -1),
    D21(-2 to -2), D22(-1 to -2), D23(0 to -2), D24(1 to -2), D25(2 to -2),
}

fun main(args: Array<String>) {
    val (h, w) = readLine()!!.split(' ').map { it.toInt() }
    val (ch, cw) = readLine()!!.split(' ').map { it.toInt() }
    val (dh, dw) = readLine()!!.split(' ').map { it.toInt() }

    val field = Array(h+2) {Array(w+2){'#'} }
    repeat(h) {
        field[it+1] = arrayOf('#') + readLine()!!.toCharArray().toTypedArray() + arrayOf('#')
    }

    val queue = ArrayDeque<Pair<Int,Int>>()
    val queueWarp = ArrayDeque<Pair<Int,Int>>()
    queue.add(ch to cw)

    var d = 0
    var nowH = ch
    var nowW = cw
    while (!(nowH == dh && nowW == dw)) {
        while (queueWarp.isNotEmpty()) {
            val pos = queueWarp.poll()
            if(field[pos.first][pos.second] == '.') queue.add(pos)
        }
        while (queue.isNotEmpty()) {
            val pos = queue.poll()
            if (field[pos.first][pos.second] == '.') {
                nowH = pos.first
                nowW = pos.second
                field[pos.first][pos.second] = '#'
                if (nowH == dh && nowW == dw) {
                    println(d)
                    return
                }
                Directions.values().forEach {
                    val row = pos.first + it.dir.first
                    val col = pos.second + it.dir.second
                    if (row > 0 && col > 0 && row <= h && col <= w && field[row][col] != '#') {
                        queue.add(row to col)
                    }
                }
                Warp.values().forEach {
                    val row = pos.first + it.dir.first
                    val col = pos.second + it.dir.second
                    if (row > 0 && col > 0 && row <= h && col <= w && field[row][col] != '#') {
                        queueWarp.add(row to col)
                    }
                }
            }
        }
        if (queue.isEmpty() && queueWarp.isEmpty()) {
            println(-1)
            return
        }
        d++
    }
}


Measured memory_bytes: 77320
#include<iostream>
#include<string>
//0001
#include<cstddef>
#include<queue>
#include<vector>
//0003
#include<algorithm>
using namespace std;

int main() {
	//0000
	/*
	int i, j;

	for (i = 1; i < 10; i++) {
		for (j = 1; j < 10; j++) {
			cout << i << "x" << j << "=" << i*j << endl;
		}
	}
	*/
	//0001
	/*
	int i;
	const size_t MNum = 10;
	int MHeight[MNum];
	int MH1 = 0, MH2 = 0, MH3 = 0;
	for (i = 0; i < 10; i++) {
		cin >> MHeight[i];
		if (MHeight[i] > MH1) {
			MH3 = MH2;
			MH2 = MH1;
			MH1 = MHeight[i];
		}
		else if (MHeight[i] > MH2) {
			MH3 = MH2;
			MH2 = MHeight[i];
		}
		else if (MHeight[i] > MH3) {
			MH3 = MHeight[i];
		}
	}
	cout << MH1 << endl << MH2 << endl << MH3 << endl;
	*/
	/*
	priority_queue<int, vector<int>, less<int> > que;
	int MH;

	for (int i = 0; i < 10; i++) {
		cin >> MH;
		que.push(MH);
	}

	for (int j = 0; j < 3; j++) {
		cout << que.top() << endl;
		que.pop();
	}
	*/
	//0002
	/*
	int a, b;
	while (cin >> a >> b) {
		int sum = a + b;
		int count = 0;
		while (sum > 0) {
			sum = sum / 10;
			count++;
		}
		cout << count << endl;
	}
	*/
	//0003
	int a[3];
	int N;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a + 3);
		if (a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}


	return 0;
}

Measured memory_bytes: 1168