iidai/codenet huggingface dataset:
Language: Java

import java.util.Scanner;

public class s185737640 {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        sc.close();

        if (S.length() % 2 == 1) {
            S = S.substring(0, S.length() - 1);
        } else {
            S = S.substring(0, S.length() - 2);
        }

        for (; S.length() > 0; S = S.substring(0, S.length() - 2)) {
            if (isEvenString(S)) {
                break;
            }
        }
        System.out.println(S.length());
    }

    static boolean isEvenString(String s) {
        String a = s.substring(0, s.length() / 2);
        String b = s.substring(s.length() / 2);
        if (a.equals(b)) {
            return true;
        } else {
            return false;
        }
    }
}


Example test case(s):
input: abaababaab

output: 6
Language: Java

import static java.lang.Integer.parseInt;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class s612878490 {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        String[] words;

        line = br.readLine();

        int N, M;
        N = parseInt(line.substring(0, line.indexOf(' ')));
        M = parseInt(line.substring(line.indexOf(' ') + 1));

        int[] shortage = new int[M];

        for (int i = 0; i < M; i++) {
            line = br.readLine();
            int A = parseInt(line.substring(0, line.indexOf(' ')));
            shortage[i] = N > A ? N - A : 0;
        }

        Arrays.sort(shortage);

        int ans = 0;

        for (int i = 0; i < M - 1; i++) {
            ans += shortage[i];
        }

        System.out.println(ans);
    }
}


Example test case(s):
input: 4 5
1 7
6 2
3 5
4 4
0 8

output: 4
Language: Java

import java.util.Scanner;

public class s312529015 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        if (A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0) {
            System.out.println("Possible");
        } else {
            System.out.println("Impossible");
        }
    }
}


Example test case(s):
input: 4 5

output: Possible
Language: Java

import java.util.Scanner;

public class s699933302 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (c % i == 0) {
                count++;
            }
        }
        System.out.println(count);
    }
}


Example test case(s):
input: 5 14 80

output: 3
Language: Java

import java.util.Scanner;

public class s890213274 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A1 = sc.nextInt();
        int A2 = sc.nextInt();
        int A3 = sc.nextInt();

        if ((A1 + A2 + A3) >= 22) {
            System.out.println("bust");
        } else {
            System.out.println("win");
        }
    }
}


Example test case(s):
input: 5 7 9

output: win
Language: Java

import java.util.Scanner;

public class s264878779 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        long ans = 0;
        for (int mask = 0; mask < 1 << (n - 1); mask++) {
            long sum = 0;
            String x = "" + s.charAt(0);
            for (int i = 0; i < n - 1; i++) {
                if ((mask & (1 << i)) >= 1) {
                    x += "+" + s.charAt(i + 1);
                } else {
                    x += s.charAt(i + 1);
                }
            }
            String[] split = x.split("\\+");
            for (int i = 0; i < split.length; i++) {
                sum += Long.valueOf(split[i]);
            }
            ans += sum;
        }
        System.out.println(ans);
    }
}


Example test case(s):
input: 125

output: 176
Language: Java

import java.io.*;
import java.util.*;

public class s968213233 {

    public s968213233(FastScanner in, PrintWriter out, int test) {
        int N = in.nextInt();
        int[] A = new int[N];
        for (int i = 0; i < N; i++) A[i] = in.nextInt();
        Arrays.sort(A);

        long res = 0;

        PriorityQueue<int[]> q =
                new PriorityQueue<>(
                        Comparator.comparingInt((int[] e) -> Math.min(e[0], e[1])).reversed());
        q.add(new int[] {A[N - 1], A[N - 1]});

        for (int i = N - 2; i >= 0; i--) {
            int a = A[i];
            int[] place = q.remove();
            res += Math.min(place[0], place[1]);
            q.add(new int[] {place[0], a});
            q.add(new int[] {a, place[1]});
        }
        out.println(res);
    }

    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);

        FastScanner in = new FastScanner(System.in);

        for (int t = 1; t <= 1; t++) {
            s968213233 sol = new s968213233(in, out, t);
        }

        out.close();
    }
}

class FastScanner {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;

    public FastScanner(InputStream stream) {
        this.stream = stream;
    }

    int read() {
        if (numChars == -1) throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) return -1;
        }
        return buf[curChar++];
    }

    boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    boolean isEndline(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String next() {
        int c = read();
        while (isSpaceChar(c)) c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    String nextLine() {
        int c = read();
        while (isEndline(c)) c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndline(c));
        return res.toString();
    }
}


Example test case(s):
input: 4
2 2 1 3

output: 7
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class s445598069 {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(br.readLine());

        String str[] = br.readLine().split(" ");

        int s[] = new int[100010];

        for (int i = 0; i < n; i++) {
            s[Integer.parseInt(str[i])]++;
        }

        int dec = 0;

        for (int i = 0; i < s.length; i++) {
            if (s[i] != 0) {
                if (s[i] % 2 == 0) {
                    s[i] = 2;
                } else {
                    s[i] = 1;
                }
            }
        }

        int one = 0;
        int two = 0;

        for (int i = 0; i < s.length; i++) {
            if (s[i] == 2) {
                two++;
            } else if (s[i] == 1) {
                one++;
            }
        }

        if (two % 2 != 0) {
            one--;
        }

        System.out.println(two + one);
    }
}


Example test case(s):
input: 5
1 2 1 3 7

output: 3
Language: C

#include <stdio.h>
#include <stdlib.h>

typedef struct {
    int parent;
    int right;
    int left;
} BT;

BT bt[26];
int n;

void Preorder(int a) {
    if (a == -1) return;

    printf(" %d", a);
    Preorder(bt[a].left);
    Preorder(bt[a].right);
}

void Inorder(int a) {
    if (a == -1) return;

    Inorder(bt[a].left);
    printf(" %d", a);
    Inorder(bt[a].right);
}

void Postorder(int a) {
    if (a == -1) return;

    Postorder(bt[a].left);
    Postorder(bt[a].right);
    printf(" %d", a);
}

int main() {
    int i, j, num, depth = 0;

    scanf("%d", &n);

    for (i = 0; i < n; ++i) bt[i].parent = -1;

    for (i = 0; i < n; i++) {
        scanf("%d", &num);
        scanf("%d%d", &(bt[num].left), &(bt[num].right));

        if (bt[num].left != -1 && bt[num].right != -1) {
            bt[bt[num].left].parent = num;
            bt[bt[num].right].parent = num;

        } else if (bt[num].left != -1)
            bt[bt[num].left].parent = num;
        else if (bt[num].right != -1)
            bt[bt[num].right].parent = num;
    }

    for (i = 0; bt[i].parent != -1; ++i)
        ;

    printf("Preorder\n");
    Preorder(i);
    printf("\n");

    printf("Inorder\n");
    Inorder(i);
    printf("\n");

    printf("Postorder\n");
    Postorder(i);
    printf("\n");

    return 0;
}

Example test case(s):
input: 9
0 1 4
1 2 3
2 -1 -1
3 -1 -1
4 5 8
5 6 7
6 -1 -1
7 -1 -1
8 -1 -1

output: Preorder
 0 1 2 3 4 5 6 7 8
Inorder
 2 1 3 0 6 5 7 4 8
Postorder
 2 3 1 6 7 5 8 4 0
Language: C

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

struct node {
    unsigned int key;
    struct node *next;
    struct node *prev;
};

typedef struct node *NodePointer;

NodePointer nil;

NodePointer listSearch(int);
void init(void);
void printList(void);
void deleteNode(NodePointer);
void deleteFirst(void);
void deleteLast(void);
void delete(int);
void insert(int);

int main() {
    int key, n, i;
    int size = 0;
    char com[20];
    int np = 0, nd = 0;

    scanf("%d", &n);

    init();

    for (i = 0; i < n; i++) {
        scanf("%s%d", com, &key);

        if (com[0] == 'i') {
            insert(key);
            np++;
            size++;
        }

        else if (com[0] == 'd') {
            if (strlen(com) > 6) {
                if (com[6] == 'F')
                    deleteFirst();

                else if (com[6] == 'L')
                    deleteLast();
            }

            else
                delete (key);
            nd++;

            size--;
        }
    }

    printList();

    return 0;
}

NodePointer listSearch(int key) {
    NodePointer cur = nil->next;

    while (cur != nil && cur->key != key) cur = cur->next;

    return cur;
}

void init(void) {
    nil = (NodePointer)malloc(sizeof(struct node));
    nil->next = nil;
    nil->prev = nil;
}

void printList(void) {
    NodePointer cur = nil->next;
    int isf = 1;
    while (1) {
        if (cur == nil) break;
        if (isf == 0) printf(" ");
        printf("%d", cur->key);
        cur = cur->next;
        isf = 0;
    }
    printf("\n");
}

void deleteNode(NodePointer t) {
    t->prev->next = t->next;
    t->next->prev = t->prev;
    free(t);
}

void deleteFirst(void) {
    NodePointer t = nil->next;
    if (t == nil) return;

    deleteNode(t);
}

void deleteLast(void) {
    NodePointer t = nil->prev;
    if (t == nil) return;

    deleteNode(t);
}

void delete(int key) {
    NodePointer t = listSearch(key);

    if (t == nil) return;

    deleteNode(t);
}

void insert(int key) {
    NodePointer x;
    x = (NodePointer)malloc(sizeof(struct node));
    x->key = key;

    x->next = nil->next;
    nil->next->prev = x;
    nil->next = x;
    x->prev = nil;
}

Example test case(s):
input: 7
insert 5
insert 2
insert 3
insert 1
delete 3
insert 6
delete 5

output: 6 1 2
Language: C

#include <stdio.h>

int main() {
    int height, width, i;
    scanf("%d %d", &height, &width);
    char input_str[width + 1];
    for (i = 0; i < width + 2; i++) {
        printf("#");
    }
    printf("\n");
    for (i = 0; i < height; i++) {
        scanf("%s", input_str);
        printf("#%s#\n", input_str);
    }
    for (i = 0; i < width + 2; i++) {
        printf("#");
    }
    printf("\n");
    return 0;
}

Example test case(s):
input: 2 3
abc
arc

output: #####
#abc#
#arc#
#####
Language: C

#include <stdio.h>
#include <stdlib.h>
#define ll long long
#define rep(i, l, r) for (ll i = (l); i < (r); i++)
#define max(p, q) ((p) > (q) ? (p) : (q))

typedef struct edge {
    ll s, g, c;
} E;
typedef struct graph {
    int vcnt, ecnt;
    E e[200010];
    int id[100010];
} G;

int esort(const void* a, const void* b) {
    E *p = (E*)a, *q = (E*)b;
    if ((*p).s < (*q).s) return -1;
    if ((*p).s > (*q).s) return 1;
    if ((*p).g < (*q).g) return -1;
    return 1;
}

G g;
void readgraph() {
    ll n;
    scanf("%lld", &n);
    rep(i, 0, n - 1) {
        ll x, y, c;
        scanf("%lld%lld%lld", &x, &y, &c);
        g.e[2 * i].s = x;
        g.e[2 * i].g = y;
        g.e[2 * i].c = c;
        g.e[2 * i + 1].s = y;
        g.e[2 * i + 1].g = x;
        g.e[2 * i + 1].c = c;
    }
    g.vcnt = n;
    g.ecnt = 2 * n - 2;
    qsort(g.e, g.ecnt, sizeof(E), esort);

    int p = 0;
    rep(i, 0, g.vcnt) {
        while (p < g.ecnt && g.e[p].s < i) p++;
        g.id[i] = p;
    }
    g.id[g.vcnt] = g.ecnt;
}

int* tyokkeitemp;
void tyokkeidfs(ll s) {
    for (int i = g.id[s]; i < g.id[s + 1]; i++) {
        if (tyokkeitemp[g.e[i].g] == 0) {
            tyokkeitemp[g.e[i].g] = tyokkeitemp[s] + g.e[i].c;
            tyokkeidfs(g.e[i].g);
        }
    }
}
int tyokkei() {
    tyokkeitemp = (int*)calloc(g.vcnt + 10, sizeof(int));
    tyokkeitemp[0] = 1;
    tyokkeidfs(0);
    int M = 0, Mi;
    rep(i, 0, g.vcnt) {
        if (tyokkeitemp[i] > M) {
            M = tyokkeitemp[i];
            Mi = i;
        }
    }
    rep(i, 0, g.vcnt) tyokkeitemp[i] = 0;
    tyokkeitemp[Mi] = 1;
    tyokkeidfs(Mi);
    rep(i, 0, g.vcnt) M = max(M, tyokkeitemp[i]);
    free(tyokkeitemp);
    return M - 1;
}

int main() {
    readgraph();
    printf("%d\n", tyokkei());
}

Example test case(s):
input: 4
0 1 2
1 2 1
1 3 3

output: 5
Language: C

#include <stdio.h>
#include <string.h>
#define MAX 21

void init(int);
void move(int);

int n, x, y;
char fld[MAX][MAX];

int main(void) {
    int m;
    while (~scanf("%d", &n), n) {
        init(n);
        scanf("%d", &m);
        move(m);
        printf("%s\n", n ? "No" : "Yes");
    }
    return 0;
}

void init(int i) {
    int a, b;
    x = y = 10;
    memset(fld, 0, sizeof(fld));
    while (i--) {
        scanf("%d %d", &a, &b);
        fld[b][a] = 1;
    }
}

void move(int i) {
    int a, d;
    char buf[2];
    while (i--) {
        scanf("%1s %d", buf, &a);
        switch (buf[0]) {
            case 'N':
                d = 0;
                break;
            case 'E':
                d = 1;
                break;
            case 'S':
                d = 2;
                break;
            case 'W':
                d = 3;
                break;
        }
        while (a--) {
            d % 2 ? ~-d ? x-- : x++ : d ? y-- : y++;
            if (fld[y][x]) {
                fld[y][x] = 0;
                n--;
            }
        }
    }
}

Example test case(s):
input: 2
10 11
11 12
2
N 2
E 1
2
10 11
11 12
2
N 2
W 1
3
0 15
5 10
5 15
5
W 10
S 10
N 20
E 10
S 10
0

output: Yes
No
No
Language: C

#include <stdio.h>

int main() {
    int key, i, j, len, a[101];
    scanf("%d", &len);
    for (i = 0; i < len; i++) scanf("%d", a + i);

    for (j = 1; j < len; j++) {
        for (i = 0; i < len; i++) printf(i != 0 ? " %d" : "%d", a[i]);
        puts("");
        key = a[j];
        for (i = j - 1; i >= 0 && a[i] > key; i--) a[i + 1] = a[i];
        a[i + 1] = key;
    }

    for (i = 0; i < len; i++) printf(i != 0 ? " %d" : "%d", a[i]);
    puts("");
    return 0;
}

Example test case(s):
input: 6
5 2 4 6 1 3

output: 5 2 4 6 1 3
2 5 4 6 1 3
2 4 5 6 1 3
2 4 5 6 1 3
1 2 4 5 6 3
1 2 3 4 5 6
Language: C

#include <stdio.h>
int main(void) {
    int x;
    scanf("%d", &x);
    printf("%d\n", x * x * x);
    return 0;
}

Example test case(s):
input: 2

output: 8
Language: C

#include <stdio.h>

int main() {
    int n, i, j, q, x[10000], y[500], sum = 0;

    scanf("%d", &n);

    for (i = 0; i < n; i++) {
        scanf("%d", &x[i]);
    }

    scanf("%d", &q);

    for (i = 0; i < q; i++) {
        scanf("%d", &y[i]);
    }

    for (i = 0; i < q; i++) {
        for (j = 0; j < n; j++) {
            if (y[i] == x[j]) {
                sum = sum + 1;
                break;
            }
        }
    }

    printf("%d\n", sum);

    return 0;
}

Example test case(s):
input: 5
1 2 3 4 5
3
3 4 1

output: 3
Language: C

#include <stdio.h>
#include <string.h>

int main() {
    char A[20], B[20], C[20];

    scanf("%s %s %s", A, B, C);

    int la = strlen(A), lb = strlen(B);

    if (A[la - 1] == B[0] && B[lb - 1] == C[0]) {
        printf("YES\n");
    } else {
        printf("NO\n");
    }

    return 0;
}

Example test case(s):
input: rng gorilla apple

output: YES
Language: C

#include <stdio.h>
#include <stdlib.h>

struct node {
    struct node *right;
    struct node *left;
    struct node *parent;
    int key;
};
typedef struct node *Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x) {
    while (x->left != NIL) x = x->left;
    return x;
}

Node treeMaximum(Node x) {
    while (x->right != NIL) x = x->right;
    return x;
}

Node treeSearch(Node u, int k) {
    if (u == NIL || k == u->key) return u;

    if (k < u->key)
        return treeSearch(u->left, k);
    else
        return treeSearch(u->right, k);
}

Node treeSuccessor(Node x) {
    Node y;
    if (x->right != NIL) return treeMinimum(x->right);

    y = x->parent;
    while (y != NIL && x == y->right) {
        x = y;
        y = y->parent;
    }
    return y;
}

void treeDelete(Node z) {
    Node y;
    Node x;

    if (z->left == NIL || z->right == NIL)
        y = z;
    else
        y = treeSuccessor(z);

    if (y->left != NIL)
        x = y->left;
    else
        x = y->right;

    if (x != NIL) x->parent = y->parent;

    if (y->parent == NIL)
        root = x;
    else if (y == y->parent->left)
        y->parent->left = x;
    else
        y->parent->right = x;

    if (y != z) z->key = y->key;
}

void insert(int k) {
    Node y = NIL;
    Node x = root;
    Node z;

    z = malloc(sizeof(struct node));
    z->key = k;
    z->left = NIL;
    z->right = NIL;

    while (x != NIL) {
        y = x;
        if (z->key < x->key) {
            x = x->left;
        } else {
            x = x->right;
        }
    }
    z->parent = y;
    if (y == NIL)
        root = z;
    else if (z->key < y->key)
        y->left = z;
    else
        (y->right = z);
}

void inorder(Node u) {
    if (u == NIL) return;
    inorder(u->left);
    printf(" %d", u->key);
    inorder(u->right);
}
void preorder(Node u) {
    if (u == NIL) return;
    printf(" %d", u->key);
    preorder(u->left);
    preorder(u->right);
}

int main() {
    int n, i, x;
    char com[20];
    scanf("%d", &n);

    for (i = 0; i < n; i++) {
        scanf("%s", com);
        if (com[0] == 'f') {
            scanf("%d", &x);
            Node t = treeSearch(root, x);
            if (t != NIL)
                printf("yes\n");
            else
                printf("no\n");
        } else if (com[0] == 'i') {
            scanf("%d", &x);
            insert(x);
        } else if (com[0] == 'p') {
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        } else if (com[0] == 'd') {
            scanf("%d", &x);
            treeDelete(treeSearch(root, x));
        }
    }

    return 0;
}

Example test case(s):
input: 18
insert 8
insert 2
insert 3
insert 7
insert 22
insert 1
find 1
find 2
find 3
find 4
find 5
find 6
find 7
find 8
print
delete 3
delete 7
print

output: yes
yes
yes
no
no
no
yes
yes
 1 2 3 7 8 22
 8 2 1 3 7 22
 1 2 8 22
 8 2 1 22
Language: C

#include <stdio.h>
int main() {
    int a, b, c, d, i, j;

    scanf("%d %d %d %d", &a, &b, &c, &d);

    i = a * b;
    j = c * d;
    if (i > j) {
        printf("%d\n", i);
    } else {
        printf("%d\n", j);
    }

    return 0;
}

Example test case(s):
input: 3 5 2 7

output: 15
Language: C

#include <stdio.h>

int main(void) {
    int i, j, k, L, tmp, d, def, end, aj, max, min;

    for (;;) {
        int an[20], a1[6], a2[6];
        scanf("%d %d", &an[0], &L);
        if (!L) break;

        aj = an[0];
        end = 0;
        for (k = 1; k < 21; k++) {
            for (i = L - 1; i >= 0; i--, aj /= 10) {
                a1[i] = aj % 10;
                a2[i] = aj % 10;
            }
            for (i = 1; i < L; i++) {
                for (j = 1; j < L; j++) {
                    if (a1[j - 1] < a1[j]) {
                        tmp = a1[j - 1];
                        a1[j - 1] = a1[j];
                        a1[j] = tmp;
                    }
                    if (a2[j - 1] > a2[j]) {
                        tmp = a2[j - 1];
                        a2[j - 1] = a2[j];
                        a2[j] = tmp;
                    }
                }
            }
            d = 1;
            max = 0;
            min = 0;
            for (i = L - 1; i >= 0; i--, d *= 10) {
                max += (a1[i] % 10) * d;
                min += (a2[i] % 10) * d;
            }
            def = max - min;
            for (i = 0; i < k; i++) {
                if (def == an[i]) {
                    printf("%d %d %d\n", i, def, k - i);
                    end = 1;
                    break;
                }
            }
            if (end == 1) break;
            an[k] = def;
            aj = def;
        }
    }

    return 0;
}

Example test case(s):
input: 2012 4
83268 6
1112 4
0 1
99 2
0 0

output: 3 6174 1
1 862632 7
5 6174 1
0 0 1
1 0 1
Language: C

#include <stdbool.h>
#include <stdio.h>
#include <string.h>

int main() {
    int n, m;
    scanf("%d%d", &n, &m);
    bool r0[n];
    memset(r0, 0x00, n);
    int r1[n];
    int nr1 = 0;
    for (int i = 0; i < m; i++) {
        int a, b;
        scanf("%d%d", &a, &b);
        if (a > b) {
            int t = a;
            a = b;
            b = t;
        }
        if (a == 1) r0[b - 1] = true;
        if (b == n) r1[nr1++] = a - 1;
    }
    bool res = false;
    for (int i = 0; i < nr1; i++) {
        if (r0[r1[i]]) res = true;
    }
    puts(res ? "POSSIBLE" : "IMPOSSIBLE");
    return 0;
}

Example test case(s):
input: 3 2
1 2
2 3

output: POSSIBLE
Language: C

#include <stdio.h>

int linearsearch(int S[], int n, int key) {
    int i = 0;
    int count = 0;
    while (S[i] != key) {
        i++;
        if (i >= n) {
            count = 1;
            return count;
        }
    }
    return count;
}

int main() {
    int i, j, n, q, S[10000], T[10000];
    int count = 0, key;

    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d", &S[i]);
    }

    scanf("%d", &q);
    for (j = 0; j < q; j++) {
        scanf("%d", &T[j]);
    }

    for (j = 0; j < q; j++) {
        key = T[j];
        if (linearsearch(S, n, key) == 0) {
            count++;
        }
    }

    printf("%d\n", count);

    return 0;
}

Example test case(s):
input: 5
1 2 3 4 5
3
3 4 1

output: 3
Language: C

#include <stdio.h>
int main() {
    int a, b;
    scanf("%d %d", &a, &b);
    if (500 * a >= b)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;
}

Example test case(s):
input: 2 900

output: Yes
Language: C

#include <stdio.h>

#define gc() getchar_unlocked()

int in() {
    int n = 0, c = gc();
    do n = 10 * n + (c & 0xf);
    while ((c = gc()) >= '0');
    return n;
}

int f1[100], f2[100];

void calc(int n) {
    int k = n % 10;
    while (n >= 10) n /= 10;
    ++f1[10 * k + n], ++f2[n * 10 + k];
}

int main() {
    int i, N, ans;

    N = in();
    while (N) calc(N--);

    ans = 0;
    for (i = 0; i < 100; ++i) ans += f1[i] * f2[i];
    printf("%d\n", ans);
    return 0;
}

Example test case(s):
input: 25

output: 17
Language: C

#include <stdio.h>
int x, y;
int main() {
    scanf("%d %d", &x, &y);
    printf("%d %d\n", x * y, 2 * x + 2 * y);
    return 0;
}

Example test case(s):
input: 3 5

output: 15 16