<|start_filename|>out/aaa_10stringsarray.cpp<|end_filename|>
#include <iostream>
#include <vector>
struct toto {
    std::string s;
    int v;
};


std::string idstring(std::string s) {
    return s;
}


void printstring(std::string s) {
    std::cout << idstring(s) << "\n";
}


void print_toto(toto& t) {
    std::cout << t.s << " = " << t.v << "\n";
}

int main() {
    std::vector<std::string> tab( 2 );
    for (int i = 0; i < 2; i++)
        tab[i] = idstring("chaine de test");
    for (int j = 0; j < 2; j++)
        printstring(idstring(tab[j]));
    toto a;
        a.s = "one";
        a.v = 1;;
    print_toto(a);
}



<|start_filename|>out/euler33.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: pgcd recursive { a b }
  a b min { c }
  a b max { d }
  d c % { reste }
  reste 0 =
  IF
    c exit
  ELSE
    c reste pgcd exit
  THEN
;

: main
  1 { top }
  1 { bottom }
  9 1 BEGIN 2dup >= WHILE DUP { i }
    9 1 BEGIN 2dup >= WHILE DUP { j }
      9 1 BEGIN 2dup >= WHILE DUP { k }
        i j <> j k <> AND
        IF
          i 10 * j + { a }
          j 10 * k + { b }
          a k * i b * =
          IF
            a s>d 0 d.r
            S" /" TYPE
            b s>d 0 d.r
            S\" \n" TYPE
            top a * TO top
            bottom b * TO bottom
          THEN
        THEN
       1 + REPEAT 2DROP
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  top s>d 0 d.r
  S" /" TYPE
  bottom s>d 0 d.r
  S\" \n" TYPE
  top bottom pgcd { p }
  S" pgcd=" TYPE
  p s>d 0 d.r
  S\" \n" TYPE
  bottom p // s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/aaa_10stringsarray.fs<|end_filename|>
struct
  double% field ->s
  cell% field ->v
end-struct toto%


: idstring { D: s }
  s exit
;


: printstring { D: s }
  s idstring TYPE
  S\" \n" TYPE
;


: print_toto { t }
  t ->s 2@ TYPE
  S"  = " TYPE
  t ->v @ s>d 0 d.r
  S\" \n" TYPE
;

: main
  HERE 2 cells 2 * allot { tab }
  1 0 BEGIN 2dup >= WHILE DUP { i }
    S" chaine de test" idstring tab  i cells 2 * +  2!
   1 + REPEAT 2DROP
  1 0 BEGIN 2dup >= WHILE DUP { j }
    tab  j cells 2 * +  2@ idstring printstring
   1 + REPEAT 2DROP
  toto% %allot { a }
  S" one" a ->s 2!
  1 a ->v !
  a print_toto
  ;
main
BYE



<|start_filename|>out/aaa_missing.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

  int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

/*
  Ce test a été généré par Metalang.
*/
int result(int len, int[] tab)
{
  boolean[] tab2 = new boolean[len]
  for (int i = 0; i < len; i++)
      tab2[i] = false
  for (int i1 = 0; i1 < len; i1++)
  {
      System.out.printf("%d ", tab[i1])
      tab2[tab[i1]] = true
  }
  print("\n")
  for (int i2 = 0; i2 < len; i2++)
      if (!tab2[i2])
          return i2
  return -1
}
@Field Scanner scanner = new Scanner(System.in)
int len = Integer.parseInt(scanner.nextLine())
System.out.printf("%d\n", len)
int[] tab = read_int_line()
System.out.printf("%d\n", result(len, tab))



<|start_filename|>out/euler10.java<|end_filename|>
import java.util.*;

public class euler10
{
  
  static int eratostene(int[] t, int max0)
  {
    int sum = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            sum += i;
            if (max0 / i > i)
            {
                int j = i * i;
                while (j < max0 && j > 0)
                {
                    t[j] = 0;
                    j += i;
                }
            }
        }
    return sum;
  }
  public static void main(String args[])
  {
    int n = 100000;
    //  normalement on met 2000 000 mais là on se tape des int overflow dans plein de langages 
    int[] t = new int[n];
    for (int i = 0; i < n; i++)
        t[i] = i;
    t[1] = 0;
    System.out.printf("%d\n", eratostene(t, n));
  }
  
}



<|start_filename|>out/test_instant.go<|end_filename|>
package main
import "fmt"
func foo(a int, b int) int{
  return a + b
}
func main() {
  fmt.Printf("%d", 10)
}



<|start_filename|>out/euler07.cs<|end_filename|>
using System;

public class euler07
{
  static bool divisible(int n, int[] t, int size)
  {
    for (int i = 0; i < size; i++)
        if (n % t[i] == 0)
            return true;
    return false;
  }
  
  static int find(int n, int[] t, int used, int nth)
  {
    while (used != nth)
        if (divisible(n, t, used))
            n++;
        else
        {
            t[used] = n;
            n++;
            used++;
        }
    return t[used - 1];
  }
  
  public static void Main(String[] args)
  {
    int n = 10001;
    int[] t = new int[n];
    for (int i = 0; i < n; i++)
        t[i] = 2;
    Console.Write(find(3, t, 1, n) + "\n");
  }
  
}



<|start_filename|>out/tuple.cc<|end_filename|>
#include <iostream>
#include <vector>
struct tuple_int_int {
    int tuple_int_int_field_0;
    int tuple_int_int_field_1;
};


tuple_int_int * f(tuple_int_int * tuple0) {
    tuple_int_int * c = tuple0;
    int a = c->tuple_int_int_field_0;
    int b = c->tuple_int_int_field_1;
    tuple_int_int * d = new tuple_int_int();
        d->tuple_int_int_field_0 = a + 1;
        d->tuple_int_int_field_1 = b + 1;;
    return d;
}

int main() {
    tuple_int_int * e = new tuple_int_int();
        e->tuple_int_int_field_0 = 0;
        e->tuple_int_int_field_1 = 1;;
    tuple_int_int * t = f(e);
    tuple_int_int * g = t;
    int a = g->tuple_int_int_field_0;
    int b = g->tuple_int_int_field_1;
    std::cout << a << " -- " << b << "--\n";
}



<|start_filename|>out/abstest.java<|end_filename|>
import java.util.*;

public class abstest
{
  
  
  public static void main(String args[])
  {
    System.out.printf("%d%d", Math.abs(5 + 2) * 3, 3 * Math.abs(5 + 2));
  }
  
}



<|start_filename|>out/pathfindList.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func pathfind_aux(cache []int, tab []int, len int, pos int) int{
  if pos >= len - 1 {
      return 0
  } else if cache[pos] != -1 {
      return cache[pos]
  } else {
      cache[pos] = len * 2
      posval := pathfind_aux(cache, tab, len, tab[pos])
      oneval := pathfind_aux(cache, tab, len, pos + 1)
      out0 := 0
      if posval < oneval {
          out0 = 1 + posval
      } else {
          out0 = 1 + oneval
      }
      cache[pos] = out0
      return out0
  }
}
func pathfind(tab []int, len int) int{
  var cache []int = make([]int, len)
  for i := 0; i < len; i++ {
      cache[i] = -1
  }
  return pathfind_aux(cache, tab, len, 0)
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  len := 0
  fmt.Fscanf(reader, "%d", &len)
  skip()
  var tab []int = make([]int, len)
  for i := 0; i < len; i++ {
      tmp := 0
      fmt.Fscanf(reader, "%d", &tmp)
      skip()
      tab[i] = tmp
  }
  result := pathfind(tab, len)
  fmt.Printf("%d", result)
}



<|start_filename|>out/aaa_missing.cc<|end_filename|>
#include <iostream>
#include <vector>
/*
  Ce test a été généré par Metalang.
*/

int result(int len, std::vector<int> * tab) {
    std::vector<bool> *tab2 = new std::vector<bool>( len );
    std::fill(tab2->begin(), tab2->end(), false);
    for (int i1 = 0; i1 < len; i1++)
    {
        std::cout << tab->at(i1) << " ";
        tab2->at(tab->at(i1)) = true;
    }
    std::cout << "\n";
    for (int i2 = 0; i2 < len; i2++)
        if (!tab2->at(i2))
            return i2;
    return -1;
}

int main() {
    int len;
    std::cin >> len;
    std::cout << len << "\n";
    std::vector<int> *tab = new std::vector<int>( len );
    for (int a = 0; a < len; a++)
    {
        std::cin >> tab->at(a);
    }
    std::cout << result(len, tab) << "\n";
}



<|start_filename|>out/calc.go<|end_filename|>
package main
import "fmt"
/*
La suite de fibonaci
*/
func fibo(a int, b int, i int) int{
  out_ := 0
  a2 := a
  b2 := b
  for j := 0; j <= i + 1; j++ {
      fmt.Printf("%d", j)
      out_ += a2
      tmp := b2
      b2 += a2
      a2 = tmp
  }
  return out_
}
func main() {
  fmt.Printf("%d", fibo(1, 2, 4))
}



<|start_filename|>out/loop_unroll.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure loop_unroll is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
--
--Ce test permet de vérifier le comportement des macros
--Il effectue du loop unrolling
--


  j : Integer;
begin
  j := 0;
  j := 0;
  PInt(j);
  PString(new char_array'( To_C("" & Character'Val(10))));
  j := 1;
  PInt(j);
  PString(new char_array'( To_C("" & Character'Val(10))));
  j := 2;
  PInt(j);
  PString(new char_array'( To_C("" & Character'Val(10))));
  j := 3;
  PInt(j);
  PString(new char_array'( To_C("" & Character'Val(10))));
  j := 4;
  PInt(j);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler52.go<|end_filename|>
package main
import "fmt"
func chiffre_sort(a int) int{
  if a < 10 {
      return a
  } else {
      b := chiffre_sort(a / 10)
      c := a % 10
      d := b % 10
      e := b / 10
      if c < d {
          return c + b * 10
      } else {
          return d + chiffre_sort(c + e * 10) * 10
      }
  }
}
func same_numbers(a int, b int, c int, d int, e int, f int) bool{
  ca := chiffre_sort(a)
  return ca == chiffre_sort(b) && ca == chiffre_sort(c) && ca == chiffre_sort(d) && ca == chiffre_sort(e) && ca == chiffre_sort(f)
}
func main() {
  num := 142857
  if same_numbers(num, num * 2, num * 3, num * 4, num * 6, num * 5) {
      fmt.Printf("%d %d %d %d %d %d\n", num, num * 2, num * 3, num * 4, num * 5, num * 6)
  }
}



<|start_filename|>out/aaa_03binding.fs<|end_filename|>
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: g { i }
  i 4 * { j }
  j 2 % 1 =
  IF
    0 exit
  THEN
  j exit
;


: h { i }
  i s>d 0 d.r
  S\" \n" TYPE
;

: main
  14 h
  4 { a }
  5 { b }
  a b + s>d 0 d.r
  \  main 
  
  15 h
  2 TO a
  1 TO b
  a b + s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/sqrttest.lua<|end_filename|>

io.write(string.format("%d %d %d %d %d %d ", math.floor(math.sqrt(4)), math.floor(math.sqrt(16)), math.floor(math.sqrt(20)), math.floor(math.sqrt(1000)), math.floor(math.sqrt(500)), math.floor(math.sqrt(10))))


<|start_filename|>out/euler05.go<|end_filename|>
package main
import "fmt"
func max2_(a int, b int) int{
  if a > b {
      return a
  } else {
      return b
  }
}
func primesfactors(n int) []int{
  var tab []int = make([]int, n + 1)
  for i := 0; i <= n; i++ {
      tab[i] = 0
  }
  d := 2
  for n != 1 && d * d <= n {
      if n % d == 0 {
          tab[d]++
          n /= d
      } else {
          d++
      }
  }
  tab[n]++
  return tab
}
func main() {
  lim := 20
  var o []int = make([]int, lim + 1)
  for m := 0; m <= lim; m++ {
      o[m] = 0
  }
  for i := 1; i <= lim; i++ {
      var t []int = primesfactors(i)
      for j := 1; j <= i; j++ {
          o[j] = max2_(o[j], t[j])
      }
  }
  product := 1
  for k := 1; k <= lim; k++ {
      for l := 1; l <= o[k]; l++ {
          product *= k
      }
  }
  fmt.Printf("%d\n", product)
}



<|start_filename|>out/euler21.cc<|end_filename|>
#include <iostream>
#include <vector>

int eratostene(std::vector<int> * t, int max0) {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t->at(i) == i)
        {
            n++;
            int j = i * i;
            while (j < max0 && j > 0)
            {
                t->at(j) = 0;
                j += i;
            }
        }
    return n;
}


int fillPrimesFactors(std::vector<int> * t, int n, std::vector<int> * primes, int nprimes) {
    for (int i = 0; i < nprimes; i++)
    {
        int d = primes->at(i);
        while (n % d == 0)
        {
            t->at(d)++;
            n /= d;
        }
        if (n == 1)
            return primes->at(i);
    }
    return n;
}


int sumdivaux2(std::vector<int> * t, int n, int i) {
    while (i < n && t->at(i) == 0)
        i++;
    return i;
}


int sumdivaux(std::vector<int> * t, int n, int i) {
    if (i > n)
        return 1;
    else if (t->at(i) == 0)
        return sumdivaux(t, n, sumdivaux2(t, n, i + 1));
    else
    {
        int o = sumdivaux(t, n, sumdivaux2(t, n, i + 1));
        int out0 = 0;
        int p = i;
        for (int j = 1; j <= t->at(i); j++)
        {
            out0 += p;
            p *= i;
        }
        return (out0 + 1) * o;
    }
}


int sumdiv(int nprimes, std::vector<int> * primes, int n) {
    std::vector<int> *t = new std::vector<int>( n + 1 );
    std::fill(t->begin(), t->end(), 0);
    int max0 = fillPrimesFactors(t, n, primes, nprimes);
    return sumdivaux(t, max0, 0);
}

int main() {
    int maximumprimes = 1001;
    std::vector<int> *era = new std::vector<int>( maximumprimes );
    for (int j = 0; j < maximumprimes; j++)
        era->at(j) = j;
    int nprimes = eratostene(era, maximumprimes);
    std::vector<int> *primes = new std::vector<int>( nprimes );
    std::fill(primes->begin(), primes->end(), 0);
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era->at(k) == k)
        {
            primes->at(l) = k;
            l++;
        }
    std::cout << l << " == " << nprimes << "\n";
    int sum = 0;
    for (int n = 2; n < 1001; n++)
    {
        int other = sumdiv(nprimes, primes, n) - n;
        if (other > n)
        {
            int othersum = sumdiv(nprimes, primes, other) - other;
            if (othersum == n)
            {
                std::cout << other << " & " << n << "\n";
                sum += other + n;
            }
        }
    }
    std::cout << "\n" << sum << "\n";
}



<|start_filename|>out/aaa_04loop.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
h i =
  {-  for j = i - 2 to i + 2 do
    if i % j == 5 then return true end
  end -}
  do let j = i - 2
     let a b =
           if b <= i + 2
           then if (i `rem` b) == 5
                then return True
                else do let c = b + 1
                        a c
           else return False in
           a j

main =
  let d k e =
        if k <= 10
        then do let o = e + k
                printf "%d\n" (o::Int) :: IO()
                d (k + 1) o
        else let f g l =
                   if g < 10
                   then do printf "%d" (g :: Int) :: IO ()
                           let m = g + 1
                           let n = l + m
                           f m n
                   else printf "%d%dFIN TEST\n" (l::Int) (g::Int) :: IO() in
                   f 4 e in
        d 0 0




<|start_filename|>out/aaa_021if.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


void testA(int a, int b) {
    if (a)
        if (b)
            printf("A");
        else
            printf("B");
    else if (b)
        printf("C");
    else
        printf("D");
}

void testB(int a, int b) {
    if (a)
        printf("A");
    else if (b)
        printf("B");
    else
        printf("C");
}

void testC(int a, int b) {
    if (a)
        if (b)
            printf("A");
        else
            printf("B");
    else
        printf("C");
}

void testD(int a, int b) {
    if (a)
    {
        if (b)
            printf("A");
        else
            printf("B");
        printf("C");
    }
    else
        printf("D");
}

void testE(int a, int b) {
    if (a)
    {
        if (b)
            printf("A");
    }
    else
    {
        if (b)
            printf("C");
        else
            printf("D");
        printf("E");
    }
}

void test(int a, int b) {
    testD(a, b);
    testE(a, b);
    printf("\n");
}
int main(void) {
    test(1, 1);
    test(1, 0);
    test(0, 1);
    test(0, 0);
    return 0;
}




<|start_filename|>out/euler11.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int max2_(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}

int find(int n, int** m, int x, int y, int dx, int dy) {
    if (x < 0 || x == 20 || y < 0 || y == 20)
        return -1;
    else if (n == 0)
        return 1;
    else
        return m[y][x] * find(n - 1, m, x + dx, y + dy, dx, dy);
}
typedef struct tuple_int_int {
  int tuple_int_int_field_0;
    int tuple_int_int_field_1;
} tuple_int_int;
int main(void) {
    int j, x, y, o, q, i;
    struct tuple_int_int * *directions = calloc(8, sizeof(struct tuple_int_int *));
    for (i = 0; i < 8; i++)
        if (i == 0)
        {
            struct tuple_int_int * c = malloc(sizeof(tuple_int_int));
            c->tuple_int_int_field_0 = 0;
            c->tuple_int_int_field_1 = 1;
            directions[i] = c;
        }
        else if (i == 1)
        {
            struct tuple_int_int * d = malloc(sizeof(tuple_int_int));
            d->tuple_int_int_field_0 = 1;
            d->tuple_int_int_field_1 = 0;
            directions[i] = d;
        }
        else if (i == 2)
        {
            struct tuple_int_int * e = malloc(sizeof(tuple_int_int));
            e->tuple_int_int_field_0 = 0;
            e->tuple_int_int_field_1 = -1;
            directions[i] = e;
        }
        else if (i == 3)
        {
            struct tuple_int_int * f = malloc(sizeof(tuple_int_int));
            f->tuple_int_int_field_0 = -1;
            f->tuple_int_int_field_1 = 0;
            directions[i] = f;
        }
        else if (i == 4)
        {
            struct tuple_int_int * g = malloc(sizeof(tuple_int_int));
            g->tuple_int_int_field_0 = 1;
            g->tuple_int_int_field_1 = 1;
            directions[i] = g;
        }
        else if (i == 5)
        {
            struct tuple_int_int * h = malloc(sizeof(tuple_int_int));
            h->tuple_int_int_field_0 = 1;
            h->tuple_int_int_field_1 = -1;
            directions[i] = h;
        }
        else if (i == 6)
        {
            struct tuple_int_int * k = malloc(sizeof(tuple_int_int));
            k->tuple_int_int_field_0 = -1;
            k->tuple_int_int_field_1 = 1;
            directions[i] = k;
        }
        else
        {
            struct tuple_int_int * l = malloc(sizeof(tuple_int_int));
            l->tuple_int_int_field_0 = -1;
            l->tuple_int_int_field_1 = -1;
            directions[i] = l;
        }
    int max0 = 0;
    int* *m = calloc(20, sizeof(int*));
    for (o = 0; o < 20; o++)
    {
        int *p = calloc(20, sizeof(int));
        for (q = 0; q < 20; q++)
            scanf("%d ", &p[q]);
        m[o] = p;
    }
    for (j = 0; j < 8; j++)
    {
        struct tuple_int_int * r = directions[j];
        int dx = r->tuple_int_int_field_0;
        int dy = r->tuple_int_int_field_1;
        for (x = 0; x < 20; x++)
            for (y = 0; y < 20; y++)
                max0 = max2_(max0, find(4, m, x, y, dx, dy));
    }
    printf("%d\n", max0);
    return 0;
}




<|start_filename|>out/npi.cc<|end_filename|>
#include <iostream>
#include <vector>

bool is_number(char c) {
    return (int)(c) <= (int)('9') && (int)(c) >= (int)('0');
}

/*
Notation polonaise inversée, ce test permet d'évaluer une expression écrite en NPI
*/

int npi0(std::vector<char> * str, int len) {
    std::vector<int> *stack = new std::vector<int>( len );
    std::fill(stack->begin(), stack->end(), 0);
    int ptrStack = 0;
    int ptrStr = 0;
    while (ptrStr < len)
        if (str->at(ptrStr) == ' ')
            ptrStr++;
        else if (is_number(str->at(ptrStr)))
        {
            int num = 0;
            while (str->at(ptrStr) != ' ')
            {
                num = num * 10 + (int)(str->at(ptrStr)) - (int)('0');
                ptrStr++;
            }
            stack->at(ptrStack) = num;
            ptrStack++;
        }
        else if (str->at(ptrStr) == '+')
        {
            stack->at(ptrStack - 2) += stack->at(ptrStack - 1);
            ptrStack--;
            ptrStr++;
        }
    return stack->at(0);
}

int main() {
    int len = 0;
    std::cin >> len;
    std::vector<char> *tab = new std::vector<char>( len );
    for (int i = 0; i < len; i++)
    {
        char tmp = '\u0000';
        std::cin >> tmp >> std::noskipws;
        tab->at(i) = tmp;
    }
    int result = npi0(tab, len);
    std::cout << result;
}



<|start_filename|>out/euler03.java<|end_filename|>
import java.util.*;

public class euler03
{
  
  
  public static void main(String args[])
  {
    int maximum = 1;
    int b0 = 2;
    int a = 408464633;
    int sqrtia = (int)Math.sqrt(a);
    while (a != 1)
    {
        int b = b0;
        boolean found = false;
        while (b <= sqrtia)
        {
            if (a % b == 0)
            {
                a /= b;
                b0 = b;
                b = a;
                sqrtia = (int)Math.sqrt(a);
                found = true;
            }
            b++;
        }
        if (!found)
        {
            System.out.printf("%d\n", a);
            a = 1;
        }
    }
  }
  
}



<|start_filename|>out/euler09.cs<|end_filename|>
using System;

public class euler09
{
  
  public static void Main(String[] args)
  {
    /*
	a + b + c = 1000 && a * a + b * b = c * c
	*/
    for (int a = 1; a < 1001; a++)
        for (int b = a + 1; b < 1001; b++)
        {
            int c = 1000 - a - b;
            int a2b2 = a * a + b * b;
            int cc = c * c;
            if (cc == a2b2 && c > a)
                Console.Write(a + "\n" + b + "\n" + c + "\n" + (a * b * c) + "\n");
        }
  }
  
}



<|start_filename|>out/euler10.go<|end_filename|>
package main
import "fmt"
func eratostene(t []int, max0 int) int{
  sum := 0
  for i := 2; i < max0; i++ {
      if t[i] == i {
          sum += i
          if max0 / i > i {
              j := i * i
              for j < max0 && j > 0 {
                  t[j] = 0
                  j += i
              }
          }
      }
  }
  return sum
}
func main() {
  n := 100000
  /* normalement on met 2000 000 mais là on se tape des int overflow dans plein de langages */
  var t []int = make([]int, n)
  for i := 0; i < n; i++ {
      t[i] = i
  }
  t[1] = 0
  fmt.Printf("%d\n", eratostene(t, n))
}



<|start_filename|>out/loop_unroll.fs<|end_filename|>
\ 
\ Ce test permet de vérifier le comportement des macros
\ Il effectue du loop unrolling
\ 
: main
  0 { j }
  0 TO j
  j s>d 0 d.r
  S\" \n" TYPE
  1 TO j
  j s>d 0 d.r
  S\" \n" TYPE
  2 TO j
  j s>d 0 d.r
  S\" \n" TYPE
  3 TO j
  j s>d 0 d.r
  S\" \n" TYPE
  4 TO j
  j s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/bigints.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_char_(){
    if (current_char == null) current_char = read_char0();
    var out = current_char;
    current_char = read_char0();
    return out;
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_bigint(len){
    var chiffres = new Array(len);
    for (var j = 0; j < len; j++)
    {
        var c = read_char_();
        chiffres[j] = c.charCodeAt(0);
    }
    for (var i = 0; i <= ~~((len - 1) / 2); i++)
    {
        var tmp = chiffres[i];
        chiffres[i] = chiffres[len - 1 - i];
        chiffres[len - 1 - i] = tmp;
    }
    var e = {
        "bigint_sign":true,
        "bigint_len":len,
        "bigint_chiffres":chiffres};
    return e;
}
function print_bigint(a){
    if (!a["bigint_sign"])
        util.print('-');
    for (var i = 0; i < a["bigint_len"]; i++)
        util.print(a["bigint_chiffres"][a["bigint_len"] - 1 - i]);
}
function bigint_eq(a, b){
    //  Renvoie vrai si a = b 
    if (a["bigint_sign"] != b["bigint_sign"])
        return false;
    else if (a["bigint_len"] != b["bigint_len"])
        return false;
    else
    {
        for (var i = 0; i < a["bigint_len"]; i++)
            if (a["bigint_chiffres"][i] != b["bigint_chiffres"][i])
                return false;
        return true;
    }
}
function bigint_gt(a, b){
    //  Renvoie vrai si a > b 
    if (a["bigint_sign"] && !b["bigint_sign"])
        return true;
    else if (!a["bigint_sign"] && b["bigint_sign"])
        return false;
    else
    {
        if (a["bigint_len"] > b["bigint_len"])
            return a["bigint_sign"];
        else if (a["bigint_len"] < b["bigint_len"])
            return !a["bigint_sign"];
        else
            for (var i = 0; i < a["bigint_len"]; i++)
            {
                var j = a["bigint_len"] - 1 - i;
                if (a["bigint_chiffres"][j] > b["bigint_chiffres"][j])
                    return a["bigint_sign"];
                else if (a["bigint_chiffres"][j] < b["bigint_chiffres"][j])
                    return !a["bigint_sign"];
            }
        return true;
    }
}
function bigint_lt(a, b){
    return !bigint_gt(a, b);
}
function add_bigint_positif(a, b){
    //  Une addition ou on en a rien a faire des signes 
    var len = Math.max(a["bigint_len"], b["bigint_len"]) + 1;
    var retenue = 0;
    var chiffres = new Array(len);
    for (var i = 0; i < len; i++)
    {
        var tmp = retenue;
        if (i < a["bigint_len"])
            tmp += a["bigint_chiffres"][i];
        if (i < b["bigint_len"])
            tmp += b["bigint_chiffres"][i];
        retenue = ~~(tmp / 10);
        chiffres[i] = ~~(tmp % 10);
    }
    while (len > 0 && chiffres[len - 1] == 0)
        len--;
    var f = {
        "bigint_sign":true,
        "bigint_len":len,
        "bigint_chiffres":chiffres};
    return f;
}
function sub_bigint_positif(a, b){
    /* Une soustraction ou on en a rien a faire des signes
Pré-requis : a > b
*/
    var len = a["bigint_len"];
    var retenue = 0;
    var chiffres = new Array(len);
    for (var i = 0; i < len; i++)
    {
        var tmp = retenue + a["bigint_chiffres"][i];
        if (i < b["bigint_len"])
            tmp -= b["bigint_chiffres"][i];
        if (tmp < 0)
        {
            tmp += 10;
            retenue = -1;
        }
        else
            retenue = 0;
        chiffres[i] = tmp;
    }
    while (len > 0 && chiffres[len - 1] == 0)
        len--;
    var g = {
        "bigint_sign":true,
        "bigint_len":len,
        "bigint_chiffres":chiffres};
    return g;
}
function neg_bigint(a){
    var h = {
        "bigint_sign":!a["bigint_sign"],
        "bigint_len":a["bigint_len"],
        "bigint_chiffres":a["bigint_chiffres"]};
    return h;
}
function add_bigint(a, b){
    if (a["bigint_sign"] == b["bigint_sign"])
        if (a["bigint_sign"])
            return add_bigint_positif(a, b);
        else
            return neg_bigint(add_bigint_positif(a, b));
    else if (a["bigint_sign"])
    {
        //  a positif, b negatif 
        if (bigint_gt(a, neg_bigint(b)))
            return sub_bigint_positif(a, b);
        else
            return neg_bigint(sub_bigint_positif(b, a));
    }
    else
        //  a negatif, b positif 
        if (bigint_gt(neg_bigint(a), b))
            return neg_bigint(sub_bigint_positif(a, b));
        else
            return sub_bigint_positif(b, a);
}
function sub_bigint(a, b){
    return add_bigint(a, neg_bigint(b));
}
function mul_bigint_cp(a, b){
    /* Cet algorithm est quadratique.
C'est le même que celui qu'on enseigne aux enfants en CP.
D'ou le nom de la fonction. */
    var len = a["bigint_len"] + b["bigint_len"] + 1;
    var chiffres = new Array(len);
    for (var k = 0; k < len; k++)
        chiffres[k] = 0;
    for (var i = 0; i < a["bigint_len"]; i++)
    {
        var retenue = 0;
        for (var j = 0; j < b["bigint_len"]; j++)
        {
            chiffres[i + j] += retenue + b["bigint_chiffres"][j] * a["bigint_chiffres"][i];
            retenue = ~~(chiffres[i + j] / 10);
            chiffres[i + j] = ~~(chiffres[i + j] % 10);
        }
        chiffres[i + b["bigint_len"]] += retenue;
    }
    chiffres[a["bigint_len"] + b["bigint_len"]] = ~~(chiffres[a["bigint_len"] + b["bigint_len"] - 1] / 10);
    chiffres[a["bigint_len"] + b["bigint_len"] - 1] = ~~(chiffres[a["bigint_len"] + b["bigint_len"] - 1] % 10);
    for (var l = 0; l < 3; l++)
        if (len != 0 && chiffres[len - 1] == 0)
            len--;
    var m = {
        "bigint_sign":a["bigint_sign"] == b["bigint_sign"],
        "bigint_len":len,
        "bigint_chiffres":chiffres};
    return m;
}
function bigint_premiers_chiffres(a, i){
    var len = Math.min(i, a["bigint_len"]);
    while (len != 0 && a["bigint_chiffres"][len - 1] == 0)
        len--;
    var o = {
        "bigint_sign":a["bigint_sign"],
        "bigint_len":len,
        "bigint_chiffres":a["bigint_chiffres"]};
    return o;
}
function bigint_shift(a, i){
    var chiffres = new Array(a["bigint_len"] + i);
    for (var k = 0; k < a["bigint_len"] + i; k++)
        if (k >= i)
            chiffres[k] = a["bigint_chiffres"][k - i];
        else
            chiffres[k] = 0;
    var p = {
        "bigint_sign":a["bigint_sign"],
        "bigint_len":a["bigint_len"] + i,
        "bigint_chiffres":chiffres};
    return p;
}
function mul_bigint(aa, bb){
    if (aa["bigint_len"] == 0)
        return aa;
    else if (bb["bigint_len"] == 0)
        return bb;
    else if (aa["bigint_len"] < 3 || bb["bigint_len"] < 3)
        return mul_bigint_cp(aa, bb);
    //  Algorithme de Karatsuba 
    var split = ~~(Math.min(aa["bigint_len"], bb["bigint_len"]) / 2);
    var a = bigint_shift(aa, -split);
    var b = bigint_premiers_chiffres(aa, split);
    var c = bigint_shift(bb, -split);
    var d = bigint_premiers_chiffres(bb, split);
    var amoinsb = sub_bigint(a, b);
    var cmoinsd = sub_bigint(c, d);
    var ac = mul_bigint(a, c);
    var bd = mul_bigint(b, d);
    var amoinsbcmoinsd = mul_bigint(amoinsb, cmoinsd);
    var acdec = bigint_shift(ac, 2 * split);
    return add_bigint(add_bigint(acdec, bd), bigint_shift(sub_bigint(add_bigint(ac, bd), amoinsbcmoinsd), split));
    //  ac × 102k + (ac + bd – (a – b)(c – d)) × 10k + bd 
}
/*
Division,
Modulo
*/
function log10(a){
    var out0 = 1;
    while (a >= 10)
    {
        a = ~~(a / 10);
        out0++;
    }
    return out0;
}
function bigint_of_int(i){
    var size = log10(i);
    if (i == 0)
        size = 0;
    var t = new Array(size);
    for (var j = 0; j < size; j++)
        t[j] = 0;
    for (var k = 0; k < size; k++)
    {
        t[k] = ~~(i % 10);
        i = ~~(i / 10);
    }
    var q = {
        "bigint_sign":true,
        "bigint_len":size,
        "bigint_chiffres":t};
    return q;
}
function fact_bigint(a){
    var one = bigint_of_int(1);
    var out0 = one;
    while (!bigint_eq(a, one))
    {
        out0 = mul_bigint(a, out0);
        a = sub_bigint(a, one);
    }
    return out0;
}
function sum_chiffres_bigint(a){
    var out0 = 0;
    for (var i = 0; i < a["bigint_len"]; i++)
        out0 += a["bigint_chiffres"][i];
    return out0;
}
//  http://projecteuler.net/problem=20 
function euler20(){
    var a = bigint_of_int(15);
    //  normalement c'est 100 
    a = fact_bigint(a);
    return sum_chiffres_bigint(a);
}
function bigint_exp(a, b){
    if (b == 1)
        return a;
    else if (~~(b % 2) == 0)
        return bigint_exp(mul_bigint(a, a), ~~(b / 2));
    else
        return mul_bigint(a, bigint_exp(a, b - 1));
}
function bigint_exp_10chiffres(a, b){
    a = bigint_premiers_chiffres(a, 10);
    if (b == 1)
        return a;
    else if (~~(b % 2) == 0)
        return bigint_exp_10chiffres(mul_bigint(a, a), ~~(b / 2));
    else
        return mul_bigint(a, bigint_exp_10chiffres(a, b - 1));
}
function euler48(){
    var sum = bigint_of_int(0);
    for (var i = 1; i < 101; i++)
    {
        //  1000 normalement 
        var ib = bigint_of_int(i);
        var ibeib = bigint_exp_10chiffres(ib, i);
        sum = add_bigint(sum, ibeib);
        sum = bigint_premiers_chiffres(sum, 10);
    }
    util.print("euler 48 = ");
    print_bigint(sum);
    util.print("\n");
}
function euler16(){
    var a = bigint_of_int(2);
    a = bigint_exp(a, 100);
    //  1000 normalement 
    return sum_chiffres_bigint(a);
}
function euler25(){
    var i = 2;
    var a = bigint_of_int(1);
    var b = bigint_of_int(1);
    while (b["bigint_len"] < 100)
    {
        //  1000 normalement 
        var c = add_bigint(a, b);
        a = b;
        b = c;
        i++;
    }
    return i;
}
function euler29(){
    var maxA = 5;
    var maxB = 5;
    var a_bigint = new Array(maxA + 1);
    for (var j = 0; j <= maxA; j++)
        a_bigint[j] = bigint_of_int(j * j);
    var a0_bigint = new Array(maxA + 1);
    for (var j2 = 0; j2 <= maxA; j2++)
        a0_bigint[j2] = bigint_of_int(j2);
    var b = new Array(maxA + 1);
    for (var k = 0; k <= maxA; k++)
        b[k] = 2;
    var n = 0;
    var found = true;
    while (found)
    {
        var min0 = a0_bigint[0];
        found = false;
        for (var i = 2; i <= maxA; i++)
            if (b[i] <= maxB)
                if (found)
                {
                    if (bigint_lt(a_bigint[i], min0))
                        min0 = a_bigint[i];
                }
                else
                {
                    min0 = a_bigint[i];
                    found = true;
                }
        if (found)
        {
            n++;
            for (var l = 2; l <= maxA; l++)
                if (bigint_eq(a_bigint[l], min0) && b[l] <= maxB)
                {
                    b[l]++;
                    a_bigint[l] = mul_bigint(a_bigint[l], a0_bigint[l]);
                }
        }
    }
    return n;
}
util.print(euler29(), "\n");
var sum = read_bigint(50);
for (var i = 2; i < 101; i++)
{
    stdinsep();
    var tmp = read_bigint(50);
    sum = add_bigint(sum, tmp);
}
util.print("euler13 = ");
print_bigint(sum);
util.print("\neuler25 = ", euler25(), "\neuler16 = ", euler16(), "\n");
euler48();
util.print("euler20 = ", euler20(), "\n");
var a = bigint_of_int(999999);
var b = bigint_of_int(9951263);
print_bigint(a);
util.print(">>1=");
print_bigint(bigint_shift(a, -1));
util.print("\n");
print_bigint(a);
util.print("*");
print_bigint(b);
util.print("=");
print_bigint(mul_bigint(a, b));
util.print("\n");
print_bigint(a);
util.print("*");
print_bigint(b);
util.print("=");
print_bigint(mul_bigint_cp(a, b));
util.print("\n");
print_bigint(a);
util.print("+");
print_bigint(b);
util.print("=");
print_bigint(add_bigint(a, b));
util.print("\n");
print_bigint(b);
util.print("-");
print_bigint(a);
util.print("=");
print_bigint(sub_bigint(b, a));
util.print("\n");
print_bigint(a);
util.print("-");
print_bigint(b);
util.print("=");
print_bigint(sub_bigint(a, b));
util.print("\n");
print_bigint(a);
util.print(">");
print_bigint(b);
util.print("=");
if (bigint_gt(a, b))
    util.print("True");
else
    util.print("False");
util.print("\n");



<|start_filename|>out/aaa_read.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

/* 
Ce test permet de vérifier si les différents backends pour les langages implémentent bien
read int, read char et skip
 */

int main(void) {
    int j, toto, strlen, i_, tmpi2, i, tmpi1, len;
    char tmpc;
    scanf("%d ", &len);
    printf("%d=len\n", len);
    len *= 2;
    printf("len*2=%d\n", len);
    len /= 2;
    int *tab = calloc(len, sizeof(int));
    for (i = 0; i < len; i++)
    {
        scanf("%d ", &tmpi1);
        printf("%d=>%d ", i, tmpi1);
        tab[i] = tmpi1;
    }
    printf("\n");
    int *tab2 = calloc(len, sizeof(int));
    for (i_ = 0; i_ < len; i_++)
    {
        scanf("%d ", &tmpi2);
        printf("%d==>%d ", i_, tmpi2);
        tab2[i_] = tmpi2;
    }
    scanf("%d ", &strlen);
    printf("%d=strlen\n", strlen);
    char *tab4 = calloc(strlen, sizeof(char));
    for (toto = 0; toto < strlen; toto++)
    {
        scanf("%c", &tmpc);
        int c = (int)(tmpc);
        printf("%c:%d ", tmpc, c);
        if (tmpc != ' ')
            c = (c - (int)('a') + 13) % 26 + (int)('a');
        tab4[toto] = (char)(c);
    }
    for (j = 0; j < strlen; j++)
        printf("%c", tab4[j]);
    return 0;
}




<|start_filename|>out/carre.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
: main
  read-int { x }
  skipspaces
  read-int { y }
  skipspaces
  HERE y cells allot { tab }
  y 1 - 0 BEGIN 2dup >= WHILE DUP { d }
    HERE x cells allot { e }
    x 1 - 0 BEGIN 2dup >= WHILE DUP { f }
      read-int e  f cells +  !
      skipspaces
     1 + REPEAT 2DROP
    e tab  d cells +  !
   1 + REPEAT 2DROP
  x 1 - 1 BEGIN 2dup >= WHILE DUP { ix }
    y 1 - 1 BEGIN 2dup >= WHILE DUP { iy }
      tab  iy cells +  @  ix cells +  @ 1 =
      IF
        tab  iy cells +  @  ix 1 - cells +  @ tab  iy 1 - cells +  @  ix cells +  @ min tab  iy 1 - cells +  @  ix 1 - cells +  @ min 1 + tab  iy cells +  @  ix cells +  !
      THEN
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  y 1 - 0 BEGIN 2dup >= WHILE DUP { jy }
    x 1 - 0 BEGIN 2dup >= WHILE DUP { jx }
      tab  jy cells +  @  jx cells +  @ s>d 0 d.r
      S"  " TYPE
     1 + REPEAT 2DROP
    S\" \n" TYPE
   1 + REPEAT 2DROP
  ;
main
BYE



<|start_filename|>out/vigenere.cc<|end_filename|>
#include <iostream>
#include <vector>

int position_alphabet(char c) {
    int i = (int)(c);
    if (i <= (int)('Z') && i >= (int)('A'))
        return i - (int)('A');
    else if (i <= (int)('z') && i >= (int)('a'))
        return i - (int)('a');
    else
        return -1;
}


char of_position_alphabet(int c) {
    return (char)(c + (int)('a'));
}


void crypte(int taille_cle, std::vector<char> * cle, int taille, std::vector<char> * message) {
    for (int i = 0; i < taille; i++)
    {
        int lettre = position_alphabet(message->at(i));
        if (lettre != -1)
        {
            int addon = position_alphabet(cle->at(i % taille_cle));
            int new0 = (addon + lettre) % 26;
            message->at(i) = of_position_alphabet(new0);
        }
    }
}

int main() {
    int taille, taille_cle;
    char out2, out0;
    std::cin >> taille_cle;
    std::vector<char> *cle = new std::vector<char>( taille_cle );
    for (int index = 0; index < taille_cle; index++)
    {
        std::cin >> out0 >> std::noskipws;
        cle->at(index) = out0;
    }
    std::cin >> std::skipws >> taille;
    std::vector<char> *message = new std::vector<char>( taille );
    for (int index2 = 0; index2 < taille; index2++)
    {
        std::cin >> out2 >> std::noskipws;
        message->at(index2) = out2;
    }
    crypte(taille_cle, cle, taille, message);
    for (int i = 0; i < taille; i++)
        std::cout << message->at(i);
    std::cout << "\n";
}



<|start_filename|>out/aaa_021if.java<|end_filename|>
import java.util.*;

public class aaa_021if
{
  
  static void testA(boolean a, boolean b)
  {
    if (a)
        if (b)
            System.out.print("A");
        else
            System.out.print("B");
    else if (b)
        System.out.print("C");
    else
        System.out.print("D");
  }
  static void testB(boolean a, boolean b)
  {
    if (a)
        System.out.print("A");
    else if (b)
        System.out.print("B");
    else
        System.out.print("C");
  }
  static void testC(boolean a, boolean b)
  {
    if (a)
        if (b)
            System.out.print("A");
        else
            System.out.print("B");
    else
        System.out.print("C");
  }
  static void testD(boolean a, boolean b)
  {
    if (a)
    {
        if (b)
            System.out.print("A");
        else
            System.out.print("B");
        System.out.print("C");
    }
    else
        System.out.print("D");
  }
  static void testE(boolean a, boolean b)
  {
    if (a)
    {
        if (b)
            System.out.print("A");
    }
    else
    {
        if (b)
            System.out.print("C");
        else
            System.out.print("D");
        System.out.print("E");
    }
  }
  static void test(boolean a, boolean b)
  {
    testD(a, b);
    testE(a, b);
    System.out.print("\n");
  }
  public static void main(String args[])
  {
    test(true, true);
    test(true, false);
    test(false, true);
    test(false, false);
  }
  
}



<|start_filename|>out/euler11.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func max2_(a int, b int) int{
  if a > b {
      return a
  } else {
      return b
  }
}
func find(n int, m [][]int, x int, y int, dx int, dy int) int{
  if x < 0 || x == 20 || y < 0 || y == 20 {
      return -1
  } else if n == 0 {
      return 1
  } else {
      return m[y][x] * find(n - 1, m, x + dx, y + dy, dx, dy)
  }
}

type tuple_int_int struct {
  tuple_int_int_field_0 int;
  tuple_int_int_field_1 int;
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var directions []* tuple_int_int = make([]* tuple_int_int, 8)
  for i := 0; i < 8; i++ {
      if i == 0 {
          var c * tuple_int_int = new (tuple_int_int)
              (*c).tuple_int_int_field_0=0
              (*c).tuple_int_int_field_1=1
          directions[i] = c
      } else if i == 1 {
          var d * tuple_int_int = new (tuple_int_int)
              (*d).tuple_int_int_field_0=1
              (*d).tuple_int_int_field_1=0
          directions[i] = d
      } else if i == 2 {
          var e * tuple_int_int = new (tuple_int_int)
              (*e).tuple_int_int_field_0=0
              (*e).tuple_int_int_field_1=-1
          directions[i] = e
      } else if i == 3 {
          var f * tuple_int_int = new (tuple_int_int)
              (*f).tuple_int_int_field_0=-1
              (*f).tuple_int_int_field_1=0
          directions[i] = f
      } else if i == 4 {
          var g * tuple_int_int = new (tuple_int_int)
              (*g).tuple_int_int_field_0=1
              (*g).tuple_int_int_field_1=1
          directions[i] = g
      } else if i == 5 {
          var h * tuple_int_int = new (tuple_int_int)
              (*h).tuple_int_int_field_0=1
              (*h).tuple_int_int_field_1=-1
          directions[i] = h
      } else if i == 6 {
          var k * tuple_int_int = new (tuple_int_int)
              (*k).tuple_int_int_field_0=-1
              (*k).tuple_int_int_field_1=1
          directions[i] = k
      } else {
          var l * tuple_int_int = new (tuple_int_int)
              (*l).tuple_int_int_field_0=-1
              (*l).tuple_int_int_field_1=-1
          directions[i] = l
      }
  }
  max0 := 0
  var m [][]int = make([][]int, 20)
  for o := 0; o < 20; o++ {
      var p []int = make([]int, 20)
      for q := 0; q < 20; q++ {
          fmt.Fscanf(reader, "%d", &p[q])
          skip()
      }
      m[o] = p
  }
  for j := 0; j < 8; j++ {
      var r * tuple_int_int = directions[j]
      dx := (*r).tuple_int_int_field_0
      dy := (*r).tuple_int_int_field_1
      for x := 0; x < 20; x++ {
          for y := 0; y < 20; y++ {
              max0 = max2_(max0, find(4, m, x, y, dx, dy))
          }
      }
  }
  fmt.Printf("%d\n", max0)
}



<|start_filename|>out/npi.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_char_(){
    if (current_char == null) current_char = read_char0();
    var out = current_char;
    current_char = read_char0();
    return out;
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function is_number(c){
    return c.charCodeAt(0) <= '9'.charCodeAt(0) && c.charCodeAt(0) >= '0'.charCodeAt(0);
}
/*
Notation polonaise inversée, ce test permet d'évaluer une expression écrite en NPI
*/
function npi0(str, len){
    var stack = new Array(len);
    for (var i = 0; i < len; i++)
        stack[i] = 0;
    var ptrStack = 0;
    var ptrStr = 0;
    while (ptrStr < len)
        if (str[ptrStr] == ' ')
            ptrStr++;
        else if (is_number(str[ptrStr]))
        {
            var num = 0;
            while (str[ptrStr] != ' ')
            {
                num = num * 10 + str[ptrStr].charCodeAt(0) - '0'.charCodeAt(0);
                ptrStr++;
            }
            stack[ptrStack] = num;
            ptrStack++;
        }
        else if (str[ptrStr] == '+')
        {
            stack[ptrStack - 2] += stack[ptrStack - 1];
            ptrStack--;
            ptrStr++;
        }
    return stack[0];
}
var len = 0;
len = read_int_();
stdinsep();
var tab = new Array(len);
for (var i = 0; i < len; i++)
{
    var tmp = '\x00';
    tmp = read_char_();
    tab[i] = tmp;
}
var result = npi0(tab, len);
util.print(result);



<|start_filename|>out/longest_increasing_subsequence.java<|end_filename|>
import java.util.*;

public class longest_increasing_subsequence
{
  static Scanner scanner = new Scanner(System.in);
  static int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

  static int dichofind(int len, int[] tab, int tofind, int a, int b)
  {
    if (a >= b - 1)
        return a;
    else
    {
        int c = (a + b) / 2;
        if (tab[c] < tofind)
            return dichofind(len, tab, tofind, c, b);
        else
            return dichofind(len, tab, tofind, a, c);
    }
  }
  static int process(int len, int[] tab)
  {
    int[] size = new int[len];
    for (int j = 0; j < len; j++)
        if (j == 0)
            size[j] = 0;
        else
            size[j] = len * 2;
    for (int i = 0; i < len; i++)
    {
        int k = dichofind(len, size, tab[i], 0, len - 1);
        if (size[k + 1] > tab[i])
            size[k + 1] = tab[i];
    }
    for (int l = 0; l < len; l++)
        System.out.printf("%d ", size[l]);
    for (int m = 0; m < len; m++)
    {
        int k = len - 1 - m;
        if (size[k] != len * 2)
            return k;
    }
    return 0;
  }
  public static void main(String args[])
  {
    int n = Integer.parseInt(scanner.nextLine());
    for (int i = 1; i <= n; i++)
    {
        int len = Integer.parseInt(scanner.nextLine());
        System.out.printf("%d\n", process(len, read_int_line()));
    }
  }
  
}



<|start_filename|>out/dichoexp.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function exp0(a, b){
    if (b == 0)
        return 1;
    if (~~(b % 2) == 0)
    {
        var o = exp0(a, ~~(b / 2));
        return o * o;
    }
    else
        return a * exp0(a, b - 1);
}
var a = 0;
var b = 0;
a = read_int_();
stdinsep();
b = read_int_();
util.print(exp0(a, b));



<|start_filename|>out/affect.java<|end_filename|>
import java.util.*;

public class affect
{
  static Scanner scanner = new Scanner(System.in);
  /*
Ce test permet de vérifier que l'implémentation de l'affectation fonctionne correctement
*/
  static class toto {
    public int foo;
    public int bar;
    public int blah;
  }
  static toto mktoto(int v1)
  {
    toto t = new toto();
    t.foo = v1;
    t.bar = v1;
    t.blah = v1;
    return t;
  }
  static toto mktoto2(int v1)
  {
    toto t = new toto();
    t.foo = v1 + 3;
    t.bar = v1 + 2;
    t.blah = v1 + 1;
    return t;
  }
  static int result(toto t_, toto t2_)
  {
    toto t = t_;
    toto t2 = t2_;
    toto t3 = new toto();
    t3.foo = 0;
    t3.bar = 0;
    t3.blah = 0;
    t3 = t2;
    t = t2;
    t2 = t3;
    t.blah++;
    int len = 1;
    int[] cache0 = new int[len];
    for (int i = 0; i < len; i++)
        cache0[i] = -i;
    int[] cache1 = new int[len];
    for (int j = 0; j < len; j++)
        cache1[j] = j;
    int[] cache2 = cache0;
    cache0 = cache1;
    cache2 = cache0;
    return t.foo + t.blah * t.bar + t.bar * t.foo;
  }
  public static void main(String args[])
  {
    toto t = mktoto(4);
    toto t2 = mktoto(5);
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      t.bar = -scanner.nextInt();
    }else{
      t.bar = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      t.blah = -scanner.nextInt();
    }else{
      t.blah = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      t2.bar = -scanner.nextInt();
    }else{
      t2.bar = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      t2.blah = -scanner.nextInt();
    }else{
      t2.blah = scanner.nextInt();
    }
    System.out.printf("%d%d", result(t, t2), t.blah);
  }
  
}



<|start_filename|>out/aaa_02if.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
f i =
  return (if i == 0
          then True
          else False)

main =
  do ifM (f 4)
         (printf "true <-\n ->\n" :: IO ())
         (printf "false <-\n ->\n" :: IO ())
     printf "small test end\n" :: IO ()




<|start_filename|>out/euler45.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int triangle(int n) {
    if (n % 2 == 0)
        return (n / 2) * (n + 1);
    else
        return n * ((n + 1) / 2);
}

int penta(int n) {
    if (n % 2 == 0)
        return (n / 2) * (3 * n - 1);
    else
        return ((3 * n - 1) / 2) * n;
}

int hexa(int n) {
    return n * (2 * n - 1);
}

int findPenta2(int n, int a, int b) {
    if (b == a + 1)
        return penta(a) == n || penta(b) == n;
    int c = (a + b) / 2;
    int p = penta(c);
    if (p == n)
        return 1;
    else if (p < n)
        return findPenta2(n, c, b);
    else
        return findPenta2(n, a, c);
}

int findHexa2(int n, int a, int b) {
    if (b == a + 1)
        return hexa(a) == n || hexa(b) == n;
    int c = (a + b) / 2;
    int p = hexa(c);
    if (p == n)
        return 1;
    else if (p < n)
        return findHexa2(n, c, b);
    else
        return findHexa2(n, a, c);
}
int main(void) {
    int n;
    for (n = 285; n < 55386; n++)
    {
        int t = triangle(n);
        if (findPenta2(t, n / 5, n) && findHexa2(t, n / 5, n / 2 + 10))
            printf("%d\n%d\n", n, t);
    }
    return 0;
}




<|start_filename|>out/rot13.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end
function readchar()
    if buffer == "" then buffer = io.read("*line") end
    local c = string.byte(buffer)
    buffer = string.sub(buffer, 2, -1)
    return c
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
--[[
Ce test effectue un rot13 sur une chaine lue en entrée
--]]

local strlen = readint()
stdinsep()
local tab4 = {}
for toto = 0, strlen - 1 do
    local tmpc = readchar()
    local c = tmpc
    if tmpc ~= 32 then
        c = math.fmod(c - 97 + 13, 26) + 97
    end
    tab4[toto + 1] = c
end
for j = 0, strlen - 1 do
    io.write(string.format("%c", tab4[j + 1]))
end


<|start_filename|>out/abstest.cs<|end_filename|>
using System;

public class abstest
{
  static int abs_(int n)
  {
    if (n > 0)
        return n;
    else
        return -n;
  }
  
  public static void Main(String[] args)
  {
    Console.Write("" + (abs_(5 + 2) * 3) + (3 * abs_(5 + 2)));
  }
  
}



<|start_filename|>out/aaa_11arrayconst.fs<|end_filename|>
: test { tab len }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    tab  i cells +  @ s>d 0 d.r
    S"  " TYPE
   1 + REPEAT 2DROP
  S\" \n" TYPE
;

: main
  HERE 5 cells allot { t }
  4 0 BEGIN 2dup >= WHILE DUP { i }
    1 t  i cells +  !
   1 + REPEAT 2DROP
  t 5 test
  ;
main
BYE



<|start_filename|>out/prologin_template_charline.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class prologin_template_charline
{
  static int programme_candidat(char[] tableau, int taille)
  {
    int out0 = 0;
    for (int i = 0; i < taille; i++)
    {
        out0 += (int)(tableau[i]) * i;
        Console.Write(tableau[i]);
    }
    Console.Write("--\n");
    return out0;
  }
  
  public static void Main(String[] args)
  {
    int taille = int.Parse(Console.ReadLine());
    char[] tableau = Console.ReadLine().ToCharArray();
    Console.Write(programme_candidat(tableau, taille) + "\n");
  }
  
}



<|start_filename|>out/aaa_12strings.fs<|end_filename|>
: main
  S\" tada ' \" \n\r\t $ & todo\n\n{foo} \\${blah}\nblah\n" TYPE
  ;
main
BYE



<|start_filename|>out/abstest.lua<|end_filename|>

io.write(string.format("%d%d", math.abs(5 + 2) * 3, 3 * math.abs(5 + 2)))


<|start_filename|>out/ocaml01.cs<|end_filename|>
using System;

public class ocaml01
{
  static int foo()
  {
    for (int i = 0; i < 11; i++)
    {
        
    }
    return 0;
  }
  
  static int bar()
  {
    for (int i = 0; i < 11; i++)
    {
        int a = 0;
    }
    return 0;
  }
  
  public static void Main(String[] args)
  {
    
  }
  
}



<|start_filename|>out/aaa_08tuple.cc<|end_filename|>
#include <iostream>
#include <vector>
struct tuple_int_int {
    int tuple_int_int_field_0;
    int tuple_int_int_field_1;
};

struct toto {
    tuple_int_int * foo;
    int bar;
};

int main() {
    int d, c, bar_;
    std::cin >> bar_ >> c >> d;
    tuple_int_int * e = new tuple_int_int();
        e->tuple_int_int_field_0 = c;
        e->tuple_int_int_field_1 = d;;
    toto * t = new toto();
        t->foo = e;
        t->bar = bar_;;
    tuple_int_int * f = t->foo;
    int a = f->tuple_int_int_field_0;
    int b = f->tuple_int_int_field_1;
    std::cout << a << " " << b << " " << t->bar << "\n";
}



<|start_filename|>out/prologin_template_charmatrix.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class prologin_template_charmatrix
{
  static int programme_candidat(char[][] tableau, int taille_x, int taille_y)
  {
    int out0 = 0;
    for (int i = 0; i < taille_y; i++)
    {
        for (int j = 0; j < taille_x; j++)
        {
            out0 += (int)(tableau[i][j]) * (i + j * 2);
            Console.Write(tableau[i][j]);
        }
        Console.Write("--\n");
    }
    return out0;
  }
  
  public static void Main(String[] args)
  {
    int taille_x = int.Parse(Console.ReadLine());
    int taille_y = int.Parse(Console.ReadLine());
    char[][] a = new char[taille_y][];
    for (int b = 0; b < taille_y; b++)
        a[b] = Console.ReadLine().ToCharArray();
    char[][] tableau = a;
    Console.Write(programme_candidat(tableau, taille_x, taille_y) + "\n");
  }
  
}



<|start_filename|>out/abstest.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int abs_(int n) {
    if (n > 0)
        return n;
    else
        return -n;
}
int main(void) {
    printf("%d%d", abs_(5 + 2) * 3, 3 * abs_(5 + 2));
    return 0;
}




<|start_filename|>out/testing_count.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>
int count(void* a){ return ((int*)a)[-1]; }

void* alloc(int a, int size){
  void *out_ = malloc( a * size + sizeof(int));
  ((int*)out_)[0]=a;
  return ((int*)out_)+1;
}


int main(void) {
    int i;
    int *tab = alloc(40, sizeof(int));
    for (i = 0; i < 40; i++)
        tab[i] = i * i;
    printf("%d\n", count(tab));
    return 0;
}




<|start_filename|>out/aaa_01hello.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end

io.write("Hello World")
local a = 5
io.write(string.format("%d \n%dfoo", (4 + 6) * 2, a))
if 1 + trunc(2 * 2 * (3 + 8) / 4) - 2 == 12 and true then
    io.write("True")
else 
    io.write("False")
end
io.write("\n")
if (3 * (4 + 11) * 2 == 45) == false then
    io.write("True")
else 
    io.write("False")
end
io.write(" ")
if (2 == 1) == false then
    io.write("True")
else 
    io.write("False")
end
io.write(string.format(" %d%d", trunc(trunc(5 / 3) / 3), trunc(trunc(4 * 1 / 3) / 2 * 1)))
if not(not(a == 0) and not(a == 4)) then
    io.write("True")
else 
    io.write("False")
end
if true and not(false) and not(true and false) then
    io.write("True")
else 
    io.write("False")
end
io.write("\n")


<|start_filename|>out/aaa_read0.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
main =
  do len <- (fmap read getLine)
     printf "%d\n" (len::Int) :: IO()




<|start_filename|>out/prologin_template_charmatrix.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int programme_candidat(char** tableau, int taille_x, int taille_y) {
    int i, j;
    int out0 = 0;
    for (i = 0; i < taille_y; i++)
    {
        for (j = 0; j < taille_x; j++)
        {
            out0 += (int)(tableau[i][j]) * (i + j * 2);
            printf("%c", tableau[i][j]);
        }
        printf("--\n");
    }
    return out0;
}
int main(void) {
    int b, d, taille_y, taille_x;
    scanf("%d %d ", &taille_x, &taille_y);
    char* *a = calloc(taille_y, sizeof(char*));
    for (b = 0; b < taille_y; b++)
    {
        char *c = calloc(taille_x, sizeof(char));
        for (d = 0; d < taille_x; d++)
            scanf("%c", &c[d]);
        scanf(" ");
        a[b] = c;
    }
    char** tableau = a;
    printf("%d\n", programme_candidat(tableau, taille_x, taille_y));
    return 0;
}




<|start_filename|>out/test_enum.js<|end_filename|>
var util = require("util");

var foo_val = "Foo";



<|start_filename|>out/aaa_04loop.groovy<|end_filename|>
import java.util.*

boolean h(int i)
{
  /*  for j = i - 2 to i + 2 do
    if i % j == 5 then return true end
  end */
  int j = i - 2
  while (j <= i + 2)
  {
      if (i % j == 5)
          return true
      j++
  }
  return false
}

int j = 0
for (int k = 0; k < 11; k++)
{
    j += k
    System.out.printf("%d\n", j)
}
int i = 4
while (i < 10)
{
    print(i)
    i++
    j += i
}
System.out.printf("%d%dFIN TEST\n", j, i)



<|start_filename|>out/euler39.java<|end_filename|>
import java.util.*;

public class euler39
{
  
  
  public static void main(String args[])
  {
    int[] t = new int[1001];
    for (int i = 0; i < 1001; i++)
        t[i] = 0;
    for (int a = 1; a < 1001; a++)
        for (int b = 1; b < 1001; b++)
        {
            int c2 = a * a + b * b;
            int c = (int)Math.sqrt(c2);
            if (c * c == c2)
            {
                int p = a + b + c;
                if (p < 1001)
                    t[p]++;
            }
        }
    int j = 0;
    for (int k = 1; k < 1001; k++)
        if (t[k] > t[j])
            j = k;
    System.out.print(j);
  }
  
}



<|start_filename|>out/euler12.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int max2_(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}

int eratostene(int* t, int max0) {
    int i;
    int n = 0;
    for (i = 2; i < max0; i++)
        if (t[i] == i)
        {
            int j = i * i;
            n++;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
}

int fillPrimesFactors(int* t, int n, int* primes, int nprimes) {
    int i;
    for (i = 0; i < nprimes; i++)
    {
        int d = primes[i];
        while (n % d == 0)
        {
            t[d]++;
            n /= d;
        }
        if (n == 1)
            return primes[i];
    }
    return n;
}

int find(int ndiv2) {
    int n, i, m, k, o, j;
    int maximumprimes = 110;
    int *era = calloc(maximumprimes, sizeof(int));
    for (j = 0; j < maximumprimes; j++)
        era[j] = j;
    int nprimes = eratostene(era, maximumprimes);
    int *primes = calloc(nprimes, sizeof(int));
    for (o = 0; o < nprimes; o++)
        primes[o] = 0;
    int l = 0;
    for (k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    for (n = 1; n < 10001; n++)
    {
        int *primesFactors = calloc(n + 2, sizeof(int));
        for (m = 0; m <= n + 1; m++)
            primesFactors[m] = 0;
        int max0 = max2_(fillPrimesFactors(primesFactors, n, primes, nprimes), fillPrimesFactors(primesFactors, n + 1, primes, nprimes));
        primesFactors[2]--;
        int ndivs = 1;
        for (i = 0; i <= max0; i++)
            if (primesFactors[i] != 0)
                ndivs *= 1 + primesFactors[i];
        if (ndivs > ndiv2)
            return n * (n + 1) / 2;
        /* print "n=" print n print "\t" print (n * (n + 1) / 2 ) print " " print ndivs print "\n" */
    }
    return 0;
}
int main(void) {
    printf("%d\n", find(500));
    return 0;
}




<|start_filename|>out/euler45.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: triangle { n }
  n 2 % 0 =
  IF
    n 2 // n 1 + * exit
  ELSE
    n n 1 + 2 // * exit
  THEN
;


: penta { n }
  n 2 % 0 =
  IF
    n 2 // 3 n * 1 - * exit
  ELSE
    3 n * 1 - 2 // n * exit
  THEN
;


: hexa { n }
  n 2 n * 1 - * exit
;


: findPenta2 recursive { n a b }
  b a 1 + =
  IF
    a penta n = b penta n = OR exit
  THEN
  a b + 2 // { c }
  c penta { p }
  p n =
  IF
    true exit
  ELSE
    p n <
    IF
      n c b findPenta2 exit
    ELSE
      n a c findPenta2 exit
    THEN
  THEN
;


: findHexa2 recursive { n a b }
  b a 1 + =
  IF
    a hexa n = b hexa n = OR exit
  THEN
  a b + 2 // { c }
  c hexa { p }
  p n =
  IF
    true exit
  ELSE
    p n <
    IF
      n c b findHexa2 exit
    ELSE
      n a c findHexa2 exit
    THEN
  THEN
;

: main
  55385 285 BEGIN 2dup >= WHILE DUP { n }
    n triangle { t }
    t n 5 // n findPenta2 t n 5 // n 2 // 10 + findHexa2 AND
    IF
      n s>d 0 d.r
      S\" \n" TYPE
      t s>d 0 d.r
      S\" \n" TYPE
    THEN
   1 + REPEAT 2DROP
  ;
main
BYE



<|start_filename|>out/recordtest.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}

type toto struct {
  foo int;
  bar int;
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var param * toto = new (toto)
      (*param).foo=0
      (*param).bar=0
  fmt.Fscanf(reader, "%d", &(*param).bar)
  skip()
  fmt.Fscanf(reader, "%d", &(*param).foo)
  fmt.Printf("%d", (*param).bar + (*param).foo * (*param).bar)
}



<|start_filename|>out/testing_count.lua<|end_filename|>

local tab = {}
for i = 0, 39 do
    tab[i + 1] = i * i
end
io.write(string.format("%d\n", #tab))


<|start_filename|>out/pathfinding.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
: read-char current-char next-char ;
: pathfind_aux recursive { cache tab x y posX posY }
  posX x 1 - = posY y 1 - = AND
  IF
    0 exit
  ELSE
    posX 0 < posY 0 < OR posX x >= OR posY y >= OR
    IF
      x y * 10 * exit
    ELSE
      tab  posY cells +  @  posX cells +  @ 35 =
      IF
        x y * 10 * exit
      ELSE
        cache  posY cells +  @  posX cells +  @ 1 NEGATE <>
        IF
          cache  posY cells +  @  posX cells +  @ exit
        ELSE
          x y * 10 * cache  posY cells +  @  posX cells +  !
          cache tab x y posX 1 + posY pathfind_aux { val1 }
          cache tab x y posX 1 - posY pathfind_aux { val2 }
          cache tab x y posX posY 1 - pathfind_aux { val3 }
          cache tab x y posX posY 1 + pathfind_aux { val4 }
          1 val1 val2 min val3 min val4 min + { out0 }
          out0 cache  posY cells +  @  posX cells +  !
          out0 exit
        THEN
      THEN
    THEN
  THEN
;


: pathfind { tab x y }
  HERE y cells allot { cache }
  y 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    HERE x cells allot { tmp }
    x 1 - 0 BEGIN 2dup >= WHILE DUP { j }
      1 NEGATE tmp  j cells +  !
     1 + REPEAT 2DROP
    tmp cache  i cells +  !
   1 + REPEAT 2DROP
  cache tab x y 0 0 pathfind_aux exit
;

: main
  read-int { x }
  skipspaces
  read-int { y }
  skipspaces
  HERE y cells allot { tab }
  y 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    HERE x cells allot { tab2 }
    x 1 - 0 BEGIN 2dup >= WHILE DUP { j }
      0 { tmp }
      read-char TO tmp
      tmp tab2  j cells +  !
     1 + REPEAT 2DROP
    skipspaces
    tab2 tab  i cells +  !
   1 + REPEAT 2DROP
  tab x y pathfind { result }
  result s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/euler26.java<|end_filename|>
import java.util.*;

public class euler26
{
  
  static int periode(int[] restes, int len, int a, int b)
  {
    while (a != 0)
    {
        int chiffre = a / b;
        int reste = a % b;
        for (int i = 0; i < len; i++)
            if (restes[i] == reste)
                return len - i;
        restes[len] = reste;
        len++;
        a = reste * 10;
    }
    return 0;
  }
  public static void main(String args[])
  {
    int[] t = new int[1000];
    for (int j = 0; j < 1000; j++)
        t[j] = 0;
    int m = 0;
    int mi = 0;
    for (int i = 1; i < 1001; i++)
    {
        int p = periode(t, 0, 1, i);
        if (p > m)
        {
            mi = i;
            m = p;
        }
    }
    System.out.printf("%d\n%d\n", mi, m);
  }
  
}



<|start_filename|>out/devine.cc<|end_filename|>
#include <iostream>
#include <vector>

bool devine0(int nombre, std::vector<int> * tab, int len) {
    int min0 = tab->at(0);
    int max0 = tab->at(1);
    for (int i = 2; i < len; i++)
    {
        if (tab->at(i) > max0 || tab->at(i) < min0)
            return false;
        if (tab->at(i) < nombre)
            min0 = tab->at(i);
        if (tab->at(i) > nombre)
            max0 = tab->at(i);
        if (tab->at(i) == nombre && len != i + 1)
            return false;
    }
    return true;
}

int main() {
    int tmp, len, nombre;
    std::cin >> nombre >> len;
    std::vector<int> *tab = new std::vector<int>( len );
    for (int i = 0; i < len; i++)
    {
        std::cin >> tmp;
        tab->at(i) = tmp;
    }
    if (devine0(nombre, tab, len))
        std::cout << "True";
    else
        std::cout << "False";
}



<|start_filename|>out/aaa_integer.cpp<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    int i = 0;
    i--;
    std::cout << i << "\n";
    i += 55;
    std::cout << i << "\n";
    i *= 13;
    std::cout << i << "\n";
    i /= 2;
    std::cout << i << "\n";
    i++;
    std::cout << i << "\n";
    i /= 3;
    std::cout << i << "\n";
    i--;
    std::cout << i << "\n";
    /*
http://fr.wikipedia.org/wiki/Modulo_(op%C3%A9ration)#Trois_d.C3.A9finitions_de_la_fonction_modulo
*/
    std::cout << 117 / 17 << "\n" << 117 / -17 << "\n" << -117 / 17 << "\n" << -117 / -17 << "\n" << 117 % 17 << "\n" << 117 % -17 << "\n" << -117 % 17 << "\n" << -117 % -17 << "\n";
}



<|start_filename|>out/euler32.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
--[[
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once;
for example, the 5-digit number, 15234, is 1 through 5 pandigital.

The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier,
and product is 1 through 9 pandigital.

Find the sum of all products whose multiplicand/multiplier/product identity can be written as a
1 through 9 pandigital.

HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.


(a * 10 + b) ( c * 100 + d * 10 + e) =
  a * c * 1000 +
  a * d * 100 +
  a * e * 10 +
  b * c * 100 +
  b * d * 10 +
  b * e
  => b != e != b * e % 10 ET
  a != d != (b * e / 10 + b * d + a * e ) % 10
--]]

function okdigits (ok, n)
  if n == 0 then
      return true
  else 
      local digit = math.fmod(n, 10)
      if ok[digit + 1] then
          ok[digit + 1] = false
          local o = okdigits(ok, trunc(n / 10))
          ok[digit + 1] = true
          return o
      else 
          return false
      end
  end
end

local count = 0
local allowed = {}
for i = 0, 9 do
    allowed[i + 1] = i ~= 0
end
local counted = {}
for j = 0, 99999 do
    counted[j + 1] = false
end
for e = 1, 9 do
    allowed[e + 1] = false
    for b = 1, 9 do
        if allowed[b + 1] then
            allowed[b + 1] = false
            local be = math.fmod(b * e, 10)
            if allowed[be + 1] then
                allowed[be + 1] = false
                for a = 1, 9 do
                    if allowed[a + 1] then
                        allowed[a + 1] = false
                        for c = 1, 9 do
                            if allowed[c + 1] then
                                allowed[c + 1] = false
                                for d = 1, 9 do
                                    if allowed[d + 1] then
                                        allowed[d + 1] = false
                                        --[[ 2 * 3 digits --]]
                                        local product = (a * 10 + b) * (c * 100 + d * 10 + e)
                                        if not(counted[product + 1]) and okdigits(allowed, trunc(product / 10)) then
                                            counted[product + 1] = true
                                            count = count + product
                                            io.write(string.format("%d ", product))
                                        end
                                        --[[ 1  * 4 digits --]]
                                        local product2 = b * (a * 1000 + c * 100 + d * 10 + e)
                                        if not(counted[product2 + 1]) and okdigits(allowed, trunc(product2 / 10)) then
                                            counted[product2 + 1] = true
                                            count = count + product2
                                            io.write(string.format("%d ", product2))
                                        end
                                        allowed[d + 1] = true
                                    end
                                end
                                allowed[c + 1] = true
                            end
                        end
                        allowed[a + 1] = true
                    end
                end
                allowed[be + 1] = true
            end
            allowed[b + 1] = true
        end
    end
    allowed[e + 1] = true
end
io.write(string.format("%d\n", count))


<|start_filename|>out/euler36.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: palindrome2 { pow2 n }
  HERE 20 cells allot { t }
  19 0 BEGIN 2dup >= WHILE DUP { i }
    n pow2  i cells +  @ // 2 % 1 = t  i cells +  !
   1 + REPEAT 2DROP
  0 { nnum }
  19 1 BEGIN 2dup >= WHILE DUP { j }
    t  j cells +  @
    IF
      j TO nnum
    THEN
   1 + REPEAT 2DROP
  nnum 2 // 0 BEGIN 2dup >= WHILE DUP { k }
    t  k cells +  @ t  nnum k - cells +  @ <>
    IF
      DROP DROP false exit
    THEN
   1 + REPEAT 2DROP
  true exit
;

: main
  1 { p }
  HERE 20 cells allot { pow2 }
  19 0 BEGIN 2dup >= WHILE DUP { i }
    p 2 * TO p
    p 2 // pow2  i cells +  !
   1 + REPEAT 2DROP
  0 { sum }
  9 1 BEGIN 2dup >= WHILE DUP { d }
    pow2 d palindrome2
    IF
      d s>d 0 d.r
      S\" \n" TYPE
      sum d + TO sum
    THEN
    pow2 d 10 * d + palindrome2
    IF
      d 10 * d + s>d 0 d.r
      S\" \n" TYPE
      sum d 10 * d + + TO sum
    THEN
   1 + REPEAT 2DROP
  4 0 BEGIN 2dup >= WHILE DUP { a0 }
    a0 2 * 1 + { a }
    9 0 BEGIN 2dup >= WHILE DUP { b }
      9 0 BEGIN 2dup >= WHILE DUP { c }
        a 100000 * b 10000 * + c 1000 * + c 100 * + b 10 * + a + { num0 }
        pow2 num0 palindrome2
        IF
          num0 s>d 0 d.r
          S\" \n" TYPE
          sum num0 + TO sum
        THEN
        a 10000 * b 1000 * + c 100 * + b 10 * + a + { num1 }
        pow2 num1 palindrome2
        IF
          num1 s>d 0 d.r
          S\" \n" TYPE
          sum num1 + TO sum
        THEN
       1 + REPEAT 2DROP
      a 100 * b 10 * + a + { num2 }
      pow2 num2 palindrome2
      IF
        num2 s>d 0 d.r
        S\" \n" TYPE
        sum num2 + TO sum
      THEN
      a 1000 * b 100 * + b 10 * + a + { num3 }
      pow2 num3 palindrome2
      IF
        num3 s>d 0 d.r
        S\" \n" TYPE
        sum num3 + TO sum
      THEN
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  S" sum=" TYPE
  sum s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/aaa_041comment.lua<|end_filename|>

local i = 4
--[[while i < 10 do --]]
io.write(i)
i = i + 1
--[[  end --]]
io.write(i)


<|start_filename|>out/euler36.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int palindrome2(int* pow2, int n) {
    int k, j, i;
    int *t = calloc(20, sizeof(int));
    for (i = 0; i < 20; i++)
        t[i] = n / pow2[i] % 2 == 1;
    int nnum = 0;
    for (j = 1; j < 20; j++)
        if (t[j])
            nnum = j;
    for (k = 0; k <= nnum / 2; k++)
        if (t[k] != t[nnum - k])
            return 0;
    return 1;
}
int main(void) {
    int a0, b, c, d, i;
    int p = 1;
    int *pow2 = calloc(20, sizeof(int));
    for (i = 0; i < 20; i++)
    {
        p *= 2;
        pow2[i] = p / 2;
    }
    int sum = 0;
    for (d = 1; d < 10; d++)
    {
        if (palindrome2(pow2, d))
        {
            printf("%d\n", d);
            sum += d;
        }
        if (palindrome2(pow2, d * 10 + d))
        {
            printf("%d\n", d * 10 + d);
            sum += d * 10 + d;
        }
    }
    for (a0 = 0; a0 < 5; a0++)
    {
        int a = a0 * 2 + 1;
        for (b = 0; b < 10; b++)
        {
            for (c = 0; c < 10; c++)
            {
                int num0 = a * 100000 + b * 10000 + c * 1000 + c * 100 + b * 10 + a;
                if (palindrome2(pow2, num0))
                {
                    printf("%d\n", num0);
                    sum += num0;
                }
                int num1 = a * 10000 + b * 1000 + c * 100 + b * 10 + a;
                if (palindrome2(pow2, num1))
                {
                    printf("%d\n", num1);
                    sum += num1;
                }
            }
            int num2 = a * 100 + b * 10 + a;
            if (palindrome2(pow2, num2))
            {
                printf("%d\n", num2);
                sum += num2;
            }
            int num3 = a * 1000 + b * 100 + b * 10 + a;
            if (palindrome2(pow2, num3))
            {
                printf("%d\n", num3);
                sum += num3;
            }
        }
    }
    printf("sum=%d\n", sum);
    return 0;
}




<|start_filename|>out/aaa_041comment.js<|end_filename|>
var util = require("util");

var i = 4;
// while i < 10 do 
util.print(i);
i++;
//   end 
util.print(i);



<|start_filename|>out/pathfindList.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int pathfind_aux(int* cache, int* tab, int len, int pos) {
    if (pos >= len - 1)
        return 0;
    else if (cache[pos] != -1)
        return cache[pos];
    else
    {
        cache[pos] = len * 2;
        int posval = pathfind_aux(cache, tab, len, tab[pos]);
        int oneval = pathfind_aux(cache, tab, len, pos + 1);
        int out0 = 0;
        if (posval < oneval)
            out0 = 1 + posval;
        else
            out0 = 1 + oneval;
        cache[pos] = out0;
        return out0;
    }
}

int pathfind(int* tab, int len) {
    int i;
    int *cache = calloc(len, sizeof(int));
    for (i = 0; i < len; i++)
        cache[i] = -1;
    return pathfind_aux(cache, tab, len, 0);
}
int main(void) {
    int i;
    int len = 0;
    scanf("%d ", &len);
    int *tab = calloc(len, sizeof(int));
    for (i = 0; i < len; i++)
    {
        int tmp = 0;
        scanf("%d ", &tmp);
        tab[i] = tmp;
    }
    int result = pathfind(tab, len);
    printf("%d", result);
    return 0;
}




<|start_filename|>out/aaa_read0.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*


@Field Scanner scanner = new Scanner(System.in)
int len = Integer.parseInt(scanner.nextLine())
System.out.printf("%d\n", len)



<|start_filename|>out/montagnes.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function montagnes0(tab, len){
    var max0 = 1;
    var j = 1;
    var i = len - 2;
    while (i >= 0)
    {
        var x = tab[i];
        while (j >= 0 && x > tab[len - j])
            j--;
        j++;
        tab[len - j] = x;
        if (j > max0)
            max0 = j;
        i--;
    }
    return max0;
}
var len = 0;
len = read_int_();
stdinsep();
var tab = new Array(len);
for (var i = 0; i < len; i++)
{
    var x = 0;
    x = read_int_();
    stdinsep();
    tab[i] = x;
}
util.print(montagnes0(tab, len));



<|start_filename|>out/euler45.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function triangle (n)
  if math.fmod(n, 2) == 0 then
      return trunc(n / 2) * (n + 1)
  else 
      return n * trunc((n + 1) / 2)
  end
end

function penta (n)
  if math.fmod(n, 2) == 0 then
      return trunc(n / 2) * (3 * n - 1)
  else 
      return trunc((3 * n - 1) / 2) * n
  end
end

function hexa (n)
  return n * (2 * n - 1)
end

function findPenta2 (n, a, b)
  if b == a + 1 then
      return penta(a) == n or penta(b) == n
  end
  local c = trunc((a + b) / 2)
  local p = penta(c)
  if p == n then
      return true
  elseif p < n then
      return findPenta2(n, c, b)
  else 
      return findPenta2(n, a, c)
  end
end

function findHexa2 (n, a, b)
  if b == a + 1 then
      return hexa(a) == n or hexa(b) == n
  end
  local c = trunc((a + b) / 2)
  local p = hexa(c)
  if p == n then
      return true
  elseif p < n then
      return findHexa2(n, c, b)
  else 
      return findHexa2(n, a, c)
  end
end

for n = 285, 55385 do
    local t = triangle(n)
    if findPenta2(t, trunc(n / 5), n) and findHexa2(t, trunc(n / 5), trunc(n / 2) + 10) then
        io.write(string.format("%d\n%d\n", n, t))
    end
end


<|start_filename|>out/euler26.js<|end_filename|>
var util = require("util");
function periode(restes, len, a, b){
    while (a != 0)
    {
        var chiffre = ~~(a / b);
        var reste = ~~(a % b);
        for (var i = 0; i < len; i++)
            if (restes[i] == reste)
                return len - i;
        restes[len] = reste;
        len++;
        a = reste * 10;
    }
    return 0;
}
var t = new Array(1000);
for (var j = 0; j < 1000; j++)
    t[j] = 0;
var m = 0;
var mi = 0;
for (var i = 1; i < 1001; i++)
{
    var p = periode(t, 0, 1, i);
    if (p > m)
    {
        mi = i;
        m = p;
    }
}
util.print(mi, "\n", m, "\n");



<|start_filename|>out/euler04.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
--[[

(a + b * 10 + c * 100) * (d + e * 10 + f * 100) =
a * d + a * e * 10 + a * f * 100 +
10 * (b * d + b * e * 10 + b * f * 100)+
100 * (c * d + c * e * 10 + c * f * 100) =

a * d       + a * e * 10   + a * f * 100 +
b * d * 10  + b * e * 100  + b * f * 1000 +
c * d * 100 + c * e * 1000 + c * f * 10000 =

a * d +
10 * ( a * e + b * d) +
100 * (a * f + b * e + c * d) +
(c * e + b * f) * 1000 +
c * f * 10000

--]]

function chiffre (c, m)
  if c == 0 then
      return math.fmod(m, 10)
  else 
      return chiffre(c - 1, trunc(m / 10))
  end
end

local m = 1
for a = 0, 9 do
    for f = 1, 9 do
        for d = 0, 9 do
            for c = 1, 9 do
                for b = 0, 9 do
                    for e = 0, 9 do
                        local mul = a * d + 10 * (a * e + b * d) + 100 * (a * f + b * e + c * d) + 1000 * (c * e + b * f) + 10000 * c * f
                        if chiffre(0, mul) == chiffre(5, mul) and chiffre(1, mul) == chiffre(4, mul) and chiffre(2, mul) == chiffre(3, mul) then
                            m = math.max(mul, m)
                        end
                    end
                end
            end
        end
    end
end
io.write(string.format("%d\n", m))


<|start_filename|>out/aaa_021if.groovy<|end_filename|>
import java.util.*

void testA(boolean a, boolean b)
{
  if (a)
      if (b)
          print("A")
      else
          print("B")
  else if (b)
      print("C")
  else
      print("D")
}
void testB(boolean a, boolean b)
{
  if (a)
      print("A")
  else if (b)
      print("B")
  else
      print("C")
}
void testC(boolean a, boolean b)
{
  if (a)
      if (b)
          print("A")
      else
          print("B")
  else
      print("C")
}
void testD(boolean a, boolean b)
{
  if (a)
  {
      if (b)
          print("A")
      else
          print("B")
      print("C")
  }
  else
      print("D")
}
void testE(boolean a, boolean b)
{
  if (a)
  {
      if (b)
          print("A")
  }
  else
  {
      if (b)
          print("C")
      else
          print("D")
      print("E")
  }
}
void test(boolean a, boolean b)
{
  testD(a, b)
  testE(a, b)
  print("\n")
}

test(true, true)
test(true, false)
test(false, true)
test(false, false)



<|start_filename|>out/aaa_013option.lua<|end_filename|>
function default0 (a, b, c, d, e, f)
  return 0
end

function aa (b)
  
end

local a = null
io.write("___\n")


<|start_filename|>out/prologin_template_intmatrix.cc<|end_filename|>
#include <iostream>
#include <vector>

int programme_candidat(std::vector<std::vector<int> *> * tableau, int x, int y) {
    int out0 = 0;
    for (int i = 0; i < y; i++)
        for (int j = 0; j < x; j++)
            out0 += tableau->at(i)->at(j) * (i * 2 + j);
    return out0;
}

int main() {
    int taille_y, taille_x;
    std::cin >> taille_x >> taille_y;
    std::vector<std::vector<int> *> *tableau = new std::vector<std::vector<int> *>( taille_y );
    for (int a = 0; a < taille_y; a++)
    {
        std::vector<int> *b = new std::vector<int>( taille_x );
        for (int c = 0; c < taille_x; c++)
        {
            std::cin >> b->at(c);
        }
        tableau->at(a) = b;
    }
    std::cout << programme_candidat(tableau, taille_x, taille_y) << "\n";
}



<|start_filename|>out/euler33.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

int pgcd(int a, int b) {
    int c = std::min(a, b);
    int d = std::max(a, b);
    int reste = d % c;
    if (reste == 0)
        return c;
    else
        return pgcd(c, reste);
}

int main() {
    int top = 1;
    int bottom = 1;
    for (int i = 1; i < 10; i++)
        for (int j = 1; j < 10; j++)
            for (int k = 1; k < 10; k++)
                if (i != j && j != k)
                {
                    int a = i * 10 + j;
                    int b = j * 10 + k;
                    if (a * k == i * b)
                    {
                        std::cout << a << "/" << b << "\n";
                        top *= a;
                        bottom *= b;
                    }
                }
    std::cout << top << "/" << bottom << "\n";
    int p = pgcd(top, bottom);
    std::cout << "pgcd=" << p << "\n" << bottom / p << "\n";
}



<|start_filename|>out/aaa_10stringsarray.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

typedef struct toto {
  char* s;
    int v;
} toto;

char* idstring(char* s) {
    return s;
}

void printstring(char* s) {
    printf("%s\n", idstring(s));
}

void print_toto(struct toto * t) {
    printf("%s = %d\n", t->s, t->v);
}
int main(void) {
    int j, i;
    char* *tab = calloc(2, sizeof(char*));
    for (i = 0; i < 2; i++)
        tab[i] = idstring("chaine de test");
    for (j = 0; j < 2; j++)
        printstring(idstring(tab[j]));
    struct toto * a = malloc(sizeof(toto));
    a->s = "one";
    a->v = 1;
    print_toto(a);
    return 0;
}




<|start_filename|>out/fibo.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

/* 
La suite de fibonaci
 */


int fibo0(int a, int b, int i) {
    int j;
    int out0 = 0;
    int a2 = a;
    int b2 = b;
    for (j = 0; j <= i + 1; j++)
    {
        out0 += a2;
        int tmp = b2;
        b2 += a2;
        a2 = tmp;
    }
    return out0;
}
int main(void) {
    int i, b, a;
    scanf("%d %d %d", &a, &b, &i);
    printf("%d", fibo0(a, b, i));
    return 0;
}




<|start_filename|>out/vigenere.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func position_alphabet(c byte) int{
  i := (int)(c)
  if i <= (int)('Z') && i >= (int)('A') {
      return i - (int)('A')
  } else if i <= (int)('z') && i >= (int)('a') {
      return i - (int)('a')
  } else {
      return -1
  }
}
func of_position_alphabet(c int) byte{
  return (byte)(c + (int)('a'))
}
func crypte(taille_cle int, cle []byte, taille int, message []byte) {
  for i := 0; i < taille; i++ {
      lettre := position_alphabet(message[i])
      if lettre != -1 {
          addon := position_alphabet(cle[i % taille_cle])
          new0 := (addon + lettre) % 26
          message[i] = of_position_alphabet(new0)
      }
  }
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var taille_cle int
  fmt.Fscanf(reader, "%d", &taille_cle)
  skip()
  var cle []byte = make([]byte, taille_cle)
  for index := 0; index < taille_cle; index++ {
      var out0 byte
      fmt.Fscanf(reader, "%c", &out0)
      cle[index] = out0
  }
  var taille int
  skip()
  fmt.Fscanf(reader, "%d", &taille)
  skip()
  var message []byte = make([]byte, taille)
  for index2 := 0; index2 < taille; index2++ {
      var out2 byte
      fmt.Fscanf(reader, "%c", &out2)
      message[index2] = out2
  }
  crypte(taille_cle, cle, taille, message)
  for i := 0; i < taille; i++ {
      fmt.Printf("%c", message[i])
  }
  fmt.Printf("\n")
}



<|start_filename|>out/fibo.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}
/*
La suite de fibonaci
*/
function fibo0(a, b, i){
    var out0 = 0;
    var a2 = a;
    var b2 = b;
    for (var j = 0; j <= i + 1; j++)
    {
        out0 += a2;
        var tmp = b2;
        b2 += a2;
        a2 = tmp;
    }
    return out0;
}
var a = read_int_();
stdinsep();
var b = read_int_();
stdinsep();
var i = read_int_();
util.print(fibo0(a, b, i));



<|start_filename|>out/euler09.java<|end_filename|>
import java.util.*;

public class euler09
{
  
  
  public static void main(String args[])
  {
    /*
	a + b + c = 1000 && a * a + b * b = c * c
	*/
    for (int a = 1; a < 1001; a++)
        for (int b = a + 1; b < 1001; b++)
        {
            int c = 1000 - a - b;
            int a2b2 = a * a + b * b;
            int cc = c * c;
            if (cc == a2b2 && c > a)
                System.out.printf("%d\n%d\n%d\n%d\n", a, b, c, a * b * c);
        }
  }
  
}



<|start_filename|>out/euler36.go<|end_filename|>
package main
import "fmt"
func palindrome2(pow2 []int, n int) bool{
  var t []bool = make([]bool, 20)
  for i := 0; i < 20; i++ {
      t[i] = n / pow2[i] % 2 == 1
  }
  nnum := 0
  for j := 1; j < 20; j++ {
      if t[j] {
          nnum = j
      }
  }
  for k := 0; k <= nnum / 2; k++ {
      if t[k] != t[nnum - k] {
          return false
      }
  }
  return true
}
func main() {
  p := 1
  var pow2 []int = make([]int, 20)
  for i := 0; i < 20; i++ {
      p *= 2
      pow2[i] = p / 2
  }
  sum := 0
  for d := 1; d < 10; d++ {
      if palindrome2(pow2, d) {
          fmt.Printf("%d\n", d)
          sum += d
      }
      if palindrome2(pow2, d * 10 + d) {
          fmt.Printf("%d\n", d * 10 + d)
          sum += d * 10 + d
      }
  }
  for a0 := 0; a0 < 5; a0++ {
      a := a0 * 2 + 1
      for b := 0; b < 10; b++ {
          for c := 0; c < 10; c++ {
              num0 := a * 100000 + b * 10000 + c * 1000 + c * 100 + b * 10 + a
              if palindrome2(pow2, num0) {
                  fmt.Printf("%d\n", num0)
                  sum += num0
              }
              num1 := a * 10000 + b * 1000 + c * 100 + b * 10 + a
              if palindrome2(pow2, num1) {
                  fmt.Printf("%d\n", num1)
                  sum += num1
              }
          }
          num2 := a * 100 + b * 10 + a
          if palindrome2(pow2, num2) {
              fmt.Printf("%d\n", num2)
              sum += num2
          }
          num3 := a * 1000 + b * 100 + b * 10 + a
          if palindrome2(pow2, num3) {
              fmt.Printf("%d\n", num3)
              sum += num3
          }
      }
  }
  fmt.Printf("sum=%d\n", sum)
}



<|start_filename|>out/euler34.fs<|end_filename|>
: main
  HERE 10 cells allot { f }
  9 0 BEGIN 2dup >= WHILE DUP { j }
    1 f  j cells +  !
   1 + REPEAT 2DROP
  9 1 BEGIN 2dup >= WHILE DUP { i }
    f  i cells +  @ i f  i 1 - cells +  @ * * f  i cells +  !
    f  i cells +  @ s>d 0 d.r
    S"  " TYPE
   1 + REPEAT 2DROP
  0 { out0 }
  S\" \n" TYPE
  9 0 BEGIN 2dup >= WHILE DUP { a }
    9 0 BEGIN 2dup >= WHILE DUP { b }
      9 0 BEGIN 2dup >= WHILE DUP { c }
        9 0 BEGIN 2dup >= WHILE DUP { d }
          9 0 BEGIN 2dup >= WHILE DUP { e }
            9 0 BEGIN 2dup >= WHILE DUP { g }
              f  a cells +  @ f  b cells +  @ + f  c cells +  @ + f  d cells +  @ + f  e cells +  @ + f  g cells +  @ +
              { sum }
              a 10 * b + 10 * c + 10 * d + 10 * e + 10 * g + { num }
              a 0 =
              IF
                sum 1 - TO sum
                b 0 =
                IF
                  sum 1 - TO sum
                  c 0 =
                  IF
                    sum 1 - TO sum
                    d 0 =
                    IF
                      sum 1 - TO sum
                    THEN
                  THEN
                THEN
              THEN
              sum num = sum 1 <> AND sum 2 <> AND
              IF
                out0 num + TO out0
                num s>d 0 d.r
                S"  " TYPE
              THEN
             1 + REPEAT 2DROP
           1 + REPEAT 2DROP
         1 + REPEAT 2DROP
       1 + REPEAT 2DROP
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  S\" \n" TYPE
  out0 s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/sort.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function copytab(tab, len){
    var o = new Array(len);
    for (var i = 0; i < len; i++)
        o[i] = tab[i];
    return o;
}
function bubblesort(tab, len){
    for (var i = 0; i < len; i++)
        for (var j = i + 1; j < len; j++)
            if (tab[i] > tab[j])
            {
                var tmp = tab[i];
                tab[i] = tab[j];
                tab[j] = tmp;
            }
}
function qsort0(tab, len, i, j){
    if (i < j)
    {
        var i0 = i;
        var j0 = j;
        //  pivot : tab[0] 
        while (i != j)
            if (tab[i] > tab[j])
                if (i == j - 1)
                {
                    //  on inverse simplement
                    var tmp = tab[i];
                    tab[i] = tab[j];
                    tab[j] = tmp;
                    i++;
                }
                else
                {
                    //  on place tab[i+1] à la place de tab[j], tab[j] à la place de tab[i] et tab[i] à la place de tab[i+1] 
                    var tmp = tab[i];
                    tab[i] = tab[j];
                    tab[j] = tab[i + 1];
                    tab[i + 1] = tmp;
                    i++;
                }
            else
                j--;
        qsort0(tab, len, i0, i - 1);
        qsort0(tab, len, i + 1, j0);
    }
}
var len = 2;
len = read_int_();
stdinsep();
var tab = new Array(len);
for (var i_ = 0; i_ < len; i_++)
{
    var tmp = 0;
    tmp = read_int_();
    stdinsep();
    tab[i_] = tmp;
}
var tab2 = copytab(tab, len);
bubblesort(tab2, len);
for (var i = 0; i < len; i++)
    util.print(tab2[i], " ");
util.print("\n");
var tab3 = copytab(tab, len);
qsort0(tab3, len, 0, len - 1);
for (var i = 0; i < len; i++)
    util.print(tab3[i], " ");
util.print("\n");



<|start_filename|>out/euler08.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader
func max2_(a int, b int) int{
  if a > b {
      return a
  } else {
      return b
  }
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  i := 1
  var last []int = make([]int, 5)
  for j := 0; j < 5; j++ {
      var c byte
      fmt.Fscanf(reader, "%c", &c)
      d := (int)(c) - (int)('0')
      i *= d
      last[j] = d
  }
  max0 := i
  index := 0
  nskipdiv := 0
  for k := 1; k < 996; k++ {
      var e byte
      fmt.Fscanf(reader, "%c", &e)
      f := (int)(e) - (int)('0')
      if f == 0 {
          i = 1
          nskipdiv = 4
      } else {
          i *= f
          if nskipdiv < 0 {
              i /= last[index]
          }
          nskipdiv--
      }
      last[index] = f
      index = (index + 1) % 5
      max0 = max2_(max0, i)
  }
  fmt.Printf("%d\n", max0)
}



<|start_filename|>out/summax_souslist.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure summax_souslist is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function summax(lst : in a_PTR; len : in Integer) return Integer is
  max0 : Integer;
  current : Integer;
begin
  current := 0;
  max0 := 0;
  for i in integer range 0..len - 1 loop
    current := current + lst(i);
    if current < 0
    then
      current := 0;
    end if;
    if max0 < current
    then
      max0 := current;
    end if;
  end loop;
  return max0;
end;

  tmp : Integer;
  tab : a_PTR;
  result : Integer;
  len : Integer;
begin
  len := 0;
  Get(len);
  SkipSpaces;
  tab := new a (0..len - 1);
  for i in integer range 0..len - 1 loop
    tmp := 0;
    Get(tmp);
    SkipSpaces;
    tab(i) := tmp;
  end loop;
  result := summax(tab, len);
  PInt(result);
end;


<|start_filename|>out/euler11.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

  int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

int find(int n, int[][] m, int x, int y, int dx, int dy)
{
  if (x < 0 || x == 20 || y < 0 || y == 20)
      return -1
  else if (n == 0)
      return 1
  else
      return m[y][x] * find(n - 1, m, x + dx, y + dy, dx, dy)
}
class Tuple_int_int {
  int tuple_int_int_field_0
  int tuple_int_int_field_1
}
@Field Scanner scanner = new Scanner(System.in)
Tuple_int_int[] directions = new Tuple_int_int[8]
for (int i = 0; i < 8; i++)
    if (i == 0)
    {
        Tuple_int_int c = new Tuple_int_int()
        c.tuple_int_int_field_0 = 0
        c.tuple_int_int_field_1 = 1
        directions[i] = c
    }
    else if (i == 1)
    {
        Tuple_int_int d = new Tuple_int_int()
        d.tuple_int_int_field_0 = 1
        d.tuple_int_int_field_1 = 0
        directions[i] = d
    }
    else if (i == 2)
    {
        Tuple_int_int e = new Tuple_int_int()
        e.tuple_int_int_field_0 = 0
        e.tuple_int_int_field_1 = -1
        directions[i] = e
    }
    else if (i == 3)
    {
        Tuple_int_int f = new Tuple_int_int()
        f.tuple_int_int_field_0 = -1
        f.tuple_int_int_field_1 = 0
        directions[i] = f
    }
    else if (i == 4)
    {
        Tuple_int_int g = new Tuple_int_int()
        g.tuple_int_int_field_0 = 1
        g.tuple_int_int_field_1 = 1
        directions[i] = g
    }
    else if (i == 5)
    {
        Tuple_int_int h = new Tuple_int_int()
        h.tuple_int_int_field_0 = 1
        h.tuple_int_int_field_1 = -1
        directions[i] = h
    }
    else if (i == 6)
    {
        Tuple_int_int k = new Tuple_int_int()
        k.tuple_int_int_field_0 = -1
        k.tuple_int_int_field_1 = 1
        directions[i] = k
    }
    else
    {
        Tuple_int_int l = new Tuple_int_int()
        l.tuple_int_int_field_0 = -1
        l.tuple_int_int_field_1 = -1
        directions[i] = l
    }
int max0 = 0
int[][] m = new int[20][]
for (int o = 0; o < 20; o++)
    m[o] = read_int_line()
for (int j = 0; j < 8; j++)
{
    Tuple_int_int p = directions[j]
    int dx = p.tuple_int_int_field_0
    int dy = p.tuple_int_int_field_1
    for (int x = 0; x < 20; x++)
        for (int y = 0; y < 20; y++)
            max0 = Math.max(max0, find(4, m, x, y, dx, dy))
}
System.out.printf("%d\n", max0)



<|start_filename|>out/aaa_10stringsarray.java<|end_filename|>
import java.util.*;

public class aaa_10stringsarray
{
  
  static class toto {
    public String s;
    public int v;
  }
  static String idstring(String s)
  {
    return s;
  }
  static void printstring(String s)
  {
    System.out.printf("%s\n", idstring(s));
  }
  static void print_toto(toto t)
  {
    System.out.printf("%s = %d\n", t.s, t.v);
  }
  public static void main(String args[])
  {
    String[] tab = new String[2];
    for (int i = 0; i < 2; i++)
        tab[i] = idstring("chaine de test");
    for (int j = 0; j < 2; j++)
        printstring(idstring(tab[j]));
    toto a = new toto();
    a.s = "one";
    a.v = 1;
    print_toto(a);
  }
  
}



<|start_filename|>out/calc.cpp<|end_filename|>
#include <iostream>
#include <vector>
/*
La suite de fibonaci
*/

int fibo(int a, int b, int i) {
    int out_ = 0;
    int a2 = a;
    int b2 = b;
    for (int j = 0; j <= i + 1; j++)
    {
        std::cout << j;
        out_ += a2;
        int tmp = b2;
        b2 += a2;
        a2 = tmp;
    }
    return out_;
}

int main() {
    std::cout << fibo(1, 2, 4);
}



<|start_filename|>out/aaa_missing.cpp<|end_filename|>
#include <iostream>
#include <vector>
/*
  Ce test a été généré par Metalang.
*/

int result(int len, std::vector<int>& tab) {
    std::vector<bool> tab2( len, false );
    for (int i1 = 0; i1 < len; i1++)
    {
        std::cout << tab[i1] << " ";
        tab2[tab[i1]] = true;
    }
    std::cout << "\n";
    for (int i2 = 0; i2 < len; i2++)
        if (!tab2[i2])
            return i2;
    return -1;
}

int main() {
    int len;
    std::cin >> len;
    std::cout << len << "\n";
    std::vector<int> tab( len );
    for (int a = 0; a < len; a++)
    {
        std::cin >> tab[a];
    }
    std::cout << result(len, tab) << "\n";
}



<|start_filename|>out/euler19.cs<|end_filename|>
using System;

public class euler19
{
  static bool is_leap(int year)
  {
    return year % 400 == 0 || year % 100 != 0 && year % 4 == 0;
  }
  
  static int ndayinmonth(int month, int year)
  {
    if (month == 0)
        return 31;
    else if (month == 1)
        if (is_leap(year))
            return 29;
        else
            return 28;
    else if (month == 2)
        return 31;
    else if (month == 3)
        return 30;
    else if (month == 4)
        return 31;
    else if (month == 5)
        return 30;
    else if (month == 6)
        return 31;
    else if (month == 7)
        return 31;
    else if (month == 8)
        return 30;
    else if (month == 9)
        return 31;
    else if (month == 10)
        return 30;
    else if (month == 11)
        return 31;
    return 0;
  }
  
  public static void Main(String[] args)
  {
    int month = 0;
    int year = 1901;
    int dayofweek = 1;
    //  01-01-1901 : mardi 
    int count = 0;
    while (year != 2001)
    {
        int ndays = ndayinmonth(month, year);
        dayofweek = (dayofweek + ndays) % 7;
        month++;
        if (month == 12)
        {
            month = 0;
            year++;
        }
        if (dayofweek % 7 == 6)
            count++;
    }
    Console.Write(count + "\n");
  }
  
}



<|start_filename|>out/bigints.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
buffer =  ""
function readchar()
    if buffer == "" then buffer = io.read("*line") end
    local c = string.byte(buffer)
    buffer = string.sub(buffer, 2, -1)
    return c
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function read_bigint (len)
  local chiffres = {}
  for j = 0, len - 1 do
      local c = readchar()
      chiffres[j + 1] = c
  end
  for i = 0, trunc((len - 1) / 2) do
      local tmp = chiffres[i + 1]
      chiffres[i + 1] = chiffres[len - 1 - i + 1]
      chiffres[len - 1 - i + 1] = tmp
  end
  return {bigint_sign=true, bigint_len=len, bigint_chiffres=chiffres}
end

function print_bigint (a)
  if not(a.bigint_sign) then
      io.write(string.format("%c", 45))
  end
  for i = 0, a.bigint_len - 1 do
      io.write(a.bigint_chiffres[a.bigint_len - 1 - i + 1])
  end
end

function bigint_eq (a, b)
  --[[ Renvoie vrai si a = b --]]
  if a.bigint_sign ~= b.bigint_sign then
      return false
  elseif a.bigint_len ~= b.bigint_len then
      return false
  else 
      for i = 0, a.bigint_len - 1 do
          if a.bigint_chiffres[i + 1] ~= b.bigint_chiffres[i + 1] then
              return false
          end
      end
      return true
  end
end

function bigint_gt (a, b)
  --[[ Renvoie vrai si a > b --]]
  if a.bigint_sign and not(b.bigint_sign) then
      return true
  elseif not(a.bigint_sign) and b.bigint_sign then
      return false
  else 
      if a.bigint_len > b.bigint_len then
          return a.bigint_sign
      elseif a.bigint_len < b.bigint_len then
          return not(a.bigint_sign)
      else 
          for i = 0, a.bigint_len - 1 do
              local j = a.bigint_len - 1 - i
              if a.bigint_chiffres[j + 1] > b.bigint_chiffres[j + 1] then
                  return a.bigint_sign
              elseif a.bigint_chiffres[j + 1] < b.bigint_chiffres[j + 1] then
                  return not(a.bigint_sign)
              end
          end
      end
      return true
  end
end

function bigint_lt (a, b)
  return not(bigint_gt(a, b))
end

function add_bigint_positif (a, b)
  --[[ Une addition ou on en a rien a faire des signes --]]
  local len = math.max(a.bigint_len, b.bigint_len) + 1
  local retenue = 0
  local chiffres = {}
  for i = 0, len - 1 do
      local tmp = retenue
      if i < a.bigint_len then
          tmp = tmp + a.bigint_chiffres[i + 1]
      end
      if i < b.bigint_len then
          tmp = tmp + b.bigint_chiffres[i + 1]
      end
      retenue = trunc(tmp / 10)
      chiffres[i + 1] = math.fmod(tmp, 10)
  end
  while len > 0 and chiffres[len] == 0 do
      len = len - 1
  end
  return {bigint_sign=true, bigint_len=len, bigint_chiffres=chiffres}
end

function sub_bigint_positif (a, b)
  --[[ Une soustraction ou on en a rien a faire des signes
Pré-requis : a > b
--]]
  local len = a.bigint_len
  local retenue = 0
  local chiffres = {}
  for i = 0, len - 1 do
      local tmp = retenue + a.bigint_chiffres[i + 1]
      if i < b.bigint_len then
          tmp = tmp - b.bigint_chiffres[i + 1]
      end
      if tmp < 0 then
          tmp = tmp + 10
          retenue = -1
      else 
          retenue = 0
      end
      chiffres[i + 1] = tmp
  end
  while len > 0 and chiffres[len] == 0 do
      len = len - 1
  end
  return {bigint_sign=true, bigint_len=len, bigint_chiffres=chiffres}
end

function neg_bigint (a)
  return {bigint_sign=not(a.bigint_sign), bigint_len=a.bigint_len, bigint_chiffres=a.bigint_chiffres}
end

function add_bigint (a, b)
  if a.bigint_sign == b.bigint_sign then
      if a.bigint_sign then
          return add_bigint_positif(a, b)
      else 
          return neg_bigint(add_bigint_positif(a, b))
      end
  elseif a.bigint_sign then
      --[[ a positif, b negatif --]]
      if bigint_gt(a, neg_bigint(b)) then
          return sub_bigint_positif(a, b)
      else 
          return neg_bigint(sub_bigint_positif(b, a))
      end
  else 
      --[[ a negatif, b positif --]]
      if bigint_gt(neg_bigint(a), b) then
          return neg_bigint(sub_bigint_positif(a, b))
      else 
          return sub_bigint_positif(b, a)
      end
  end
end

function sub_bigint (a, b)
  return add_bigint(a, neg_bigint(b))
end

function mul_bigint_cp (a, b)
  --[[ Cet algorithm est quadratique.
C'est le même que celui qu'on enseigne aux enfants en CP.
D'ou le nom de la fonction. --]]
  local len = a.bigint_len + b.bigint_len + 1
  local chiffres = {}
  for k = 0, len - 1 do
      chiffres[k + 1] = 0
  end
  for i = 0, a.bigint_len - 1 do
      local retenue = 0
      for j = 0, b.bigint_len - 1 do
          chiffres[i + j + 1] = chiffres[i + j + 1] + retenue + b.bigint_chiffres[j + 1] * a.bigint_chiffres[i + 1]
          retenue = trunc(chiffres[i + j + 1] / 10)
          chiffres[i + j + 1] = math.fmod(chiffres[i + j + 1], 10)
      end
      chiffres[i + b.bigint_len + 1] = chiffres[i + b.bigint_len + 1] + retenue
  end
  chiffres[a.bigint_len + b.bigint_len + 1] = trunc(chiffres[a.bigint_len + b.bigint_len] / 10)
  chiffres[a.bigint_len + b.bigint_len] = math.fmod(chiffres[a.bigint_len + b.bigint_len], 10)
  for l = 0, 2 do
      if len ~= 0 and chiffres[len] == 0 then
          len = len - 1
      end
  end
  return {bigint_sign=a.bigint_sign == b.bigint_sign, bigint_len=len, bigint_chiffres=chiffres}
end

function bigint_premiers_chiffres (a, i)
  local len = math.min(i, a.bigint_len)
  while len ~= 0 and a.bigint_chiffres[len] == 0 do
      len = len - 1
  end
  return {bigint_sign=a.bigint_sign, bigint_len=len, bigint_chiffres=a.bigint_chiffres}
end

function bigint_shift (a, i)
  local chiffres = {}
  for k = 0, a.bigint_len + i - 1 do
      if k >= i then
          chiffres[k + 1] = a.bigint_chiffres[k - i + 1]
      else 
          chiffres[k + 1] = 0
      end
  end
  return {bigint_sign=a.bigint_sign, bigint_len=a.bigint_len + i, bigint_chiffres=chiffres}
end

function mul_bigint (aa, bb)
  if aa.bigint_len == 0 then
      return aa
  elseif bb.bigint_len == 0 then
      return bb
  elseif aa.bigint_len < 3 or bb.bigint_len < 3 then
      return mul_bigint_cp(aa, bb)
  end
  --[[ Algorithme de Karatsuba --]]
  local split = trunc(math.min(aa.bigint_len, bb.bigint_len) / 2)
  local a = bigint_shift(aa, -split)
  local b = bigint_premiers_chiffres(aa, split)
  local c = bigint_shift(bb, -split)
  local d = bigint_premiers_chiffres(bb, split)
  local amoinsb = sub_bigint(a, b)
  local cmoinsd = sub_bigint(c, d)
  local ac = mul_bigint(a, c)
  local bd = mul_bigint(b, d)
  local amoinsbcmoinsd = mul_bigint(amoinsb, cmoinsd)
  local acdec = bigint_shift(ac, 2 * split)
  return add_bigint(add_bigint(acdec, bd), bigint_shift(sub_bigint(add_bigint(ac, bd), amoinsbcmoinsd), split))
  --[[ ac × 102k + (ac + bd – (a – b)(c – d)) × 10k + bd --]]
end

--[[
Division,
Modulo
--]]

function log10 (a)
  local out0 = 1
  while a >= 10 do
      a = trunc(a / 10)
      out0 = out0 + 1
  end
  return out0
end

function bigint_of_int (i)
  local size = log10(i)
  if i == 0 then
      size = 0
  end
  local t = {}
  for j = 0, size - 1 do
      t[j + 1] = 0
  end
  for k = 0, size - 1 do
      t[k + 1] = math.fmod(i, 10)
      i = trunc(i / 10)
  end
  return {bigint_sign=true, bigint_len=size, bigint_chiffres=t}
end

function fact_bigint (a)
  local one = bigint_of_int(1)
  local out0 = one
  while not(bigint_eq(a, one)) do
      out0 = mul_bigint(a, out0)
      a = sub_bigint(a, one)
  end
  return out0
end

function sum_chiffres_bigint (a)
  local out0 = 0
  for i = 0, a.bigint_len - 1 do
      out0 = out0 + a.bigint_chiffres[i + 1]
  end
  return out0
end

--[[ http://projecteuler.net/problem=20 --]]

function euler20 ()
  local a = bigint_of_int(15)
  --[[ normalement c'est 100 --]]
  a = fact_bigint(a)
  return sum_chiffres_bigint(a)
end

function bigint_exp (a, b)
  if b == 1 then
      return a
  elseif math.fmod(b, 2) == 0 then
      return bigint_exp(mul_bigint(a, a), trunc(b / 2))
  else 
      return mul_bigint(a, bigint_exp(a, b - 1))
  end
end

function bigint_exp_10chiffres (a, b)
  a = bigint_premiers_chiffres(a, 10)
  if b == 1 then
      return a
  elseif math.fmod(b, 2) == 0 then
      return bigint_exp_10chiffres(mul_bigint(a, a), trunc(b / 2))
  else 
      return mul_bigint(a, bigint_exp_10chiffres(a, b - 1))
  end
end

function euler48 ()
  local sum = bigint_of_int(0)
  for i = 1, 100 do
      --[[ 1000 normalement --]]
      local ib = bigint_of_int(i)
      local ibeib = bigint_exp_10chiffres(ib, i)
      sum = add_bigint(sum, ibeib)
      sum = bigint_premiers_chiffres(sum, 10)
  end
  io.write("euler 48 = ")
  print_bigint(sum)
  io.write("\n")
end

function euler16 ()
  local a = bigint_of_int(2)
  a = bigint_exp(a, 100)
  --[[ 1000 normalement --]]
  return sum_chiffres_bigint(a)
end

function euler25 ()
  local i = 2
  local a = bigint_of_int(1)
  local b = bigint_of_int(1)
  while b.bigint_len < 100 do
      --[[ 1000 normalement --]]
      local c = add_bigint(a, b)
      a = b
      b = c
      i = i + 1
  end
  return i
end

function euler29 ()
  local maxA = 5
  local maxB = 5
  local a_bigint = {}
  for j = 0, maxA do
      a_bigint[j + 1] = bigint_of_int(j * j)
  end
  local a0_bigint = {}
  for j2 = 0, maxA do
      a0_bigint[j2 + 1] = bigint_of_int(j2)
  end
  local b = {}
  for k = 0, maxA do
      b[k + 1] = 2
  end
  local n = 0
  local found = true
  while found do
      local min0 = a0_bigint[1]
      found = false
      for i = 2, maxA do
          if b[i + 1] <= maxB then
              if found then
                  if bigint_lt(a_bigint[i + 1], min0) then
                      min0 = a_bigint[i + 1]
                  end
              else 
                  min0 = a_bigint[i + 1]
                  found = true
              end
          end
      end
      if found then
          n = n + 1
          for l = 2, maxA do
              if bigint_eq(a_bigint[l + 1], min0) and b[l + 1] <= maxB then
                  b[l + 1] = b[l + 1] + 1
                  a_bigint[l + 1] = mul_bigint(a_bigint[l + 1], a0_bigint[l + 1])
              end
          end
      end
  end
  return n
end

io.write(string.format("%d\n", euler29()))
local sum = read_bigint(50)
for i = 2, 100 do
    stdinsep()
    local tmp = read_bigint(50)
    sum = add_bigint(sum, tmp)
end
io.write("euler13 = ")
print_bigint(sum)
io.write(string.format("\neuler25 = %d\neuler16 = %d\n", euler25(), euler16()))
euler48()
io.write(string.format("euler20 = %d\n", euler20()))
local a = bigint_of_int(999999)
local b = bigint_of_int(9951263)
print_bigint(a)
io.write(">>1=")
print_bigint(bigint_shift(a, -1))
io.write("\n")
print_bigint(a)
io.write("*")
print_bigint(b)
io.write("=")
print_bigint(mul_bigint(a, b))
io.write("\n")
print_bigint(a)
io.write("*")
print_bigint(b)
io.write("=")
print_bigint(mul_bigint_cp(a, b))
io.write("\n")
print_bigint(a)
io.write("+")
print_bigint(b)
io.write("=")
print_bigint(add_bigint(a, b))
io.write("\n")
print_bigint(b)
io.write("-")
print_bigint(a)
io.write("=")
print_bigint(sub_bigint(b, a))
io.write("\n")
print_bigint(a)
io.write("-")
print_bigint(b)
io.write("=")
print_bigint(sub_bigint(a, b))
io.write("\n")
print_bigint(a)
io.write(">")
print_bigint(b)
io.write("=")
if bigint_gt(a, b) then
    io.write("True")
else 
    io.write("False")
end
io.write("\n")


<|start_filename|>out/str2.lua<|end_filename|>

io.write("ma petite chaine en or")


<|start_filename|>out/euler17.js<|end_filename|>
var util = require("util");

util.print(3 + 16, "\n");
var one_to_nine = 3 + 33;
util.print(one_to_nine, "\n");
var one_to_ten = one_to_nine + 3;
var one_to_twenty = one_to_ten + 73;
var one_to_thirty = one_to_twenty + 6 * 9 + one_to_nine + 6;
var one_to_forty = one_to_thirty + 6 * 9 + one_to_nine + 5;
var one_to_fifty = one_to_forty + 5 * 9 + one_to_nine + 5;
var one_to_sixty = one_to_fifty + 5 * 9 + one_to_nine + 5;
var one_to_seventy = one_to_sixty + 5 * 9 + one_to_nine + 7;
var one_to_eighty = one_to_seventy + 7 * 9 + one_to_nine + 6;
var one_to_ninety = one_to_eighty + 6 * 9 + one_to_nine + 6;
var one_to_ninety_nine = one_to_ninety + 6 * 9 + one_to_nine;
util.print(one_to_ninety_nine, "\n", 100 * one_to_nine + one_to_ninety_nine * 10 + 10 * 9 * 99 + 7 * 9 + 11, "\n");



<|start_filename|>out/euler50.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int min2_(int a, int b) {
    if (a < b)
        return a;
    else
        return b;
}

int eratostene(int* t, int max0) {
    int i;
    int n = 0;
    for (i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            if (max0 / i > i)
            {
                int j = i * i;
                while (j < max0 && j > 0)
                {
                    t[j] = 0;
                    j += i;
                }
            }
        }
    return n;
}
int main(void) {
    int i, i_, k, o, j;
    int maximumprimes = 1000001;
    int *era = calloc(maximumprimes, sizeof(int));
    for (j = 0; j < maximumprimes; j++)
        era[j] = j;
    int nprimes = eratostene(era, maximumprimes);
    int *primes = calloc(nprimes, sizeof(int));
    for (o = 0; o < nprimes; o++)
        primes[o] = 0;
    int l = 0;
    for (k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    printf("%d == %d\n", l, nprimes);
    int *sum = calloc(nprimes, sizeof(int));
    for (i_ = 0; i_ < nprimes; i_++)
        sum[i_] = primes[i_];
    int maxl = 0;
    int process = 1;
    int stop = maximumprimes - 1;
    int len = 1;
    int resp = 1;
    while (process)
    {
        process = 0;
        for (i = 0; i <= stop; i++)
            if (i + len < nprimes)
            {
                sum[i] += primes[i + len];
                if (maximumprimes > sum[i])
                {
                    process = 1;
                    if (era[sum[i]] == sum[i])
                    {
                        maxl = len;
                        resp = sum[i];
                    }
                }
                else
                    stop = min2_(stop, i);
            }
        len++;
    }
    printf("%d\n%d\n", resp, maxl);
    return 0;
}




<|start_filename|>out/euler03.js<|end_filename|>
var util = require("util");

var maximum = 1;
var b0 = 2;
var a = 408464633;
var sqrtia = Math.floor(Math.sqrt(a));
while (a != 1)
{
    var b = b0;
    var found = false;
    while (b <= sqrtia)
    {
        if (~~(a % b) == 0)
        {
            a = ~~(a / b);
            b0 = b;
            b = a;
            sqrtia = Math.floor(Math.sqrt(a));
            found = true;
        }
        b++;
    }
    if (!found)
    {
        util.print(a, "\n");
        a = 1;
    }
}



<|start_filename|>out/euler21.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler21 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function eratostene(t : in a_PTR; max0 : in Integer) return Integer is
  n : Integer;
  j : Integer;
begin
  n := 0;
  for i in integer range 2..max0 - 1 loop
    if t(i) = i
    then
      n := n + 1;
      j := i * i;
      while j < max0 and then j > 0 loop
        t(j) := 0;
        j := j + i;
      end loop;
    end if;
  end loop;
  return n;
end;
function fillPrimesFactors(t : in a_PTR; b : in Integer; primes : in a_PTR; nprimes : in Integer) return Integer is
  n : Integer;
  d : Integer;
begin
  n := b;
  for i in integer range 0..nprimes - 1 loop
    d := primes(i);
    while n rem d = 0 loop
      t(d) := t(d) + 1;
      n := n / d;
    end loop;
    if n = 1
    then
      return primes(i);
    end if;
  end loop;
  return n;
end;
function sumdivaux2(t : in a_PTR; n : in Integer; c : in Integer) return Integer is
  i : Integer;
begin
  i := c;
  while i < n and then t(i) = 0 loop
    i := i + 1;
  end loop;
  return i;
end;
function sumdivaux(t : in a_PTR; n : in Integer; i : in Integer) return Integer is
  p : Integer;
  out0 : Integer;
  o : Integer;
begin
  if i > n
  then
    return 1;
  else
    if t(i) = 0
    then
      return sumdivaux(t, n, sumdivaux2(t, n, i + 1));
    else
      o := sumdivaux(t, n, sumdivaux2(t, n, i + 1));
      out0 := 0;
      p := i;
      for j in integer range 1..t(i) loop
        out0 := out0 + p;
        p := p * i;
      end loop;
      return (out0 + 1) * o;
    end if;
  end if;
end;
function sumdiv(nprimes : in Integer; primes : in a_PTR; n : in Integer) return Integer is
  t : a_PTR;
  max0 : Integer;
begin
  t := new a (0..n);
  for i in integer range 0..n loop
    t(i) := 0;
  end loop;
  max0 := fillPrimesFactors(t, n, primes, nprimes);
  return sumdivaux(t, max0, 0);
end;

  sum : Integer;
  primes : a_PTR;
  othersum : Integer;
  other : Integer;
  nprimes : Integer;
  maximumprimes : Integer;
  l : Integer;
  era : a_PTR;
begin
  maximumprimes := 1001;
  era := new a (0..maximumprimes - 1);
  for j in integer range 0..maximumprimes - 1 loop
    era(j) := j;
  end loop;
  nprimes := eratostene(era, maximumprimes);
  primes := new a (0..nprimes - 1);
  for o in integer range 0..nprimes - 1 loop
    primes(o) := 0;
  end loop;
  l := 0;
  for k in integer range 2..maximumprimes - 1 loop
    if era(k) = k
    then
      primes(l) := k;
      l := l + 1;
    end if;
  end loop;
  PInt(l);
  PString(new char_array'( To_C(" == ")));
  PInt(nprimes);
  PString(new char_array'( To_C("" & Character'Val(10))));
  sum := 0;
  for n in integer range 2..1000 loop
    other := sumdiv(nprimes, primes, n) - n;
    if other > n
    then
      othersum := sumdiv(nprimes, primes, other) - other;
      if othersum = n
      then
        PInt(other);
        PString(new char_array'( To_C(" & ")));
        PInt(n);
        PString(new char_array'( To_C("" & Character'Val(10))));
        sum := sum + other + n;
      end if;
    end if;
  end loop;
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(sum);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler12.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function eratostene (t, max0)
  local n = 0
  for i = 2, max0 - 1 do
      if t[i + 1] == i then
          local j = i * i
          n = n + 1
          while j < max0 and j > 0 do
              t[j + 1] = 0
              j = j + i
          end
      end
  end
  return n
end

function fillPrimesFactors (t, n, primes, nprimes)
  for i = 0, nprimes - 1 do
      local d = primes[i + 1]
      while math.fmod(n, d) == 0 do
          t[d + 1] = t[d + 1] + 1
          n = trunc(n / d)
      end
      if n == 1 then
          return primes[i + 1]
      end
  end
  return n
end

function find (ndiv2)
  local maximumprimes = 110
  local era = {}
  for j = 0, maximumprimes - 1 do
      era[j + 1] = j
  end
  local nprimes = eratostene(era, maximumprimes)
  local primes = {}
  for o = 0, nprimes - 1 do
      primes[o + 1] = 0
  end
  local l = 0
  for k = 2, maximumprimes - 1 do
      if era[k + 1] == k then
          primes[l + 1] = k
          l = l + 1
      end
  end
  for n = 1, 10000 do
      local primesFactors = {}
      for m = 0, n + 1 do
          primesFactors[m + 1] = 0
      end
      local max0 = math.max(fillPrimesFactors(primesFactors, n, primes, nprimes), fillPrimesFactors(primesFactors, n + 1, primes, nprimes))
      primesFactors[3] = primesFactors[3] - 1
      local ndivs = 1
      for i = 0, max0 do
          if primesFactors[i + 1] ~= 0 then
              ndivs = ndivs * (1 + primesFactors[i + 1])
          end
      end
      if ndivs > ndiv2 then
          return trunc(n * (n + 1) / 2)
      end
      --[[ print "n=" print n print "\t" print (n * (n + 1) / 2 ) print " " print ndivs print "\n" --]]
  end
  return 0
end

io.write(string.format("%d\n", find(500)))


<|start_filename|>out/euler28.java<|end_filename|>
import java.util.*;

public class euler28
{
  
  /*

43 44 45 46 47 48 49
42 21 22 23 24 25 26
41 20  7  8  9 10 27
40 19  6  1  2 11 28
39 18  5  4  3 12 29
38 17 16 15 14 13 30
37 36 35 34 33 32 31

1 3 5 7 9 13 17 21 25 31 37 43 49
  2 2 2 2 4  4  4  4  6   6  6  6


*/
  static int sumdiag(int n)
  {
    int nterms = n * 2 - 1;
    int un = 1;
    int sum = 1;
    for (int i = 0; i < nterms - 1; i++)
    {
        int d = 2 * (1 + i / 4);
        un += d;
        //  print int d print "=>" print un print " " 
        sum += un;
    }
    return sum;
  }
  public static void main(String args[])
  {
    System.out.print(sumdiag(1001));
  }
  
}



<|start_filename|>out/aaa_read.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
main =
  do len <- read_int
     skip_whitespaces
     printf "%d=len\n" (len::Int) :: IO()
     let a = len * 2
     printf "len*2=%d\n" (a::Int) :: IO()
     let b = a `quot` 2
     tab <- array_init b (\ i ->
                            do tmpi1 <- read_int
                               skip_whitespaces
                               printf "%d=>%d " (i::Int) (tmpi1::Int) :: IO()
                               return tmpi1)
     printf "\n" :: IO ()
     tab2 <- array_init b (\ i_ ->
                             do tmpi2 <- read_int
                                skip_whitespaces
                                printf "%d==>%d " (i_::Int) (tmpi2::Int) :: IO()
                                return tmpi2)
     strlen <- read_int
     skip_whitespaces
     printf "%d=strlen\n" (strlen::Int) :: IO()
     tab4 <- array_init strlen (\ toto ->
                                  do tmpc <- getChar
                                     let c = (ord tmpc)
                                     printf "%c:%d " (tmpc::Char) (c::Int) :: IO()
                                     let e = if tmpc /= ' '
                                             then ((c - (ord 'a') + 13) `rem` 26) + (ord 'a')
                                             else c
                                     return (chr e))
     let d j =
           if j <= strlen - 1
           then do printf "%c" =<< (readIOA tab4 j :: IO Char)
                   d (j + 1)
           else return () in
           d 0




<|start_filename|>out/aaa_021if.cpp<|end_filename|>
#include <iostream>
#include <vector>

void testA(bool a, bool b) {
    if (a)
        if (b)
            std::cout << "A";
        else
            std::cout << "B";
    else if (b)
        std::cout << "C";
    else
        std::cout << "D";
}


void testB(bool a, bool b) {
    if (a)
        std::cout << "A";
    else if (b)
        std::cout << "B";
    else
        std::cout << "C";
}


void testC(bool a, bool b) {
    if (a)
        if (b)
            std::cout << "A";
        else
            std::cout << "B";
    else
        std::cout << "C";
}


void testD(bool a, bool b) {
    if (a)
    {
        if (b)
            std::cout << "A";
        else
            std::cout << "B";
        std::cout << "C";
    }
    else
        std::cout << "D";
}


void testE(bool a, bool b) {
    if (a)
    {
        if (b)
            std::cout << "A";
    }
    else
    {
        if (b)
            std::cout << "C";
        else
            std::cout << "D";
        std::cout << "E";
    }
}


void test(bool a, bool b) {
    testD(a, b);
    testE(a, b);
    std::cout << "\n";
}

int main() {
    test(true, true);
    test(true, false);
    test(false, true);
    test(false, false);
}



<|start_filename|>out/ocaml01.go<|end_filename|>
package main
func foo() int{
  for i := 0; i < 11; i++ {
      
  }
  return 0
}
func bar() int{
  for i := 0; i < 11; i++ {
      a := 0
      _ = a
  }
  return 0
}
func main() {
  
}



<|start_filename|>out/calc.groovy<|end_filename|>
import java.util.*

/*
La suite de fibonaci
*/
int fibo(int a, int b, int i)
{
  int out_ = 0
  int a2 = a
  int b2 = b
  for (int j = 0; j <= i + 1; j++)
  {
      print(j)
      out_ += a2
      int tmp = b2
      b2 += a2
      a2 = tmp
  }
  return out_
}

print(fibo(1, 2, 4))



<|start_filename|>out/euler30.cpp<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    /*
a + b * 10 + c * 100 + d * 1000 + e * 10 000 =
  a ^ 5 +
  b ^ 5 +
  c ^ 5 +
  d ^ 5 +
  e ^ 5
*/
    std::vector<int> p( 10 );
    for (int i = 0; i < 10; i++)
        p[i] = i * i * i * i * i;
    int sum = 0;
    for (int a = 0; a < 10; a++)
        for (int b = 0; b < 10; b++)
            for (int c = 0; c < 10; c++)
                for (int d = 0; d < 10; d++)
                    for (int e = 0; e < 10; e++)
                        for (int f = 0; f < 10; f++)
                        {
                            int s = p[a] + p[b] + p[c] + p[d] + p[e] + p[f];
                            int r = a + b * 10 + c * 100 + d * 1000 + e * 10000 + f * 100000;
                            if (s == r && r != 1)
                            {
                                std::cout << f << e << d << c << b << a << " " << r << "\n";
                                sum += r;
                            }
                        }
    std::cout << sum;
}



<|start_filename|>out/euler02.cs<|end_filename|>
using System;

public class euler02
{
  
  public static void Main(String[] args)
  {
    int a = 1;
    int b = 2;
    int sum = 0;
    while (a < 4000000)
    {
        if (a % 2 == 0)
            sum += a;
        int c = a;
        a = b;
        b += c;
    }
    Console.Write(sum + "\n");
  }
  
}



<|start_filename|>out/devine.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure devine is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function devine0(nombre : in Integer; tab : in a_PTR; len : in Integer) return Boolean is
  min0 : Integer;
  max0 : Integer;
begin
  min0 := tab(0);
  max0 := tab(1);
  for i in integer range 2..len - 1 loop
    if tab(i) > max0 or else tab(i) < min0
    then
      return FALSE;
    end if;
    if tab(i) < nombre
    then
      min0 := tab(i);
    end if;
    if tab(i) > nombre
    then
      max0 := tab(i);
    end if;
    if tab(i) = nombre and then len /= i + 1
    then
      return FALSE;
    end if;
  end loop;
  return TRUE;
end;

  tmp : Integer;
  tab : a_PTR;
  nombre : Integer;
  len : Integer;
begin
  Get(nombre);
  SkipSpaces;
  Get(len);
  SkipSpaces;
  tab := new a (0..len - 1);
  for i in integer range 0..len - 1 loop
    Get(tmp);
    SkipSpaces;
    tab(i) := tmp;
  end loop;
  if devine0(nombre, tab, len)
  then
    PString(new char_array'( To_C("True")));
  else
    PString(new char_array'( To_C("False")));
  end if;
end;


<|start_filename|>out/pathfindList.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int pathfind_aux(int[] cache, int[] tab, int len, int pos)
{
  if (pos >= len - 1)
      return 0
  else if (cache[pos] != -1)
      return cache[pos]
  else
  {
      cache[pos] = len * 2
      int posval = pathfind_aux(cache, tab, len, tab[pos])
      int oneval = pathfind_aux(cache, tab, len, pos + 1)
      int out0 = 0
      if (posval < oneval)
          out0 = 1 + posval
      else
          out0 = 1 + oneval
      cache[pos] = out0
      return out0
  }
}
int pathfind(int[] tab, int len)
{
  int[] cache = new int[len]
  for (int i = 0; i < len; i++)
      cache[i] = -1
  return pathfind_aux(cache, tab, len, 0)
}
@Field Scanner scanner = new Scanner(System.in)
int len = 0
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  len = -scanner.nextInt()
}else{
  len = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
int[] tab = new int[len]
for (int i = 0; i < len; i++)
{
    int tmp = 0
    if (scanner.hasNext("^-")) {
      scanner.next("^-")
      tmp = -scanner.nextInt()
    }else{
      tmp = scanner.nextInt()
    }
    scanner.findWithinHorizon("[\n\r ]*", 1)
    tab[i] = tmp
}
int result = pathfind(tab, len)
print(result)



<|start_filename|>out/sumDiv.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


void foo() {
    int a = 0;
    /* test */
    a++;
    /* test 2 */
}

void foo2() {
    
}

void foo3() {
    if (1 == 1)
    {
        
    }
}

int sumdiv(int n) {
    int i;
    /* On désire renvoyer la somme des diviseurs */
    int out0 = 0;
    /* On déclare un entier qui contiendra la somme */
    for (i = 1; i <= n; i++)
        /* La boucle : i est le diviseur potentiel*/
        if (n % i == 0)
        {
            /* Si i divise */
            out0 += i;
            /* On incrémente */
        }
        else
        {
            /* nop */
        }
    return out0;
    /*On renvoie out*/
}
int main(void) {
    /* Programme principal */
    int n = 0;
    scanf("%d", &n);
    /* Lecture de l'entier */
    printf("%d", sumdiv(n));
    return 0;
}




<|start_filename|>out/min3.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
main =
  printf "%d %d %d %d %d %d\n" ((min (min 2 3) 4)::Int) ((min (min 2 4) 3)::Int) ((min (min 3 2) 4)::Int) ((min (min 3 4) 2)::Int) ((min (min 4 2) 3)::Int) ((min (min 4 3) 2)::Int) :: IO()




<|start_filename|>out/bigints.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure bigints is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PChar(c : in Character) is
begin
  Character'Write (Text_Streams.Stream (Current_Output), c);
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
function max2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a > b
  then
    return a;
  else
    return b;
  end if;
end;
function min2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a < b
  then
    return a;
  else
    return b;
  end if;
end;
type bigint;
type bigint_PTR is access bigint;
type r is Array (Integer range <>) of Integer;
type r_PTR is access r;
type bigint is record
  bigint_sign : Boolean;
  bigint_len : Integer;
  bigint_chiffres : r_PTR;
end record;
function read_bigint(len : in Integer) return bigint_PTR is
  tmp : Integer;
  e : bigint_PTR;
  chiffres : r_PTR;
  c : Character;
begin
  chiffres := new r (0..len - 1);
  for j in integer range 0..len - 1 loop
    Get(c);
    chiffres(j) := Character'Pos(c);
  end loop;
  for i in integer range 0..(len - 1) / 2 loop
    tmp := chiffres(i);
    chiffres(i) := chiffres(len - 1 - i);
    chiffres(len - 1 - i) := tmp;
  end loop;
  e := new bigint;
  e.bigint_sign := TRUE;
  e.bigint_len := len;
  e.bigint_chiffres := chiffres;
  return e;
end;
procedure print_bigint(a : in bigint_PTR) is
begin
  if not a.bigint_sign
  then
    PChar('-');
  end if;
  for i in integer range 0..a.bigint_len - 1 loop
    PInt(a.bigint_chiffres(a.bigint_len - 1 - i));
  end loop;
end;
function bigint_eq(a : in bigint_PTR; b : in bigint_PTR) return Boolean is
begin
  -- Renvoie vrai si a = b 
  
  if a.bigint_sign /= b.bigint_sign
  then
    return FALSE;
  else
    if a.bigint_len /= b.bigint_len
    then
      return FALSE;
    else
      for i in integer range 0..a.bigint_len - 1 loop
        if a.bigint_chiffres(i) /= b.bigint_chiffres(i)
        then
          return FALSE;
        end if;
      end loop;
      return TRUE;
    end if;
  end if;
end;
function bigint_gt(a : in bigint_PTR; b : in bigint_PTR) return Boolean is
  j : Integer;
begin
  -- Renvoie vrai si a > b 
  
  if a.bigint_sign and then not b.bigint_sign
  then
    return TRUE;
  else
    if not a.bigint_sign and then b.bigint_sign
    then
      return FALSE;
    else
      if a.bigint_len > b.bigint_len
      then
        return a.bigint_sign;
      else
        if a.bigint_len < b.bigint_len
        then
          return not a.bigint_sign;
        else
          for i in integer range 0..a.bigint_len - 1 loop
            j := a.bigint_len - 1 - i;
            if a.bigint_chiffres(j) > b.bigint_chiffres(j)
            then
              return a.bigint_sign;
            else
              if a.bigint_chiffres(j) < b.bigint_chiffres(j)
              then
                return not a.bigint_sign;
              end if;
            end if;
          end loop;
        end if;
      end if;
      return TRUE;
    end if;
  end if;
end;
function bigint_lt(a : in bigint_PTR; b : in bigint_PTR) return Boolean is
begin
  return not bigint_gt(a, b);
end;
function add_bigint_positif(a : in bigint_PTR; b : in bigint_PTR) return bigint_PTR is
  tmp : Integer;
  retenue : Integer;
  len : Integer;
  f : bigint_PTR;
  chiffres : r_PTR;
begin
  -- Une addition ou on en a rien a faire des signes 
  
  len := max2_0(a.bigint_len, b.bigint_len) + 1;
  retenue := 0;
  chiffres := new r (0..len - 1);
  for i in integer range 0..len - 1 loop
    tmp := retenue;
    if i < a.bigint_len
    then
      tmp := tmp + a.bigint_chiffres(i);
    end if;
    if i < b.bigint_len
    then
      tmp := tmp + b.bigint_chiffres(i);
    end if;
    retenue := tmp / 10;
    chiffres(i) := tmp rem 10;
  end loop;
  while len > 0 and then chiffres(len - 1) = 0 loop
    len := len - 1;
  end loop;
  f := new bigint;
  f.bigint_sign := TRUE;
  f.bigint_len := len;
  f.bigint_chiffres := chiffres;
  return f;
end;
function sub_bigint_positif(a : in bigint_PTR; b : in bigint_PTR) return bigint_PTR is
  tmp : Integer;
  retenue : Integer;
  len : Integer;
  g : bigint_PTR;
  chiffres : r_PTR;
begin
  -- Une soustraction ou on en a rien a faire des signes
  --Pré-requis : a > b
  --
  
  len := a.bigint_len;
  retenue := 0;
  chiffres := new r (0..len - 1);
  for i in integer range 0..len - 1 loop
    tmp := retenue + a.bigint_chiffres(i);
    if i < b.bigint_len
    then
      tmp := tmp - b.bigint_chiffres(i);
    end if;
    if tmp < 0
    then
      tmp := tmp + 10;
      retenue := (-1);
    else
      retenue := 0;
    end if;
    chiffres(i) := tmp;
  end loop;
  while len > 0 and then chiffres(len - 1) = 0 loop
    len := len - 1;
  end loop;
  g := new bigint;
  g.bigint_sign := TRUE;
  g.bigint_len := len;
  g.bigint_chiffres := chiffres;
  return g;
end;
function neg_bigint(a : in bigint_PTR) return bigint_PTR is
  h : bigint_PTR;
begin
  h := new bigint;
  h.bigint_sign := not a.bigint_sign;
  h.bigint_len := a.bigint_len;
  h.bigint_chiffres := a.bigint_chiffres;
  return h;
end;
function add_bigint(a : in bigint_PTR; b : in bigint_PTR) return bigint_PTR is
begin
  if a.bigint_sign = b.bigint_sign
  then
    if a.bigint_sign
    then
      return add_bigint_positif(a, b);
    else
      return neg_bigint(add_bigint_positif(a, b));
    end if;
  else
    if a.bigint_sign
    then
      -- a positif, b negatif 
      
      if bigint_gt(a, neg_bigint(b))
      then
        return sub_bigint_positif(a, b);
      else
        return neg_bigint(sub_bigint_positif(b, a));
      end if;
    else
      -- a negatif, b positif 
      
      if bigint_gt(neg_bigint(a), b)
      then
        return neg_bigint(sub_bigint_positif(a, b));
      else
        return sub_bigint_positif(b, a);
      end if;
    end if;
  end if;
end;
function sub_bigint(a : in bigint_PTR; b : in bigint_PTR) return bigint_PTR is
begin
  return add_bigint(a, neg_bigint(b));
end;
function mul_bigint_cp(a : in bigint_PTR; b : in bigint_PTR) return bigint_PTR is
  retenue : Integer;
  m : bigint_PTR;
  len : Integer;
  chiffres : r_PTR;
begin
  -- Cet algorithm est quadratique.
  --C'est le même que celui qu'on enseigne aux enfants en CP.
  --D'ou le nom de la fonction. 
  
  len := a.bigint_len + b.bigint_len + 1;
  chiffres := new r (0..len - 1);
  for k in integer range 0..len - 1 loop
    chiffres(k) := 0;
  end loop;
  for i in integer range 0..a.bigint_len - 1 loop
    retenue := 0;
    for j in integer range 0..b.bigint_len - 1 loop
      chiffres(i + j) := chiffres(i + j) + retenue + b.bigint_chiffres(j) * a.bigint_chiffres(i);
      retenue := chiffres(i + j) / 10;
      chiffres(i + j) := chiffres(i + j) rem 10;
    end loop;
    chiffres(i + b.bigint_len) := chiffres(i + b.bigint_len) + retenue;
  end loop;
  chiffres(a.bigint_len + b.bigint_len) := chiffres(a.bigint_len + b.bigint_len - 1) / 10;
  chiffres(a.bigint_len + b.bigint_len - 1) := chiffres(a.bigint_len + b.bigint_len - 1) rem 10;
  for l in integer range 0..2 loop
    if len /= 0 and then chiffres(len - 1) = 0
    then
      len := len - 1;
    end if;
  end loop;
  m := new bigint;
  m.bigint_sign := a.bigint_sign = b.bigint_sign;
  m.bigint_len := len;
  m.bigint_chiffres := chiffres;
  return m;
end;
function bigint_premiers_chiffres(a : in bigint_PTR; i : in Integer) return bigint_PTR is
  o : bigint_PTR;
  len : Integer;
begin
  len := min2_0(i, a.bigint_len);
  while len /= 0 and then a.bigint_chiffres(len - 1) = 0 loop
    len := len - 1;
  end loop;
  o := new bigint;
  o.bigint_sign := a.bigint_sign;
  o.bigint_len := len;
  o.bigint_chiffres := a.bigint_chiffres;
  return o;
end;
function bigint_shift(a : in bigint_PTR; i : in Integer) return bigint_PTR is
  p : bigint_PTR;
  chiffres : r_PTR;
begin
  chiffres := new r (0..a.bigint_len + i - 1);
  for k in integer range 0..a.bigint_len + i - 1 loop
    if k >= i
    then
      chiffres(k) := a.bigint_chiffres(k - i);
    else
      chiffres(k) := 0;
    end if;
  end loop;
  p := new bigint;
  p.bigint_sign := a.bigint_sign;
  p.bigint_len := a.bigint_len + i;
  p.bigint_chiffres := chiffres;
  return p;
end;
function mul_bigint(aa : in bigint_PTR; bb : in bigint_PTR) return bigint_PTR is
  split : Integer;
  d : bigint_PTR;
  cmoinsd : bigint_PTR;
  c : bigint_PTR;
  bd : bigint_PTR;
  b : bigint_PTR;
  amoinsbcmoinsd : bigint_PTR;
  amoinsb : bigint_PTR;
  acdec : bigint_PTR;
  ac : bigint_PTR;
  a : bigint_PTR;
begin
  if aa.bigint_len = 0
  then
    return aa;
  else
    if bb.bigint_len = 0
    then
      return bb;
    else
      if aa.bigint_len < 3 or else bb.bigint_len < 3
      then
        return mul_bigint_cp(aa, bb);
      end if;
    end if;
  end if;
  -- Algorithme de Karatsuba 
  
  split := min2_0(aa.bigint_len, bb.bigint_len) / 2;
  a := bigint_shift(aa, (-split));
  b := bigint_premiers_chiffres(aa, split);
  c := bigint_shift(bb, (-split));
  d := bigint_premiers_chiffres(bb, split);
  amoinsb := sub_bigint(a, b);
  cmoinsd := sub_bigint(c, d);
  ac := mul_bigint(a, c);
  bd := mul_bigint(b, d);
  amoinsbcmoinsd := mul_bigint(amoinsb, cmoinsd);
  acdec := bigint_shift(ac, 2 * split);
  return add_bigint(add_bigint(acdec, bd), bigint_shift(sub_bigint(add_bigint(ac, bd), amoinsbcmoinsd), split));
  -- ac × 102k + (ac + bd – (a – b)(c – d)) × 10k + bd 
  
end;
--
--Division,
--Modulo
--

function log10(s : in Integer) return Integer is
  out0 : Integer;
  a : Integer;
begin
  a := s;
  out0 := 1;
  while a >= 10 loop
    a := a / 10;
    out0 := out0 + 1;
  end loop;
  return out0;
end;
function bigint_of_int(u : in Integer) return bigint_PTR is
  t : r_PTR;
  size : Integer;
  q : bigint_PTR;
  i : Integer;
begin
  i := u;
  size := log10(i);
  if i = 0
  then
    size := 0;
  end if;
  t := new r (0..size - 1);
  for j in integer range 0..size - 1 loop
    t(j) := 0;
  end loop;
  for k in integer range 0..size - 1 loop
    t(k) := i rem 10;
    i := i / 10;
  end loop;
  q := new bigint;
  q.bigint_sign := TRUE;
  q.bigint_len := size;
  q.bigint_chiffres := t;
  return q;
end;
function fact_bigint(v : in bigint_PTR) return bigint_PTR is
  out0 : bigint_PTR;
  one : bigint_PTR;
  a : bigint_PTR;
begin
  a := v;
  one := bigint_of_int(1);
  out0 := one;
  while not bigint_eq(a, one) loop
    out0 := mul_bigint(a, out0);
    a := sub_bigint(a, one);
  end loop;
  return out0;
end;
function sum_chiffres_bigint(a : in bigint_PTR) return Integer is
  out0 : Integer;
begin
  out0 := 0;
  for i in integer range 0..a.bigint_len - 1 loop
    out0 := out0 + a.bigint_chiffres(i);
  end loop;
  return out0;
end;
-- http://projecteuler.net/problem=20 

function euler20 return Integer is
  a : bigint_PTR;
begin
  a := bigint_of_int(15);
  -- normalement c'est 100 
  
  a := fact_bigint(a);
  return sum_chiffres_bigint(a);
end;
function bigint_exp(a : in bigint_PTR; b : in Integer) return bigint_PTR is
begin
  if b = 1
  then
    return a;
  else
    if b rem 2 = 0
    then
      return bigint_exp(mul_bigint(a, a), b / 2);
    else
      return mul_bigint(a, bigint_exp(a, b - 1));
    end if;
  end if;
end;
function bigint_exp_10chiffres(w : in bigint_PTR; b : in Integer) return bigint_PTR is
  a : bigint_PTR;
begin
  a := w;
  a := bigint_premiers_chiffres(a, 10);
  if b = 1
  then
    return a;
  else
    if b rem 2 = 0
    then
      return bigint_exp_10chiffres(mul_bigint(a, a), b / 2);
    else
      return mul_bigint(a, bigint_exp_10chiffres(a, b - 1));
    end if;
  end if;
end;
procedure euler48 is
  sum : bigint_PTR;
  ibeib : bigint_PTR;
  ib : bigint_PTR;
begin
  sum := bigint_of_int(0);
  for i in integer range 1..100 loop
    -- 1000 normalement 
    
    ib := bigint_of_int(i);
    ibeib := bigint_exp_10chiffres(ib, i);
    sum := add_bigint(sum, ibeib);
    sum := bigint_premiers_chiffres(sum, 10);
  end loop;
  PString(new char_array'( To_C("euler 48 = ")));
  print_bigint(sum);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;
function euler16 return Integer is
  a : bigint_PTR;
begin
  a := bigint_of_int(2);
  a := bigint_exp(a, 100);
  -- 1000 normalement 
  
  return sum_chiffres_bigint(a);
end;
function euler25 return Integer is
  i : Integer;
  c : bigint_PTR;
  b : bigint_PTR;
  a : bigint_PTR;
begin
  i := 2;
  a := bigint_of_int(1);
  b := bigint_of_int(1);
  while b.bigint_len < 100 loop
    -- 1000 normalement 
    
    c := add_bigint(a, b);
    a := b;
    b := c;
    i := i + 1;
  end loop;
  return i;
end;
type x is Array (Integer range <>) of bigint_PTR;
type x_PTR is access x;
function euler29 return Integer is
  n : Integer;
  min0 : bigint_PTR;
  maxB : Integer;
  maxA : Integer;
  found : Boolean;
  b : r_PTR;
  a_bigint : x_PTR;
  a0_bigint : x_PTR;
begin
  maxA := 5;
  maxB := 5;
  a_bigint := new x (0..maxA);
  for j in integer range 0..maxA loop
    a_bigint(j) := bigint_of_int(j * j);
  end loop;
  a0_bigint := new x (0..maxA);
  for j2 in integer range 0..maxA loop
    a0_bigint(j2) := bigint_of_int(j2);
  end loop;
  b := new r (0..maxA);
  for k in integer range 0..maxA loop
    b(k) := 2;
  end loop;
  n := 0;
  found := TRUE;
  while found loop
    min0 := a0_bigint(0);
    found := FALSE;
    for i in integer range 2..maxA loop
      if b(i) <= maxB
      then
        if found
        then
          if bigint_lt(a_bigint(i), min0)
          then
            min0 := a_bigint(i);
          end if;
        else
          min0 := a_bigint(i);
          found := TRUE;
        end if;
      end if;
    end loop;
    if found
    then
      n := n + 1;
      for l in integer range 2..maxA loop
        if bigint_eq(a_bigint(l), min0) and then b(l) <= maxB
        then
          b(l) := b(l) + 1;
          a_bigint(l) := mul_bigint(a_bigint(l), a0_bigint(l));
        end if;
      end loop;
    end if;
  end loop;
  return n;
end;

  tmp : bigint_PTR;
  sum : bigint_PTR;
  b : bigint_PTR;
  a : bigint_PTR;
begin
  PInt(euler29);
  PString(new char_array'( To_C("" & Character'Val(10))));
  sum := read_bigint(50);
  for i in integer range 2..100 loop
    SkipSpaces;
    tmp := read_bigint(50);
    sum := add_bigint(sum, tmp);
  end loop;
  PString(new char_array'( To_C("euler13 = ")));
  print_bigint(sum);
  PString(new char_array'( To_C("" & Character'Val(10) & "euler25 = ")));
  PInt(euler25);
  PString(new char_array'( To_C("" & Character'Val(10) & "euler16 = ")));
  PInt(euler16);
  PString(new char_array'( To_C("" & Character'Val(10))));
  euler48;
  PString(new char_array'( To_C("euler20 = ")));
  PInt(euler20);
  PString(new char_array'( To_C("" & Character'Val(10))));
  a := bigint_of_int(999999);
  b := bigint_of_int(9951263);
  print_bigint(a);
  PString(new char_array'( To_C(">>1=")));
  print_bigint(bigint_shift(a, (-1)));
  PString(new char_array'( To_C("" & Character'Val(10))));
  print_bigint(a);
  PString(new char_array'( To_C("*")));
  print_bigint(b);
  PString(new char_array'( To_C("=")));
  print_bigint(mul_bigint(a, b));
  PString(new char_array'( To_C("" & Character'Val(10))));
  print_bigint(a);
  PString(new char_array'( To_C("*")));
  print_bigint(b);
  PString(new char_array'( To_C("=")));
  print_bigint(mul_bigint_cp(a, b));
  PString(new char_array'( To_C("" & Character'Val(10))));
  print_bigint(a);
  PString(new char_array'( To_C("+")));
  print_bigint(b);
  PString(new char_array'( To_C("=")));
  print_bigint(add_bigint(a, b));
  PString(new char_array'( To_C("" & Character'Val(10))));
  print_bigint(b);
  PString(new char_array'( To_C("-")));
  print_bigint(a);
  PString(new char_array'( To_C("=")));
  print_bigint(sub_bigint(b, a));
  PString(new char_array'( To_C("" & Character'Val(10))));
  print_bigint(a);
  PString(new char_array'( To_C("-")));
  print_bigint(b);
  PString(new char_array'( To_C("=")));
  print_bigint(sub_bigint(a, b));
  PString(new char_array'( To_C("" & Character'Val(10))));
  print_bigint(a);
  PString(new char_array'( To_C(">")));
  print_bigint(b);
  PString(new char_array'( To_C("=")));
  if bigint_gt(a, b)
  then
    PString(new char_array'( To_C("True")));
  else
    PString(new char_array'( To_C("False")));
  end if;
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler04.java<|end_filename|>
import java.util.*;

public class euler04
{
  
  /*

(a + b * 10 + c * 100) * (d + e * 10 + f * 100) =
a * d + a * e * 10 + a * f * 100 +
10 * (b * d + b * e * 10 + b * f * 100)+
100 * (c * d + c * e * 10 + c * f * 100) =

a * d       + a * e * 10   + a * f * 100 +
b * d * 10  + b * e * 100  + b * f * 1000 +
c * d * 100 + c * e * 1000 + c * f * 10000 =

a * d +
10 * ( a * e + b * d) +
100 * (a * f + b * e + c * d) +
(c * e + b * f) * 1000 +
c * f * 10000

*/
  static int chiffre(int c, int m)
  {
    if (c == 0)
        return m % 10;
    else
        return chiffre(c - 1, m / 10);
  }
  public static void main(String args[])
  {
    int m = 1;
    for (int a = 0; a < 10; a++)
        for (int f = 1; f < 10; f++)
            for (int d = 0; d < 10; d++)
                for (int c = 1; c < 10; c++)
                    for (int b = 0; b < 10; b++)
                        for (int e = 0; e < 10; e++)
                        {
                            int mul = a * d + 10 * (a * e + b * d) + 100 * (a * f + b * e + c * d) + 1000 * (c * e + b * f) + 10000 * c * f;
                            if (chiffre(0, mul) == chiffre(5, mul) && chiffre(1, mul) == chiffre(4, mul) && chiffre(2, mul) == chiffre(3, mul))
                                m = Math.max(mul, m);
                        }
    System.out.printf("%d\n", m);
  }
  
}



<|start_filename|>out/record3.cs<|end_filename|>
using System;

public class record3
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static void stdin_sep(){
  do{
    if (eof) return;
    char c = readChar_();
    if (c == ' ' || c == '\n' || c == '\t' || c == '\r'){
      consommeChar();
    }else{
      return;
    }
  } while(true);
}
static int readInt(){
  int i = 0;
  char s = readChar_();
  int sign = 1;
  if (s == '-'){
    sign = -1;
    consommeChar();
  }
  do{
    char c = readChar_();
    if (c <= '9' && c >= '0'){
      i = i * 10 + c - '0';
      consommeChar();
    }else{
      return i * sign;
    }
  } while(true);
} 
  public class toto {
    public int foo;
    public int bar;
    public int blah;
  }
  static toto mktoto(int v1)
  {
    toto t = new toto();
    t.foo = v1;
    t.bar = 0;
    t.blah = 0;
    return t;
  }
  
  static int result(toto[] t, int len)
  {
    int out0 = 0;
    for (int j = 0; j < len; j++)
    {
        t[j].blah++;
        out0 = out0 + t[j].foo + t[j].blah * t[j].bar + t[j].bar * t[j].foo;
    }
    return out0;
  }
  
  public static void Main(String[] args)
  {
    toto[] t = new toto[4];
    for (int i = 0; i < 4; i++)
        t[i] = mktoto(i);
    t[0].bar = readInt();
    stdin_sep();
    t[1].blah = readInt();
    int titi = result(t, 4);
    Console.Write("" + titi + t[2].blah);
  }
  
}



<|start_filename|>out/countchar.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_char_(){
    if (current_char == null) current_char = read_char0();
    var out = current_char;
    current_char = read_char0();
    return out;
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function nth(tab, tofind, len){
    var out0 = 0;
    for (var i = 0; i < len; i++)
        if (tab[i] == tofind)
            out0++;
    return out0;
}
var len = 0;
len = read_int_();
stdinsep();
var tofind = '\x00';
tofind = read_char_();
stdinsep();
var tab = new Array(len);
for (var i = 0; i < len; i++)
{
    var tmp = '\x00';
    tmp = read_char_();
    tab[i] = tmp;
}
var result = nth(tab, tofind, len);
util.print(result);



<|start_filename|>out/euler17.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler17 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;


  one_to_twenty : Integer;
  one_to_thirty : Integer;
  one_to_ten : Integer;
  one_to_sixty : Integer;
  one_to_seventy : Integer;
  one_to_ninety_nine : Integer;
  one_to_ninety : Integer;
  one_to_nine : Integer;
  one_to_forty : Integer;
  one_to_fifty : Integer;
  one_to_eighty : Integer;
begin
  PInt(3 + 16);
  PString(new char_array'( To_C("" & Character'Val(10))));
  one_to_nine := 3 + 33;
  PInt(one_to_nine);
  PString(new char_array'( To_C("" & Character'Val(10))));
  one_to_ten := one_to_nine + 3;
  one_to_twenty := one_to_ten + 73;
  one_to_thirty := one_to_twenty + 6 * 9 + one_to_nine + 6;
  one_to_forty := one_to_thirty + 6 * 9 + one_to_nine + 5;
  one_to_fifty := one_to_forty + 5 * 9 + one_to_nine + 5;
  one_to_sixty := one_to_fifty + 5 * 9 + one_to_nine + 5;
  one_to_seventy := one_to_sixty + 5 * 9 + one_to_nine + 7;
  one_to_eighty := one_to_seventy + 7 * 9 + one_to_nine + 6;
  one_to_ninety := one_to_eighty + 6 * 9 + one_to_nine + 6;
  one_to_ninety_nine := one_to_ninety + 6 * 9 + one_to_nine;
  PInt(one_to_ninety_nine);
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(100 * one_to_nine + one_to_ninety_nine * 10 + 10 * 9 * 99 + 7 * 9 + 11);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/aaa_read0.lua<|end_filename|>

local len = tonumber(io.read('*l'))
io.write(string.format("%d\n", len))


<|start_filename|>out/euler24.groovy<|end_filename|>
import java.util.*

int fact(int n)
{
  int prod = 1
  for (int i = 2; i <= n; i++)
      prod *= i
  return prod
}
void show(int lim, int nth)
{
  int[] t = new int[lim]
  for (int i = 0; i < lim; i++)
      t[i] = i
  boolean[] pris = new boolean[lim]
  for (int j = 0; j < lim; j++)
      pris[j] = false
  for (int k = 1; k < lim; k++)
  {
      int n = fact(lim - k)
      int nchiffre = nth.intdiv(n)
      nth = nth % n
      for (int l = 0; l < lim; l++)
          if (!pris[l])
          {
              if (nchiffre == 0)
              {
                  print(l)
                  pris[l] = true
              }
              nchiffre--
          }
  }
  for (int m = 0; m < lim; m++)
      if (!pris[m])
          print(m)
  print("\n")
}

show(10, 999999)



<|start_filename|>out/euler24.cpp<|end_filename|>
#include <iostream>
#include <vector>

int fact(int n) {
    int prod = 1;
    for (int i = 2; i <= n; i++)
        prod *= i;
    return prod;
}


void show(int lim, int nth) {
    std::vector<int> t( lim );
    for (int i = 0; i < lim; i++)
        t[i] = i;
    std::vector<bool> pris( lim, false );
    for (int k = 1; k < lim; k++)
    {
        int n = fact(lim - k);
        int nchiffre = nth / n;
        nth = nth % n;
        for (int l = 0; l < lim; l++)
            if (!pris[l])
            {
                if (nchiffre == 0)
                {
                    std::cout << l;
                    pris[l] = true;
                }
                nchiffre--;
            }
    }
    for (int m = 0; m < lim; m++)
        if (!pris[m])
            std::cout << m;
    std::cout << "\n";
}

int main() {
    show(10, 999999);
}



<|start_filename|>js/CodeMirror-2.33/test/driver.js<|end_filename|>
var tests = [], debug = null;

function Failure(why) {this.message = why;}

function test(name, run, expectedFail) {
  tests.push({name: name, func: run, expectedFail: expectedFail});
  return name;
}
function testCM(name, run, opts, expectedFail) {
  return test(name, function() {
    var place = document.getElementById("testground"), cm = CodeMirror(place, opts);
    if (debug) place.style.visibility = "";
    try {run(cm);}
    finally {if (!debug) place.removeChild(cm.getWrapperElement());}
  }, expectedFail);
}

function runTests(callback) {
  function step(i) {
    if (i == tests.length) return callback("done");
    var test = tests[i], expFail = test.expectedFail;
    if (debug != null && debug != test.name) return step(i + 1);
    try {
      test.func();
      if (expFail) callback("fail", test.name, "was expected to fail, but succeeded");
      else callback("ok", test.name);
    } catch(e) {
      if (expFail) callback("expected", test.name);
      else if (e instanceof Failure) callback("fail", test.name, e.message);
      else callback("error", test.name, e.toString());
    }
    setTimeout(function(){step(i + 1);}, 20);
  }
  step(0);
}

function label(str, msg) {
  if (msg) return str + " (" + msg + ")";
  return str;
}
function eq(a, b, msg) {
  if (a != b) throw new Failure(label(a + " != " + b, msg));
}
function eqPos(a, b, msg) {
  function str(p) { return "{line:" + p.line + ",ch:" + p.ch + "}"; }
  if (a == b) return;
  if (a == null) throw new Failure(label("comparing null to " + str(b)));
  if (b == null) throw new Failure(label("comparing " + str(a) + " to null"));
  if (a.line != b.line || a.ch != b.ch) throw new Failure(label(str(a) + " != " + str(b), msg));
}
function is(a, msg) {
  if (!a) throw new Failure(label("assertion failed", msg));
}


<|start_filename|>out/recordtest.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end

local param = {foo=0, bar=0}
param.bar = readint()
stdinsep()
param.foo = readint()
io.write(param.bar + param.foo * param.bar)


<|start_filename|>out/euler21.js<|end_filename|>
var util = require("util");
function eratostene(t, max0){
    var n = 0;
    for (var i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            var j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
}
function fillPrimesFactors(t, n, primes, nprimes){
    for (var i = 0; i < nprimes; i++)
    {
        var d = primes[i];
        while (~~(n % d) == 0)
        {
            t[d]++;
            n = ~~(n / d);
        }
        if (n == 1)
            return primes[i];
    }
    return n;
}
function sumdivaux2(t, n, i){
    while (i < n && t[i] == 0)
        i++;
    return i;
}
function sumdivaux(t, n, i){
    if (i > n)
        return 1;
    else if (t[i] == 0)
        return sumdivaux(t, n, sumdivaux2(t, n, i + 1));
    else
    {
        var o = sumdivaux(t, n, sumdivaux2(t, n, i + 1));
        var out0 = 0;
        var p = i;
        for (var j = 1; j <= t[i]; j++)
        {
            out0 += p;
            p *= i;
        }
        return (out0 + 1) * o;
    }
}
function sumdiv(nprimes, primes, n){
    var t = new Array(n + 1);
    for (var i = 0; i <= n; i++)
        t[i] = 0;
    var max0 = fillPrimesFactors(t, n, primes, nprimes);
    return sumdivaux(t, max0, 0);
}
var maximumprimes = 1001;
var era = new Array(maximumprimes);
for (var j = 0; j < maximumprimes; j++)
    era[j] = j;
var nprimes = eratostene(era, maximumprimes);
var primes = new Array(nprimes);
for (var o = 0; o < nprimes; o++)
    primes[o] = 0;
var l = 0;
for (var k = 2; k < maximumprimes; k++)
    if (era[k] == k)
    {
        primes[l] = k;
        l++;
    }
util.print(l, " == ", nprimes, "\n");
var sum = 0;
for (var n = 2; n < 1001; n++)
{
    var other = sumdiv(nprimes, primes, n) - n;
    if (other > n)
    {
        var othersum = sumdiv(nprimes, primes, other) - other;
        if (othersum == n)
        {
            util.print(other, " & ", n, "\n");
            sum += other + n;
        }
    }
}
util.print("\n", sum, "\n");



<|start_filename|>out/euler31.groovy<|end_filename|>
import java.util.*

int result(int sum, int[] t, int maxIndex, int[][] cache)
{
  if (cache[sum][maxIndex] != 0)
      return cache[sum][maxIndex]
  else if (sum == 0 || maxIndex == 0)
      return 1
  else
  {
      int out0 = 0
      int div = sum.intdiv(t[maxIndex])
      for (int i = 0; i <= div; i++)
          out0 += result(sum - i * t[maxIndex], t, maxIndex - 1, cache)
      cache[sum][maxIndex] = out0
      return out0
  }
}

int[] t = new int[8]
for (int i = 0; i < 8; i++)
    t[i] = 0
t[0] = 1
t[1] = 2
t[2] = 5
t[3] = 10
t[4] = 20
t[5] = 50
t[6] = 100
t[7] = 200
int[][] cache = new int[201][]
for (int j = 0; j < 201; j++)
{
    int[] o = new int[8]
    for (int k = 0; k < 8; k++)
        o[k] = 0
    cache[j] = o
}
print(result(200, t, 7, cache))



<|start_filename|>out/recordtest.cpp<|end_filename|>
#include <iostream>
#include <vector>
struct toto {
    int foo;
    int bar;
};

int main() {
    toto param;
        param.foo = 0;
        param.bar = 0;;
    std::cin >> param.bar >> param.foo >> std::noskipws;
    std::cout << param.bar + param.foo * param.bar;
}



<|start_filename|>out/tictactoe.java<|end_filename|>
import java.util.*;

public class tictactoe
{
  static Scanner scanner = new Scanner(System.in);
  /*
Tictactoe : un tictactoe avec une IA
*/
  //  La structure de donnée 
  static class gamestate {
    public int[][] cases;
    public boolean firstToPlay;
    public int note;
    public boolean ended;
  }
  //  Un Mouvement 
  static class move {
    public int x;
    public int y;
  }
  //  On affiche l'état 
  static void print_state(gamestate g)
  {
    System.out.print("\n|");
    for (int y = 0; y < 3; y++)
    {
        for (int x = 0; x < 3; x++)
        {
            if (g.cases[x][y] == 0)
                System.out.print(" ");
            else if (g.cases[x][y] == 1)
                System.out.print("O");
            else
                System.out.print("X");
            System.out.print("|");
        }
        if (y != 2)
            System.out.print("\n|-|-|-|\n|");
    }
    System.out.print("\n");
  }
  //  On dit qui gagne (info stoquées dans g.ended et g.note ) 
  static void eval0(gamestate g)
  {
    int win = 0;
    int freecase = 0;
    for (int y = 0; y < 3; y++)
    {
        int col = -1;
        int lin = -1;
        for (int x = 0; x < 3; x++)
        {
            if (g.cases[x][y] == 0)
                freecase++;
            int colv = g.cases[x][y];
            int linv = g.cases[y][x];
            if (col == -1 && colv != 0)
                col = colv;
            else if (colv != col)
                col = -2;
            if (lin == -1 && linv != 0)
                lin = linv;
            else if (linv != lin)
                lin = -2;
        }
        if (col >= 0)
            win = col;
        else if (lin >= 0)
            win = lin;
    }
    for (int x = 1; x < 3; x++)
    {
        if (g.cases[0][0] == x && g.cases[1][1] == x && g.cases[2][2] == x)
            win = x;
        if (g.cases[0][2] == x && g.cases[1][1] == x && g.cases[2][0] == x)
            win = x;
    }
    g.ended = win != 0 || freecase == 0;
    if (win == 1)
        g.note = 1000;
    else if (win == 2)
        g.note = -1000;
    else
        g.note = 0;
  }
  //  On applique un mouvement 
  static void apply_move_xy(int x, int y, gamestate g)
  {
    int player = 2;
    if (g.firstToPlay)
        player = 1;
    g.cases[x][y] = player;
    g.firstToPlay = !g.firstToPlay;
  }
  static void apply_move(move m, gamestate g)
  {
    apply_move_xy(m.x, m.y, g);
  }
  static void cancel_move_xy(int x, int y, gamestate g)
  {
    g.cases[x][y] = 0;
    g.firstToPlay = !g.firstToPlay;
    g.ended = false;
  }
  static void cancel_move(move m, gamestate g)
  {
    cancel_move_xy(m.x, m.y, g);
  }
  static boolean can_move_xy(int x, int y, gamestate g)
  {
    return g.cases[x][y] == 0;
  }
  static boolean can_move(move m, gamestate g)
  {
    return can_move_xy(m.x, m.y, g);
  }
  /*
Un minimax classique, renvoie la note du plateau
*/
  static int minmax(gamestate g)
  {
    eval0(g);
    if (g.ended)
        return g.note;
    int maxNote = -10000;
    if (!g.firstToPlay)
        maxNote = 10000;
    for (int x = 0; x < 3; x++)
        for (int y = 0; y < 3; y++)
            if (can_move_xy(x, y, g))
            {
                apply_move_xy(x, y, g);
                int currentNote = minmax(g);
                cancel_move_xy(x, y, g);
                //  Minimum ou Maximum selon le coté ou l'on joue
                if (currentNote > maxNote == g.firstToPlay)
                    maxNote = currentNote;
            }
    return maxNote;
  }
  /*
Renvoie le coup de l'IA
*/
  static move play(gamestate g)
  {
    move minMove = new move();
    minMove.x = 0;
    minMove.y = 0;
    int minNote = 10000;
    for (int x = 0; x < 3; x++)
        for (int y = 0; y < 3; y++)
            if (can_move_xy(x, y, g))
            {
                apply_move_xy(x, y, g);
                int currentNote = minmax(g);
                System.out.printf("%d, %d, %d\n", x, y, currentNote);
                cancel_move_xy(x, y, g);
                if (currentNote < minNote)
                {
                    minNote = currentNote;
                    minMove.x = x;
                    minMove.y = y;
                }
            }
    System.out.printf("%d%d\n", minMove.x, minMove.y);
    return minMove;
  }
  static gamestate init0()
  {
    int[][] cases = new int[3][];
    for (int i = 0; i < 3; i++)
    {
        int[] tab = new int[3];
        for (int j = 0; j < 3; j++)
            tab[j] = 0;
        cases[i] = tab;
    }
    gamestate a = new gamestate();
    a.cases = cases;
    a.firstToPlay = true;
    a.note = 0;
    a.ended = false;
    return a;
  }
  static move read_move()
  {
    int x;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      x = scanner.nextInt();
    } else {
      x = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int y;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      y = scanner.nextInt();
    } else {
      y = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    move b = new move();
    b.x = x;
    b.y = y;
    return b;
  }
  public static void main(String args[])
  {
    for (int i = 0; i < 2; i++)
    {
        gamestate state = init0();
        move c = new move();
        c.x = 1;
        c.y = 1;
        apply_move(c, state);
        move d = new move();
        d.x = 0;
        d.y = 0;
        apply_move(d, state);
        while (!state.ended)
        {
            print_state(state);
            apply_move(play(state), state);
            eval0(state);
            print_state(state);
            if (!state.ended)
            {
                apply_move(play(state), state);
                eval0(state);
            }
        }
        print_state(state);
        System.out.printf("%d\n", state.note);
    }
  }
  
}



<|start_filename|>out/euler08.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init_withenv :: Int -> ( Int -> env -> IO(env, tabcontent)) -> env -> IO(env, IOArray Int tabcontent)
array_init_withenv len f env =
  do (env, li) <- g 0 env
     (,) env <$> newListArray (0, len - 1) li
  where g i env =
           if i == len
           then return (env, [])
           else do (env', item) <- f i env
                   (env'', li) <- g (i+1) env'
                   return (env'', item:li)

main :: IO ()
main =
  (array_init_withenv 5 (\ j g ->
                           do c <- getChar
                              let d = (ord c) - (ord '0')
                              let h = g * d
                              return (h, d)) 1) >>= (\ (l, last) ->
                                                      let m k n o p q =
                                                            if k <= 995
                                                            then do e <- getChar
                                                                    let f = (ord e) - (ord '0')
                                                                    (if f == 0
                                                                     then return (1, 4)
                                                                     else do let r = n * f
                                                                             s <- if q < 0
                                                                                  then ((quot r) <$> (readIOA last o))
                                                                                  else return r
                                                                             let t = q - 1
                                                                             return (s, t)) >>= (\ (u, v) ->
                                                                                                  do writeIOA last o f
                                                                                                     let w = (o + 1) `rem` 5
                                                                                                     let x = (max p u)
                                                                                                     m (k + 1) u w x v)
                                                            else printf "%d\n" (p::Int) :: IO() in
                                                            m 1 l 0 l 0)




<|start_filename|>out/sqrttest.groovy<|end_filename|>
import java.util.*



System.out.printf("%d %d %d %d %d %d ", (int)Math.sqrt(4), (int)Math.sqrt(16), (int)Math.sqrt(20), (int)Math.sqrt(1000), (int)Math.sqrt(500), (int)Math.sqrt(10))



<|start_filename|>out/testing_count.groovy<|end_filename|>
import java.util.*



int[] tab = new int[40]
for (int i = 0; i < 40; i++)
    tab[i] = i * i
System.out.printf("%d\n", (tab).length)



<|start_filename|>out/euler30.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
main =
  {-
a + b * 10 + c * 100 + d * 1000 + e * 10 000 =
  a ^ 5 +
  b ^ 5 +
  c ^ 5 +
  d ^ 5 +
  e ^ 5
-}
  do p <- array_init 10 (\ i ->
                           return (i * i * i * i * i))
     let g a h =
           if a <= 9
           then let j b k =
                      if b <= 9
                      then let l c m =
                                 if c <= 9
                                 then let n d o =
                                            if d <= 9
                                            then let q e t =
                                                       if e <= 9
                                                       then let u f v =
                                                                  if f <= 9
                                                                  then do s <- ((+) <$> ((+) <$> ((+) <$> ((+) <$> ((+) <$> (readIOA p a) <*> (readIOA p b)) <*> (readIOA p c)) <*> (readIOA p d)) <*> (readIOA p e)) <*> (readIOA p f))
                                                                          let r = a + b * 10 + c * 100 + d * 1000 + e * 10000 + f * 100000
                                                                          if s == r && r /= 1
                                                                          then do printf "%d%d%d%d%d%d %d\n" (f::Int) (e::Int) (d::Int) (c::Int) (b::Int) (a::Int) (r::Int) :: IO()
                                                                                  let w = v + r
                                                                                  u (f + 1) w
                                                                          else u (f + 1) v
                                                                  else q (e + 1) v in
                                                                  u 0 t
                                                       else n (d + 1) t in
                                                       q 0 o
                                            else l (c + 1) o in
                                            n 0 m
                                 else j (b + 1) m in
                                 l 0 k
                      else g (a + 1) k in
                      j 0 h
           else printf "%d" (h :: Int) :: IO () in
           g 0 0




<|start_filename|>out/pathfinding.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

int pathfind_aux(std::vector<std::vector<int>>& cache, std::vector<std::vector<char>>& tab, int x, int y, int posX, int posY) {
    if (posX == x - 1 && posY == y - 1)
        return 0;
    else if (posX < 0 || posY < 0 || posX >= x || posY >= y)
        return x * y * 10;
    else if (tab[posY][posX] == '#')
        return x * y * 10;
    else if (cache[posY][posX] != -1)
        return cache[posY][posX];
    else
    {
        cache[posY][posX] = x * y * 10;
        int val1 = pathfind_aux(cache, tab, x, y, posX + 1, posY);
        int val2 = pathfind_aux(cache, tab, x, y, posX - 1, posY);
        int val3 = pathfind_aux(cache, tab, x, y, posX, posY - 1);
        int val4 = pathfind_aux(cache, tab, x, y, posX, posY + 1);
        int out0 = 1 + std::min({val1, val2, val3, val4});
        cache[posY][posX] = out0;
        return out0;
    }
}


int pathfind(std::vector<std::vector<char>>& tab, int x, int y) {
    std::vector<std::vector<int>> cache( y );
    for (int i = 0; i < y; i++)
    {
        std::vector<int> tmp( x );
        for (int j = 0; j < x; j++)
            tmp[j] = -1;
        cache[i] = tmp;
    }
    return pathfind_aux(cache, tab, x, y, 0, 0);
}

int main() {
    int y, x;
    std::cin >> x >> y;
    std::vector<std::vector<char>> tab( y );
    for (int i = 0; i < y; i++)
    {
        std::vector<char> tab2( x );
        for (int j = 0; j < x; j++)
        {
            char tmp = '\u0000';
            std::cin >> tmp >> std::noskipws;
            tab2[j] = tmp;
        }
        std::cin >> std::skipws;
        tab[i] = tab2;
    }
    int result = pathfind(tab, x, y);
    std::cout << result;
}



<|start_filename|>out/aaa_12strings.cpp<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    std::cout << "tada ' \" \n\r\t $ & todo\n\n{foo} \\${blah}\nblah\n";
}



<|start_filename|>out/prologin_template_2charline2.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_char_(){
    if (current_char == null) current_char = read_char0();
    var out = current_char;
    current_char = read_char0();
    return out;
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function programme_candidat(tableau1, taille1, tableau2, taille2){
    var out0 = 0;
    for (var i = 0; i < taille1; i++)
    {
        out0 += tableau1[i].charCodeAt(0) * i;
        util.print(tableau1[i]);
    }
    util.print("--\n");
    for (var j = 0; j < taille2; j++)
    {
        out0 += tableau2[j].charCodeAt(0) * j * 100;
        util.print(tableau2[j]);
    }
    util.print("--\n");
    return out0;
}
var taille1 = read_int_();
stdinsep();
var taille2 = read_int_();
stdinsep();
var tableau1 = new Array(taille1);
for (var a = 0; a < taille1; a++)
{
    tableau1[a] = read_char_();
}
stdinsep();
var tableau2 = new Array(taille2);
for (var b = 0; b < taille2; b++)
{
    tableau2[b] = read_char_();
}
stdinsep();
util.print(programme_candidat(tableau1, taille1, tableau2, taille2), "\n");



<|start_filename|>out/record2.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}

type toto struct {
  foo int;
  bar int;
  blah int;
}
func mktoto(v1 int) * toto{
  var t * toto = new (toto)
      (*t).foo=v1
      (*t).bar=0
      (*t).blah=0
  return t
}
func result(t * toto) int{
  (*t).blah++
  return (*t).foo + (*t).blah * (*t).bar + (*t).bar * (*t).foo
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var t * toto = mktoto(4)
  fmt.Fscanf(reader, "%d", &(*t).bar)
  skip()
  fmt.Fscanf(reader, "%d", &(*t).blah)
  fmt.Printf("%d", result(t))
}



<|start_filename|>out/euler40.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function exp0 (a, e)
  local o = 1
  for i = 1, e do
      o = o * a
  end
  return o
end

function e (t, n)
  for i = 1, 8 do
      if n >= t[i + 1] * i then
          n = n - t[i + 1] * i
      else 
          local nombre = exp0(10, i - 1) + trunc(n / i)
          local chiffre = i - 1 - math.fmod(n, i)
          return math.fmod(trunc(nombre / exp0(10, chiffre)), 10)
      end
  end
  return -1
end

local t = {}
for i = 0, 8 do
    t[i + 1] = exp0(10, i) - exp0(10, i - 1)
end
for i2 = 1, 8 do
    io.write(string.format("%d => %d\n", i2, t[i2 + 1]))
end
for j = 0, 80 do
    io.write(e(t, j))
end
io.write("\n")
for k = 1, 50 do
    io.write(k)
end
io.write("\n")
for j2 = 169, 220 do
    io.write(e(t, j2))
end
io.write("\n")
for k2 = 90, 110 do
    io.write(k2)
end
io.write("\n")
local out0 = 1
for l = 0, 6 do
    local puiss = exp0(10, l)
    local v = e(t, puiss - 1)
    out0 = out0 * v
    io.write(string.format("10^%d=%d v=%d\n", l, puiss, v))
end
io.write(string.format("%d\n", out0))


<|start_filename|>out/plus_petit.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure plus_petit is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type c is Array (Integer range <>) of Integer;
type c_PTR is access c;
function go0(tab : in c_PTR; a : in Integer; b : in Integer) return Integer is
  m : Integer;
  j : Integer;
  i : Integer;
  e : Integer;
begin
  m := (a + b) / 2;
  if a = m
  then
    if tab(a) = m
    then
      return b;
    else
      return a;
    end if;
  end if;
  i := a;
  j := b;
  while i < j loop
    e := tab(i);
    if e < m
    then
      i := i + 1;
    else
      j := j - 1;
      tab(i) := tab(j);
      tab(j) := e;
    end if;
  end loop;
  if i < m
  then
    return go0(tab, a, m);
  else
    return go0(tab, m, b);
  end if;
end;
function plus_petit0(tab : in c_PTR; len : in Integer) return Integer is
begin
  return go0(tab, 0, len);
end;

  tmp : Integer;
  tab : c_PTR;
  len : Integer;
begin
  len := 0;
  Get(len);
  SkipSpaces;
  tab := new c (0..len - 1);
  for i in integer range 0..len - 1 loop
    tmp := 0;
    Get(tmp);
    SkipSpaces;
    tab(i) := tmp;
  end loop;
  PInt(plus_petit0(tab, len));
end;


<|start_filename|>out/aaa_041comment.java<|end_filename|>
import java.util.*;

public class aaa_041comment
{
  
  
  public static void main(String args[])
  {
    int i = 4;
    // while i < 10 do 
    System.out.print(i);
    i++;
    //   end 
    System.out.print(i);
  }
  
}



<|start_filename|>out/vigenere.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int position_alphabet(char c)
{
  int i = (0+c)
  if (i <= (0+(char)'Z') && i >= (0+(char)'A'))
      return i - (0+(char)'A')
  else if (i <= (0+(char)'z') && i >= (0+(char)'a'))
      return i - (0+(char)'a')
  else
      return -1
}
char of_position_alphabet(int c)
{
  return (char)(c + (0+(char)'a'))
}
void crypte(int taille_cle, char[] cle, int taille, char[] message)
{
  for (int i = 0; i < taille; i++)
  {
      int lettre = position_alphabet(message[i])
      if (lettre != -1)
      {
          int addon = position_alphabet(cle[i % taille_cle])
          int new0 = (addon + lettre) % 26
          message[i] = of_position_alphabet(new0)
      }
  }
}
@Field Scanner scanner = new Scanner(System.in)
int taille_cle
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  taille_cle = scanner.nextInt()
} else {
  taille_cle = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
char[] cle = new char[taille_cle]
for (int index = 0; index < taille_cle; index++)
{
    char out0 = scanner.findWithinHorizon(".", 1).charAt(0)
    cle[index] = out0
}
scanner.findWithinHorizon("[\n\r ]*", 1)
int taille
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  taille = scanner.nextInt()
} else {
  taille = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
char[] message = new char[taille]
for (int index2 = 0; index2 < taille; index2++)
{
    char out2 = scanner.findWithinHorizon(".", 1).charAt(0)
    message[index2] = out2
}
crypte(taille_cle, cle, taille, message)
for (int i = 0; i < taille; i++)
    print(message[i])
print("\n")



<|start_filename|>out/euler39.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;
with Ada.Numerics.Elementary_Functions;
procedure euler39 is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

type d is Array (Integer range <>) of Integer;
type d_PTR is access d;

  t : d_PTR;
  p : Integer;
  j : Integer;
  c2 : Integer;
  c : Integer;
begin
  t := new d (0..1000);
  for i in integer range 0..1000 loop
    t(i) := 0;
  end loop;
  for a in integer range 1..1000 loop
    for b in integer range 1..1000 loop
      c2 := a * a + b * b;
      c := Integer(Float'Truncation(Ada.Numerics.Elementary_Functions.Sqrt(Float(c2))));
      if c * c = c2
      then
        p := a + b + c;
        if p < 1001
        then
          t(p) := t(p) + 1;
        end if;
      end if;
    end loop;
  end loop;
  j := 0;
  for k in integer range 1..1000 loop
    if t(k) > t(j)
    then
      j := k;
    end if;
  end loop;
  PInt(j);
end;


<|start_filename|>out/euler34.lua<|end_filename|>

local f = {}
for j = 0, 9 do
    f[j + 1] = 1
end
for i = 1, 9 do
    f[i + 1] = f[i + 1] * i * f[i]
    io.write(string.format("%d ", f[i + 1]))
end
local out0 = 0
io.write("\n")
for a = 0, 9 do
    for b = 0, 9 do
        for c = 0, 9 do
            for d = 0, 9 do
                for e = 0, 9 do
                    for g = 0, 9 do
                        local sum = f[a + 1] + f[b + 1] + f[c + 1] + f[d + 1] + f[e + 1] + f[g + 1]
                        local num = ((((a * 10 + b) * 10 + c) * 10 + d) * 10 + e) * 10 + g
                        if a == 0 then
                            sum = sum - 1
                            if b == 0 then
                                sum = sum - 1
                                if c == 0 then
                                    sum = sum - 1
                                    if d == 0 then
                                        sum = sum - 1
                                    end
                                end
                            end
                        end
                        if sum == num and sum ~= 1 and sum ~= 2 then
                            out0 = out0 + num
                            io.write(string.format("%d ", num))
                        end
                    end
                end
            end
        end
    end
end
io.write(string.format("\n%d\n", out0))


<|start_filename|>out/euler24.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: fact { n }
  1 { prod }
  n 2 BEGIN 2dup >= WHILE DUP { i }
    prod i * TO prod
   1 + REPEAT 2DROP
  prod exit
;


: show { lim nth }
  HERE lim cells allot { t }
  lim 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    i t  i cells +  !
   1 + REPEAT 2DROP
  HERE lim cells allot { pris }
  lim 1 - 0 BEGIN 2dup >= WHILE DUP { j }
    false pris  j cells +  !
   1 + REPEAT 2DROP
  lim 1 - 1 BEGIN 2dup >= WHILE DUP { k }
    lim k - fact { n }
    nth n // { nchiffre }
    nth n % TO nth
    lim 1 - 0 BEGIN 2dup >= WHILE DUP { l }
      pris  l cells +  @ INVERT
      IF
        nchiffre 0 =
        IF
          l s>d 0 d.r
          true pris  l cells +  !
        THEN
        nchiffre 1 - TO nchiffre
      THEN
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  lim 1 - 0 BEGIN 2dup >= WHILE DUP { m }
    pris  m cells +  @ INVERT
    IF
      m s>d 0 d.r
    THEN
   1 + REPEAT 2DROP
  S\" \n" TYPE
;

: main
  10 999999 show
  ;
main
BYE



<|start_filename|>out/euler43.fs<|end_filename|>
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: main
  \ 
  \ The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property.
  \ 
  \ Let d1 be the 1st digit, d2 be the 2nd digit, and so on. In this way, we note the following:
  \ 
  \ d2d3d4=406 is divisible by 2
  \ d3d4d5=063 is divisible by 3
  \ d4d5d6=635 is divisible by 5
  \ d5d6d7=357 is divisible by 7
  \ d6d7d8=572 is divisible by 11
  \ d7d8d9=728 is divisible by 13
  \ d8d9d10=289 is divisible by 17
  \ Find the sum of all 0 to 9 pandigital numbers with this property.
  \ 
  \ d4 % 2 == 0
  \ (d3 + d4 + d5) % 3 == 0
  \ d6 = 5 ou d6 = 0
  \ (d5 * 100 + d6 * 10 + d7  ) % 7 == 0
  \ (d6 * 100 + d7 * 10 + d8  ) % 11 == 0
  \ (d7 * 100 + d8 * 10 + d9  ) % 13 == 0
  \ (d8 * 100 + d9 * 10 + d10 ) % 17 == 0
  \ 
  \ 
  \ d4 % 2 == 0
  \ d6 = 5 ou d6 = 0
  \ 
  \ (d3 + d4 + d5) % 3 == 0
  \ (d5 * 2 + d6 * 3 + d7) % 7 == 0
  \ 
  
  HERE 10 cells allot { allowed }
  9 0 BEGIN 2dup >= WHILE DUP { i }
    true allowed  i cells +  !
   1 + REPEAT 2DROP
  1 0 BEGIN 2dup >= WHILE DUP { i6 }
    i6 5 * { d6 }
    allowed  d6 cells +  @
    IF
      false allowed  d6 cells +  !
      9 0 BEGIN 2dup >= WHILE DUP { d7 }
        allowed  d7 cells +  @
        IF
          false allowed  d7 cells +  !
          9 0 BEGIN 2dup >= WHILE DUP { d8 }
            allowed  d8 cells +  @
            IF
              false allowed  d8 cells +  !
              9 0 BEGIN 2dup >= WHILE DUP { d9 }
                allowed  d9 cells +  @
                IF
                  false allowed  d9 cells +  !
                  9 1 BEGIN 2dup >= WHILE DUP { d10 }
                    allowed  d10 cells +  @ d6 100 * d7 10 * + d8 + 11 % 0 = AND d7 100 * d8 10 * + d9 + 13 % 0 = AND d8 100 * d9 10 * + d10 + 17 % 0 = AND
                    IF
                      false allowed  d10 cells +  !
                      9 0 BEGIN 2dup >= WHILE DUP { d5 }
                        allowed  d5 cells +  @
                        IF
                          false allowed  d5 cells +  !
                          d5 100 * d6 10 * + d7 + 7 % 0 =
                          IF
                            4 0 BEGIN 2dup >= WHILE DUP { i4 }
                              i4 2 * { d4 }
                              allowed  d4 cells +  @
                              IF
                                false allowed  d4 cells +  !
                                9 0 BEGIN 2dup >= WHILE DUP { d3 }
                                  allowed  d3 cells +  @
                                  IF
                                    false allowed  d3 cells +  !
                                    d3 d4 + d5 + 3 % 0 =
                                    IF
                                      9 0 BEGIN 2dup >= WHILE DUP { d2 }
                                        allowed  d2 cells +  @
                                        IF
                                          false allowed  d2 cells +  !
                                          9 0 BEGIN 2dup >= WHILE DUP { d1 }
                                            allowed  d1 cells +  @
                                            IF
                                              false allowed  d1 cells +  !
                                              d1 s>d 0 d.r
                                              d2 s>d 0 d.r
                                              d3 s>d 0 d.r
                                              d4 s>d 0 d.r
                                              d5 s>d 0 d.r
                                              d6 s>d 0 d.r
                                              d7 s>d 0 d.r
                                              d8 s>d 0 d.r
                                              d9 s>d 0 d.r
                                              d10 s>d 0 d.r
                                              S"  + " TYPE
                                              true allowed  d1 cells +  !
                                            THEN
                                           1 + REPEAT 2DROP
                                          true allowed  d2 cells +  !
                                        THEN
                                       1 + REPEAT 2DROP
                                    THEN
                                    true allowed  d3 cells +  !
                                  THEN
                                 1 + REPEAT 2DROP
                                true allowed  d4 cells +  !
                              THEN
                             1 + REPEAT 2DROP
                          THEN
                          true allowed  d5 cells +  !
                        THEN
                       1 + REPEAT 2DROP
                      true allowed  d10 cells +  !
                    THEN
                   1 + REPEAT 2DROP
                  true allowed  d9 cells +  !
                THEN
               1 + REPEAT 2DROP
              true allowed  d8 cells +  !
            THEN
           1 + REPEAT 2DROP
          true allowed  d7 cells +  !
        THEN
       1 + REPEAT 2DROP
      true allowed  d6 cells +  !
    THEN
   1 + REPEAT 2DROP
  0 s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/longest_increasing_subsequence.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class longest_increasing_subsequence
{
  static int dichofind(int len, int[] tab, int tofind, int a, int b)
  {
    if (a >= b - 1)
        return a;
    else
    {
        int c = (a + b) / 2;
        if (tab[c] < tofind)
            return dichofind(len, tab, tofind, c, b);
        else
            return dichofind(len, tab, tofind, a, c);
    }
  }
  
  static int process(int len, int[] tab)
  {
    int[] size = new int[len];
    for (int j = 0; j < len; j++)
        if (j == 0)
            size[j] = 0;
        else
            size[j] = len * 2;
    for (int i = 0; i < len; i++)
    {
        int k = dichofind(len, size, tab[i], 0, len - 1);
        if (size[k + 1] > tab[i])
            size[k + 1] = tab[i];
    }
    for (int l = 0; l < len; l++)
        Console.Write(size[l] + " ");
    for (int m = 0; m < len; m++)
    {
        int k = len - 1 - m;
        if (size[k] != len * 2)
            return k;
    }
    return 0;
  }
  
  public static void Main(String[] args)
  {
    int n = int.Parse(Console.ReadLine());
    for (int i = 1; i <= n; i++)
    {
        int len = int.Parse(Console.ReadLine());
        Console.Write(process(len, new List<string>(Console.ReadLine().Split(" ".ToCharArray())).ConvertAll(int.Parse).ToArray()) + "\n");
    }
  }
  
}



<|start_filename|>out/str2.fs<|end_filename|>
: main
  S" ma petite chaine en or" TYPE
  ;
main
BYE



<|start_filename|>out/aaa_03binding.cs<|end_filename|>
using System;

public class aaa_03binding
{
  static int g(int i)
  {
    int j = i * 4;
    if (j % 2 == 1)
        return 0;
    return j;
  }
  
  static void h(int i)
  {
    Console.Write(i + "\n");
  }
  
  public static void Main(String[] args)
  {
    h(14);
    int a = 4;
    int b = 5;
    Console.Write(a + b);
    //  main 
    h(15);
    a = 2;
    b = 1;
    Console.Write(a + b);
  }
  
}



<|start_filename|>out/euler12.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: eratostene { t max0 }
  0 { n }
  max0 1 - 2 BEGIN 2dup >= WHILE DUP { i }
    t  i cells +  @ i =
    IF
      i i * { j }
      n 1 + TO n
      BEGIN
        j max0 < j 0 > AND
      WHILE
        0 t  j cells +  !
        j i + TO j
      REPEAT
    THEN
   1 + REPEAT 2DROP
  n exit
;


: fillPrimesFactors { t n primes nprimes }
  nprimes 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    primes  i cells +  @ { d }
    BEGIN
      n d % 0 =
    WHILE
      t  d cells +  @ 1 + t  d cells +  !
      n d // TO n
    REPEAT
    n 1 =
    IF
      DROP DROP primes  i cells +  @ exit
    THEN
   1 + REPEAT 2DROP
  n exit
;


: find0 { ndiv2 }
  110 { maximumprimes }
  HERE maximumprimes cells allot { era }
  maximumprimes 1 - 0 BEGIN 2dup >= WHILE DUP { j }
    j era  j cells +  !
   1 + REPEAT 2DROP
  era maximumprimes eratostene { nprimes }
  HERE nprimes cells allot { primes }
  nprimes 1 - 0 BEGIN 2dup >= WHILE DUP { o }
    0 primes  o cells +  !
   1 + REPEAT 2DROP
  0 { l }
  maximumprimes 1 - 2 BEGIN 2dup >= WHILE DUP { k }
    era  k cells +  @ k =
    IF
      k primes  l cells +  !
      l 1 + TO l
    THEN
   1 + REPEAT 2DROP
  10000 1 BEGIN 2dup >= WHILE DUP { n }
    HERE n 2 + cells allot { primesFactors }
    n 1 + 0 BEGIN 2dup >= WHILE DUP { m }
      0 primesFactors  m cells +  !
     1 + REPEAT 2DROP
    primesFactors n primes nprimes fillPrimesFactors primesFactors n 1 + primes nprimes fillPrimesFactors max
    { max0 }
    primesFactors  2 cells +  @ 1 - primesFactors  2 cells +  !
    1 { ndivs }
    max0 0 BEGIN 2dup >= WHILE DUP { i }
      primesFactors  i cells +  @ 0 <>
      IF
        ndivs 1 primesFactors  i cells +  @ + * TO ndivs
      THEN
     1 + REPEAT 2DROP
    ndivs ndiv2 >
    IF
      DROP DROP n n 1 + * 2 // exit
    THEN
    \  print "n=" print n print "\t" print (n * (n + 1) / 2 ) print " " print ndivs print "\n" 
    
   1 + REPEAT 2DROP
  0 exit
;

: main
  500 find0 s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/pathfinding0.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int pathfind_aux(int[][] cache, char[][] tab, int x, int y, int posX, int posY)
{
  if (posX == x - 1 && posY == y - 1)
      return 0
  else if (posX < 0 || posY < 0 || posX >= x || posY >= y)
      return x * y * 10
  else if (tab[posY][posX] == (char)'#')
      return x * y * 10
  else if (cache[posY][posX] != -1)
      return cache[posY][posX]
  else
  {
      cache[posY][posX] = x * y * 10
      int val1 = pathfind_aux(cache, tab, x, y, posX + 1, posY)
      int val2 = pathfind_aux(cache, tab, x, y, posX - 1, posY)
      int val3 = pathfind_aux(cache, tab, x, y, posX, posY - 1)
      int val4 = pathfind_aux(cache, tab, x, y, posX, posY + 1)
      int out0 = 1 + Math.min(Math.min(Math.min(val1, val2), val3), val4)
      cache[posY][posX] = out0
      return out0
  }
}
int pathfind(char[][] tab, int x, int y)
{
  int[][] cache = new int[y][]
  for (int i = 0; i < y; i++)
  {
      int[] tmp = new int[x]
      for (int j = 0; j < x; j++)
      {
          print(tab[i][j])
          tmp[j] = -1
      }
      print("\n")
      cache[i] = tmp
  }
  return pathfind_aux(cache, tab, x, y, 0, 0)
}
@Field Scanner scanner = new Scanner(System.in)
int x = Integer.parseInt(scanner.nextLine())
int y = Integer.parseInt(scanner.nextLine())
System.out.printf("%d %d\n", x, y)
char[][] e = new char[y][]
for (int f = 0; f < y; f++)
    e[f] = scanner.nextLine().toCharArray()
char[][] tab = e
int result = pathfind(tab, x, y)
print(result)



<|start_filename|>out/euler12.groovy<|end_filename|>
import java.util.*

int eratostene(int[] t, int max0)
{
  int n = 0
  for (int i = 2; i < max0; i++)
      if (t[i] == i)
      {
          int j = i * i
          n++
          while (j < max0 && j > 0)
          {
              t[j] = 0
              j += i
          }
      }
  return n
}
int fillPrimesFactors(int[] t, int n, int[] primes, int nprimes)
{
  for (int i = 0; i < nprimes; i++)
  {
      int d = primes[i]
      while (n % d == 0)
      {
          t[d]++
          n /= d
      }
      if (n == 1)
          return primes[i]
  }
  return n
}
int find(int ndiv2)
{
  int maximumprimes = 110
  int[] era = new int[maximumprimes]
  for (int j = 0; j < maximumprimes; j++)
      era[j] = j
  int nprimes = eratostene(era, maximumprimes)
  int[] primes = new int[nprimes]
  for (int o = 0; o < nprimes; o++)
      primes[o] = 0
  int l = 0
  for (int k = 2; k < maximumprimes; k++)
      if (era[k] == k)
      {
          primes[l] = k
          l++
      }
  for (int n = 1; n < 10001; n++)
  {
      int[] primesFactors = new int[n + 2]
      for (int m = 0; m <= n + 1; m++)
          primesFactors[m] = 0
      int max0 = Math.max(fillPrimesFactors(primesFactors, n, primes, nprimes), fillPrimesFactors(primesFactors, n + 1, primes, nprimes))
      primesFactors[2]--
      int ndivs = 1
      for (int i = 0; i <= max0; i++)
          if (primesFactors[i] != 0)
              ndivs *= 1 + primesFactors[i]
      if (ndivs > ndiv2)
          return (n * (n + 1)).intdiv(2)
      //  print "n=" print n print "\t" print (n * (n + 1) / 2 ) print " " print ndivs print "\n" 
  }
  return 0
}

System.out.printf("%d\n", find(500))



<|start_filename|>out/aaa_readints.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}

func main() {
  reader = bufio.NewReader(os.Stdin)
  var len int
  fmt.Fscanf(reader, "%d", &len)
  skip()
  fmt.Printf("%d=len\n", len)
  var tab1 []int = make([]int, len)
  for a := 0; a < len; a++ {
      fmt.Fscanf(reader, "%d", &tab1[a])
      skip()
  }
  for i := 0; i < len; i++ {
      fmt.Printf("%d=>%d\n", i, tab1[i])
  }
  fmt.Fscanf(reader, "%d", &len)
  skip()
  var tab2 [][]int = make([][]int, len - 1)
  for b := 0; b < len - 1; b++ {
      var c []int = make([]int, len)
      for d := 0; d < len; d++ {
          fmt.Fscanf(reader, "%d", &c[d])
          skip()
      }
      tab2[b] = c
  }
  for i := 0; i < len - 1; i++ {
      for j := 0; j < len; j++ {
          fmt.Printf("%d ", tab2[i][j])
      }
      fmt.Printf("\n")
  }
}



<|start_filename|>out/euler24.cs<|end_filename|>
using System;

public class euler24
{
  static int fact(int n)
  {
    int prod = 1;
    for (int i = 2; i <= n; i++)
        prod *= i;
    return prod;
  }
  
  static void show(int lim, int nth)
  {
    int[] t = new int[lim];
    for (int i = 0; i < lim; i++)
        t[i] = i;
    bool[] pris = new bool[lim];
    for (int j = 0; j < lim; j++)
        pris[j] = false;
    for (int k = 1; k < lim; k++)
    {
        int n = fact(lim - k);
        int nchiffre = nth / n;
        nth = nth % n;
        for (int l = 0; l < lim; l++)
            if (!pris[l])
            {
                if (nchiffre == 0)
                {
                    Console.Write(l);
                    pris[l] = true;
                }
                nchiffre--;
            }
    }
    for (int m = 0; m < lim; m++)
        if (!pris[m])
            Console.Write(m);
    Console.Write("\n");
  }
  
  public static void Main(String[] args)
  {
    show(10, 999999);
  }
  
}



<|start_filename|>out/tictactoe.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
data Gamestate = Gamestate {
                              _cases :: IORef (IOArray Int (IOArray Int Int)),
                              _firstToPlay :: IORef Bool,
                              _note :: IORef Int,
                              _ended :: IORef Bool
                              }
  deriving Eq


data Move = Move {
                    _x :: IORef Int,
                    _y :: IORef Int
                    }
  deriving Eq


print_state g =
  do printf "\n|" :: IO ()
     let a y =
           if y <= 2
           then let b x =
                      if x <= 2
                      then do ifM (((==) 0) <$> (join $ readIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return x) <*> return y))
                                  (printf " " :: IO ())
                                  (ifM (((==) 1) <$> (join $ readIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return x) <*> return y))
                                       (printf "O" :: IO ())
                                       (printf "X" :: IO ()))
                              printf "|" :: IO ()
                              b (x + 1)
                      else if y /= 2
                           then do printf "\n|-|-|-|\n|" :: IO ()
                                   a (y + 1)
                           else a (y + 1) in
                      b 0
           else printf "\n" :: IO () in
           a 0

eval0 g =
  let c y d e =
        if y <= 2
        then do let col = - 1
                let lin = - 1
                let l x n o p =
                      if x <= 2
                      then do q <- ifM (((==) 0) <$> (join $ readIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return x) <*> return y))
                                       (return (o + 1))
                                       (return o)
                              colv <- join $ readIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return x) <*> return y
                              linv <- join $ readIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return y) <*> return x
                              let r = if n == - 1 && colv /= 0
                                      then colv
                                      else if colv /= n
                                           then - 2
                                           else n
                              if p == - 1 && linv /= 0
                              then l (x + 1) r q linv
                              else if linv /= p
                                   then do let s = - 2
                                           l (x + 1) r q s
                                   else l (x + 1) r q p
                      else if n >= 0
                           then c (y + 1) o n
                           else if p >= 0
                                then c (y + 1) o p
                                else c (y + 1) o e in
                      l 0 col d lin
        else let f x h =
                   if x <= 2
                   then do k <- ifM (((((==) x) <$> (join $ readIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return 0) <*> return 0)) <&&> (((==) x) <$> (join $ readIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return 1) <*> return 1))) <&&> (((==) x) <$> (join $ readIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return 2) <*> return 2)))
                                    (return x)
                                    (return h)
                           ifM (((((==) x) <$> (join $ readIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return 0) <*> return 2)) <&&> (((==) x) <$> (join $ readIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return 1) <*> return 1))) <&&> (((==) x) <$> (join $ readIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return 2) <*> return 0)))
                               (f (x + 1) x)
                               (f (x + 1) k)
                   else do writeIORef (_ended g) (h /= 0 || d == 0)
                           if h == 1
                           then writeIORef (_note g) 1000
                           else if h == 2
                                then writeIORef (_note g) (- 1000)
                                else writeIORef (_note g) 0 in
                   f 1 e in
        c 0 0 0

apply_move_xy x y g =
  do t <- ifM (readIORef (_firstToPlay g))
              (return 1)
              (return 2)
     join $ writeIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return x) <*> return y <*> return t
     writeIORef (_firstToPlay g) =<< (fmap not (readIORef (_firstToPlay g)))

apply_move m g =
  do join $ apply_move_xy <$> (readIORef (_x m)) <*> (readIORef (_y m)) <*> return g
     return ()

cancel_move_xy x y g =
  do join $ writeIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return x) <*> return y <*> return 0
     writeIORef (_firstToPlay g) =<< (fmap not (readIORef (_firstToPlay g)))
     writeIORef (_ended g) False

cancel_move m g =
  do join $ cancel_move_xy <$> (readIORef (_x m)) <*> (readIORef (_y m)) <*> return g
     return ()

can_move_xy x y g =
  (((==) 0) <$> (join $ readIOA <$> (join $ readIOA <$> (readIORef (_cases g)) <*> return x) <*> return y))

can_move m g =
  join $ can_move_xy <$> (readIORef (_x m)) <*> (readIORef (_y m)) <*> return g

minmax g =
  do eval0 g
     ifM (readIORef (_ended g))
         (readIORef (_note g))
         (do let maxNote = - 10000
             u <- ifM (fmap not (readIORef (_firstToPlay g)))
                      (return 10000)
                      (return maxNote)
             let v x w =
                   if x <= 2
                   then let z y ba =
                              if y <= 2
                              then ifM (can_move_xy x y g)
                                       (do apply_move_xy x y g
                                           currentNote <- minmax g
                                           cancel_move_xy x y g
                                           {- Minimum ou Maximum selon le coté ou l'on joue-}
                                           ifM (((==) (currentNote > ba)) <$> (readIORef (_firstToPlay g)))
                                               (z (y + 1) currentNote)
                                               (z (y + 1) ba))
                                       (z (y + 1) ba)
                              else v (x + 1) ba in
                              z 0 w
                   else return w in
                   v 0 u)

play g =
  do minMove <- (Move <$> (newIORef 0) <*> (newIORef 0))
     let bb x bc =
            if x <= 2
            then let bd y be =
                        if y <= 2
                        then ifM (can_move_xy x y g)
                                 (do apply_move_xy x y g
                                     currentNote <- minmax g
                                     printf "%d, %d, %d\n" (x::Int) (y::Int) (currentNote::Int) :: IO()
                                     cancel_move_xy x y g
                                     if currentNote < be
                                     then do writeIORef (_x minMove) x
                                             writeIORef (_y minMove) y
                                             bd (y + 1) currentNote
                                     else bd (y + 1) be)
                                 (bd (y + 1) be)
                        else bb (x + 1) be in
                        bd 0 bc
            else do join $ printf "%d%d\n" <$> ((readIORef (_x minMove))::IO Int) <*> ((readIORef (_y minMove))::IO Int)
                    return minMove in
            bb 0 10000

init0 () =
  do cases <- array_init 3 (\ i ->
                              array_init 3 (\ j ->
                                              return 0))
     (Gamestate <$> (newIORef cases) <*> (newIORef True) <*> (newIORef 0) <*> (newIORef False))

read_move () =
  do x <- read_int
     skip_whitespaces
     y <- read_int
     skip_whitespaces
     (Move <$> (newIORef x) <*> (newIORef y))

main =
  let bf i =
         if i <= 1
         then do state <- init0 ()
                 join $ apply_move <$> (Move <$> (newIORef 1) <*> (newIORef 1)) <*> return state
                 join $ apply_move <$> (Move <$> (newIORef 0) <*> (newIORef 0)) <*> return state
                 let bg () =
                        ifM (fmap not (readIORef (_ended state)))
                            (do print_state state
                                join $ apply_move <$> (play state) <*> return state
                                eval0 state
                                print_state state
                                ifM (fmap not (readIORef (_ended state)))
                                    (do join $ apply_move <$> (play state) <*> return state
                                        eval0 state
                                        bg ())
                                    (bg ()))
                            (do print_state state
                                printf "%d\n" =<< ((readIORef (_note state))::IO Int)
                                bf (i + 1)) in
                        bg ()
         else return () in
         bf 0




<|start_filename|>out/euler10.groovy<|end_filename|>
import java.util.*

int eratostene(int[] t, int max0)
{
  int sum = 0
  for (int i = 2; i < max0; i++)
      if (t[i] == i)
      {
          sum += i
          if (max0.intdiv(i) > i)
          {
              int j = i * i
              while (j < max0 && j > 0)
              {
                  t[j] = 0
                  j += i
              }
          }
      }
  return sum
}

int n = 100000
//  normalement on met 2000 000 mais là on se tape des int overflow dans plein de langages 
int[] t = new int[n]
for (int i = 0; i < n; i++)
    t[i] = i
t[1] = 0
System.out.printf("%d\n", eratostene(t, n))



<|start_filename|>out/sumDiv.java<|end_filename|>
import java.util.*;

public class sumDiv
{
  static Scanner scanner = new Scanner(System.in);
  static void foo()
  {
    int a = 0;
    //  test 
    a++;
    //  test 2 
  }
  static void foo2()
  {
    
  }
  static void foo3()
  {
    if (1 == 1)
    {
        
    }
  }
  static int sumdiv(int n)
  {
    //  On désire renvoyer la somme des diviseurs 
    int out0 = 0;
    //  On déclare un entier qui contiendra la somme 
    for (int i = 1; i <= n; i++)
        //  La boucle : i est le diviseur potentiel
        if (n % i == 0)
        {
            //  Si i divise 
            out0 += i;
            //  On incrémente 
        }
        else
        {
            //  nop 
        }
    return out0;
    // On renvoie out
  }
  public static void main(String args[])
  {
    //  Programme principal 
    int n = 0;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      n = -scanner.nextInt();
    }else{
      n = scanner.nextInt();
    }
    //  Lecture de l'entier 
    System.out.print(sumdiv(n));
  }
  
}



<|start_filename|>out/aaa_12strings.groovy<|end_filename|>
import java.util.*



print("tada ' \" \n\r\t \$ & todo\n\n{foo} \\\${blah}\nblah\n")



<|start_filename|>out/euler08.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
buffer =  ""
function readchar()
    if buffer == "" then buffer = io.read("*line") end
    local c = string.byte(buffer)
    buffer = string.sub(buffer, 2, -1)
    return c
end

local i = 1
local last = {}
for j = 0, 4 do
    local c = readchar()
    local d = c - 48
    i = i * d
    last[j + 1] = d
end
local max0 = i
local index = 0
local nskipdiv = 0
for k = 1, 995 do
    local e = readchar()
    local f = e - 48
    if f == 0 then
        i = 1
        nskipdiv = 4
    else 
        i = i * f
        if nskipdiv < 0 then
            i = trunc(i / last[index + 1])
        end
        nskipdiv = nskipdiv - 1
    end
    last[index + 1] = f
    index = math.fmod(index + 1, 5)
    max0 = math.max(max0, i)
end
io.write(string.format("%d\n", max0))


<|start_filename|>out/euler02.cpp<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    int a = 1;
    int b = 2;
    int sum = 0;
    while (a < 4000000)
    {
        if (a % 2 == 0)
            sum += a;
        int c = a;
        a = b;
        b += c;
    }
    std::cout << sum << "\n";
}



<|start_filename|>out/aaa_07triplet.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class aaa_07triplet
{
  
  public static void Main(String[] args)
  {
    for (int i = 1; i < 4; i++)
    {
        int[] d = new List<string>(Console.ReadLine().Split(" ".ToCharArray())).ConvertAll(int.Parse).ToArray();
        int a = d[0];
        int b = d[1];
        int c = d[2];
        Console.Write("a = " + a + " b = " + b + "c =" + c + "\n");
    }
    int[] l = new List<string>(Console.ReadLine().Split(" ".ToCharArray())).ConvertAll(int.Parse).ToArray();
    for (int j = 0; j < 10; j++)
        Console.Write(l[j] + "\n");
  }
  
}



<|start_filename|>out/prologin_template_2charline.java<|end_filename|>
import java.util.*;

public class prologin_template_2charline
{
  static Scanner scanner = new Scanner(System.in);
  static int programme_candidat(char[] tableau1, int taille1, char[] tableau2, int taille2)
  {
    int out0 = 0;
    for (int i = 0; i < taille1; i++)
    {
        out0 += (int)(tableau1[i]) * i;
        System.out.print(tableau1[i]);
    }
    System.out.print("--\n");
    for (int j = 0; j < taille2; j++)
    {
        out0 += (int)(tableau2[j]) * j * 100;
        System.out.print(tableau2[j]);
    }
    System.out.print("--\n");
    return out0;
  }
  public static void main(String args[])
  {
    int taille1 = Integer.parseInt(scanner.nextLine());
    char[] tableau1 = scanner.nextLine().toCharArray();
    int taille2 = Integer.parseInt(scanner.nextLine());
    char[] tableau2 = scanner.nextLine().toCharArray();
    System.out.printf("%d\n", programme_candidat(tableau1, taille1, tableau2, taille2));
  }
  
}



<|start_filename|>out/euler08.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int max2_(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}
int main(void) {
    int k, j;
    char e, c;
    int i = 1;
    int *last = calloc(5, sizeof(int));
    for (j = 0; j < 5; j++)
    {
        scanf("%c", &c);
        int d = (int)(c) - (int)('0');
        i *= d;
        last[j] = d;
    }
    int max0 = i;
    int index = 0;
    int nskipdiv = 0;
    for (k = 1; k < 996; k++)
    {
        scanf("%c", &e);
        int f = (int)(e) - (int)('0');
        if (f == 0)
        {
            i = 1;
            nskipdiv = 4;
        }
        else
        {
            i *= f;
            if (nskipdiv < 0)
                i /= last[index];
            nskipdiv--;
        }
        last[index] = f;
        index = (index + 1) % 5;
        max0 = max2_(max0, i);
    }
    printf("%d\n", max0);
    return 0;
}




<|start_filename|>out/dichoexp.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int exp0(int a, int b)
{
  if (b == 0)
      return 1
  if (b % 2 == 0)
  {
      int o = exp0(a, b.intdiv(2))
      return o * o
  }
  else
      return a * exp0(a, b - 1)
}
@Field Scanner scanner = new Scanner(System.in)
int a = 0
int b = 0
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  a = -scanner.nextInt()
}else{
  a = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  b = -scanner.nextInt()
}else{
  b = scanner.nextInt()
}
print(exp0(a, b))



<|start_filename|>out/npi.cs<|end_filename|>
using System;

public class npi
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static char readChar(){
  char out_ = readChar_();
  consommeChar();
  return out_;
}
static void stdin_sep(){
  do{
    if (eof) return;
    char c = readChar_();
    if (c == ' ' || c == '\n' || c == '\t' || c == '\r'){
      consommeChar();
    }else{
      return;
    }
  } while(true);
}
static int readInt(){
  int i = 0;
  char s = readChar_();
  int sign = 1;
  if (s == '-'){
    sign = -1;
    consommeChar();
  }
  do{
    char c = readChar_();
    if (c <= '9' && c >= '0'){
      i = i * 10 + c - '0';
      consommeChar();
    }else{
      return i * sign;
    }
  } while(true);
} 
  static bool is_number(char c)
  {
    return (int)(c) <= (int)('9') && (int)(c) >= (int)('0');
  }
  
  /*
Notation polonaise inversée, ce test permet d'évaluer une expression écrite en NPI
*/
  static int npi0(char[] str, int len)
  {
    int[] stack = new int[len];
    for (int i = 0; i < len; i++)
        stack[i] = 0;
    int ptrStack = 0;
    int ptrStr = 0;
    while (ptrStr < len)
        if (str[ptrStr] == (char)32)
            ptrStr++;
        else if (is_number(str[ptrStr]))
        {
            int num = 0;
            while (str[ptrStr] != (char)32)
            {
                num = num * 10 + (int)(str[ptrStr]) - (int)('0');
                ptrStr++;
            }
            stack[ptrStack] = num;
            ptrStack++;
        }
        else if (str[ptrStr] == (char)43)
        {
            stack[ptrStack - 2] += stack[ptrStack - 1];
            ptrStack--;
            ptrStr++;
        }
    return stack[0];
  }
  
  public static void Main(String[] args)
  {
    int len = 0;
    len = readInt();
    stdin_sep();
    char[] tab = new char[len];
    for (int i = 0; i < len; i++)
    {
        char tmp = (char)0;
        tmp = readChar();
        tab[i] = tmp;
    }
    int result = npi0(tab, len);
    Console.Write(result);
  }
  
}



<|start_filename|>out/min4.go<|end_filename|>
package main
import "fmt"
func min2_(a int, b int) int{
  if a < b {
      return a
  } else {
      return b
  }
}
func main() {
  fmt.Printf("%d %d %d %d %d %d\n%d %d %d %d %d %d\n%d %d %d %d %d %d\n%d %d %d %d %d %d\n", min2_(min2_(min2_(1, 2), 3), 4), min2_(min2_(min2_(1, 2), 4), 3), min2_(min2_(min2_(1, 3), 2), 4), min2_(min2_(min2_(1, 3), 4), 2), min2_(min2_(min2_(1, 4), 2), 3), min2_(min2_(min2_(1, 4), 3), 2), min2_(min2_(min2_(2, 1), 3), 4), min2_(min2_(min2_(2, 1), 4), 3), min2_(min2_(min2_(2, 3), 1), 4), min2_(min2_(min2_(2, 3), 4), 1), min2_(min2_(min2_(2, 4), 1), 3), min2_(min2_(min2_(2, 4), 3), 1), min2_(min2_(min2_(3, 1), 2), 4), min2_(min2_(min2_(3, 1), 4), 2), min2_(min2_(min2_(3, 2), 1), 4), min2_(min2_(min2_(3, 2), 4), 1), min2_(min2_(min2_(3, 4), 1), 2), min2_(min2_(min2_(3, 4), 2), 1), min2_(min2_(min2_(4, 1), 2), 3), min2_(min2_(min2_(4, 1), 3), 2), min2_(min2_(min2_(4, 2), 1), 3), min2_(min2_(min2_(4, 2), 3), 1), min2_(min2_(min2_(4, 3), 1), 2), min2_(min2_(min2_(4, 3), 2), 1))
}



<|start_filename|>out/cambriolage.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure cambriolage is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
function max2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a > b
  then
    return a;
  else
    return b;
  end if;
end;
type c is Array (Integer range <>) of Integer;
type c_PTR is access c;
type d is Array (Integer range <>) of c_PTR;
type d_PTR is access d;
function nbPassePartout(n : in Integer; passepartout : in d_PTR; m : in Integer; serrures : in d_PTR) return Integer is
  pp : c_PTR;
  max_recent_pp : Integer;
  max_recent : Integer;
  max_ancient_pp : Integer;
  max_ancient : Integer;
begin
  max_ancient := 0;
  max_recent := 0;
  for i in integer range 0..m - 1 loop
    if serrures(i)(0) = (-1) and then serrures(i)(1) > max_ancient
    then
      max_ancient := serrures(i)(1);
    end if;
    if serrures(i)(0) = 1 and then serrures(i)(1) > max_recent
    then
      max_recent := serrures(i)(1);
    end if;
  end loop;
  max_ancient_pp := 0;
  max_recent_pp := 0;
  for i in integer range 0..n - 1 loop
    pp := passepartout(i);
    if pp(0) >= max_ancient and then pp(1) >= max_recent
    then
      return 1;
    end if;
    max_ancient_pp := max2_0(max_ancient_pp, pp(0));
    max_recent_pp := max2_0(max_recent_pp, pp(1));
  end loop;
  if max_ancient_pp >= max_ancient and then max_recent_pp >= max_recent
  then
    return 2;
  else
    return 0;
  end if;
end;

  serrures : d_PTR;
  passepartout : d_PTR;
  out_0 : Integer;
  out1 : c_PTR;
  out01 : Integer;
  out0 : c_PTR;
  n : Integer;
  m : Integer;
begin
  Get(n);
  SkipSpaces;
  passepartout := new d (0..n - 1);
  for i in integer range 0..n - 1 loop
    out0 := new c (0..1);
    for j in integer range 0..1 loop
      Get(out01);
      SkipSpaces;
      out0(j) := out01;
    end loop;
    passepartout(i) := out0;
  end loop;
  Get(m);
  SkipSpaces;
  serrures := new d (0..m - 1);
  for k in integer range 0..m - 1 loop
    out1 := new c (0..1);
    for l in integer range 0..1 loop
      Get(out_0);
      SkipSpaces;
      out1(l) := out_0;
    end loop;
    serrures(k) := out1;
  end loop;
  PInt(nbPassePartout(n, passepartout, m, serrures));
end;


<|start_filename|>out/bigints.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init_withenv :: Int -> ( Int -> env -> IO(env, tabcontent)) -> env -> IO(env, IOArray Int tabcontent)
array_init_withenv len f env =
  do (env, li) <- g 0 env
     (,) env <$> newListArray (0, len - 1) li
  where g i env =
           if i == len
           then return (env, [])
           else do (env', item) <- f i env
                   (env'', li) <- g (i+1) env'
                   return (env'', item:li)
array_init len f = fmap snd (array_init_withenv len (\x () -> fmap ((,) ()) (f x)) ())

main :: IO ()
data Bigint = Bigint {
                        _bigint_sign :: IORef Bool,
                        _bigint_len :: IORef Int,
                        _bigint_chiffres :: IORef (IOArray Int Int)
                        }
  deriving Eq


read_bigint len =
  do chiffres <- array_init len (\ j ->
                                   do c <- getChar
                                      return (ord c))
     let e = (len - 1) `quot` 2
     let f i =
           if i <= e
           then do tmp <- readIOA chiffres i
                   writeIOA chiffres i =<< (readIOA chiffres (len - 1 - i))
                   writeIOA chiffres (len - 1 - i) tmp
                   f (i + 1)
           else (Bigint <$> (newIORef True) <*> (newIORef len) <*> (newIORef chiffres)) in
           f 0

print_bigint a =
  do ifM (fmap not (readIORef (_bigint_sign a)))
         (printf "%c" ('-' :: Char) :: IO ())
         (return ())
     g <- ((-) <$> (readIORef (_bigint_len a)) <*> (return 1))
     let h i =
           if i <= g
           then do printf "%d" =<< (join $ readIOA <$> (readIORef (_bigint_chiffres a)) <*> ((-) <$> ((-) <$> (readIORef (_bigint_len a)) <*> (return 1)) <*> (return i)) :: IO Int)
                   h (i + 1)
           else return () in
           h 0

bigint_eq a b =
  {- Renvoie vrai si a = b -}
  ifM ((/=) <$> (readIORef (_bigint_sign a)) <*> (readIORef (_bigint_sign b)))
      (return False)
      (ifM ((/=) <$> (readIORef (_bigint_len a)) <*> (readIORef (_bigint_len b)))
           (return False)
           (do m <- ((-) <$> (readIORef (_bigint_len a)) <*> (return 1))
               let o i =
                     if i <= m
                     then ifM ((/=) <$> (join $ readIOA <$> (readIORef (_bigint_chiffres a)) <*> return i) <*> (join $ readIOA <$> (readIORef (_bigint_chiffres b)) <*> return i))
                              (return False)
                              (o (i + 1))
                     else return True in
                     o 0))

bigint_gt a b =
  {- Renvoie vrai si a > b -}
  ifM ((readIORef (_bigint_sign a)) <&&> (fmap not (readIORef (_bigint_sign b))))
      (return True)
      (ifM ((fmap not (readIORef (_bigint_sign a))) <&&> (readIORef (_bigint_sign b)))
           (return False)
           (ifM ((>) <$> (readIORef (_bigint_len a)) <*> (readIORef (_bigint_len b)))
                (readIORef (_bigint_sign a))
                (ifM ((<) <$> (readIORef (_bigint_len a)) <*> (readIORef (_bigint_len b)))
                     (fmap not (readIORef (_bigint_sign a)))
                     (do p <- ((-) <$> (readIORef (_bigint_len a)) <*> (return 1))
                         let q i =
                               if i <= p
                               then do j <- ((-) <$> ((-) <$> (readIORef (_bigint_len a)) <*> (return 1)) <*> (return i))
                                       ifM ((>) <$> (join $ readIOA <$> (readIORef (_bigint_chiffres a)) <*> return j) <*> (join $ readIOA <$> (readIORef (_bigint_chiffres b)) <*> return j))
                                           (readIORef (_bigint_sign a))
                                           (ifM ((<) <$> (join $ readIOA <$> (readIORef (_bigint_chiffres a)) <*> return j) <*> (join $ readIOA <$> (readIORef (_bigint_chiffres b)) <*> return j))
                                                (fmap not (readIORef (_bigint_sign a)))
                                                (q (i + 1)))
                               else return True in
                               q 0))))

bigint_lt a b =
  fmap not (bigint_gt a b)

add_bigint_positif a b =
  {- Une addition ou on en a rien a faire des signes -}
  do len <- (((+) 1) <$> ((max <$> (readIORef (_bigint_len a)) <*> (readIORef (_bigint_len b)))))
     (array_init_withenv len (\ i r ->
                                do s <- ifM (((<) i) <$> (readIORef (_bigint_len a)))
                                            (((+) r) <$> (join $ readIOA <$> (readIORef (_bigint_chiffres a)) <*> return i))
                                            (return r)
                                   u <- ifM (((<) i) <$> (readIORef (_bigint_len b)))
                                            (((+) s) <$> (join $ readIOA <$> (readIORef (_bigint_chiffres b)) <*> return i))
                                            (return s)
                                   let v = u `quot` 10
                                   let w = u `rem` 10
                                   return (v, w)) 0) >>= (\ (x, chiffres) ->
                                                           let y z =
                                                                 ifM ((return (z > 0)) <&&> (((==) 0) <$> (readIOA chiffres (z - 1))))
                                                                     (do let ba = z - 1
                                                                         y ba)
                                                                     (Bigint <$> (newIORef True) <*> (newIORef z) <*> (newIORef chiffres)) in
                                                                 y len)

sub_bigint_positif a b =
  {- Une soustraction ou on en a rien a faire des signes
Pré-requis : a > b
-}
  do len <- readIORef (_bigint_len a)
     (array_init_withenv len (\ i bc ->
                                do tmp <- (((+) bc) <$> (join $ readIOA <$> (readIORef (_bigint_chiffres a)) <*> return i))
                                   be <- ifM (((<) i) <$> (readIORef (_bigint_len b)))
                                             (((-) tmp) <$> (join $ readIOA <$> (readIORef (_bigint_chiffres b)) <*> return i))
                                             (return tmp)
                                   (\ (bh, bi) ->
                                     return (bh, bi)) (if be < 0
                                                       then let bf = be + 10
                                                                     in let bg = - 1
                                                                                 in (bg, bf)
                                                       else (0, be))) 0) >>= (\ (bj, chiffres) ->
                                                                               let bk bl =
                                                                                      ifM ((return (bl > 0)) <&&> (((==) 0) <$> (readIOA chiffres (bl - 1))))
                                                                                          (do let bm = bl - 1
                                                                                              bk bm)
                                                                                          (Bigint <$> (newIORef True) <*> (newIORef bl) <*> (newIORef chiffres)) in
                                                                                      bk len)

neg_bigint a =
  (Bigint <$> ((fmap not (readIORef (_bigint_sign a))) >>= newIORef) <*> ((readIORef (_bigint_len a)) >>= newIORef) <*> ((readIORef (_bigint_chiffres a)) >>= newIORef))

add_bigint a b =
  ifM ((==) <$> (readIORef (_bigint_sign a)) <*> (readIORef (_bigint_sign b)))
      (ifM (readIORef (_bigint_sign a))
           (add_bigint_positif a b)
           ((add_bigint_positif a b) >>= neg_bigint))
      (ifM (readIORef (_bigint_sign a))
           {- a positif, b negatif -}
           (ifM (bigint_gt a =<< (neg_bigint b))
                (sub_bigint_positif a b)
                ((sub_bigint_positif b a) >>= neg_bigint))
           {- a negatif, b positif -}
           (ifM (join $ bigint_gt <$> (neg_bigint a) <*> return b)
                ((sub_bigint_positif a b) >>= neg_bigint)
                (sub_bigint_positif b a)))

sub_bigint a b =
  add_bigint a =<< (neg_bigint b)

mul_bigint_cp a b =
  {- Cet algorithm est quadratique.
C'est le même que celui qu'on enseigne aux enfants en CP.
D'ou le nom de la fonction. -}
  do len <- (((+) 1) <$> ((+) <$> (readIORef (_bigint_len a)) <*> (readIORef (_bigint_len b))))
     chiffres <- array_init len (\ k ->
                                   return 0)
     bn <- ((-) <$> (readIORef (_bigint_len a)) <*> (return 1))
     let bo i =
            if i <= bn
            then do bs <- ((-) <$> (readIORef (_bigint_len b)) <*> (return 1))
                    let bt j bu =
                           if j <= bs
                           then do writeIOA chiffres (i + j) =<< ((+) <$> (readIOA chiffres (i + j)) <*> (((+) bu) <$> ((*) <$> (join $ readIOA <$> (readIORef (_bigint_chiffres b)) <*> return j) <*> (join $ readIOA <$> (readIORef (_bigint_chiffres a)) <*> return i))))
                                   bv <- (quot <$> (readIOA chiffres (i + j)) <*> (return 10))
                                   writeIOA chiffres (i + j) =<< (rem <$> (readIOA chiffres (i + j)) <*> (return 10))
                                   bt (j + 1) bv
                           else do join $ writeIOA chiffres <$> (((+) i) <$> (readIORef (_bigint_len b))) <*> (((+) bu) <$> (readIOA chiffres =<< (((+) i) <$> (readIORef (_bigint_len b)))))
                                   bo (i + 1) in
                           bt 0 0
            else do join $ writeIOA chiffres <$> ((+) <$> (readIORef (_bigint_len a)) <*> (readIORef (_bigint_len b))) <*> (quot <$> (readIOA chiffres =<< ((-) <$> ((+) <$> (readIORef (_bigint_len a)) <*> (readIORef (_bigint_len b))) <*> (return 1))) <*> (return 10))
                    join $ writeIOA chiffres <$> ((-) <$> ((+) <$> (readIORef (_bigint_len a)) <*> (readIORef (_bigint_len b))) <*> (return 1)) <*> (rem <$> (readIOA chiffres =<< ((-) <$> ((+) <$> (readIORef (_bigint_len a)) <*> (readIORef (_bigint_len b))) <*> (return 1))) <*> (return 10))
                    let bp l bq =
                           if l <= 2
                           then ifM ((return (bq /= 0)) <&&> (((==) 0) <$> (readIOA chiffres (bq - 1))))
                                    (do let br = bq - 1
                                        bp (l + 1) br)
                                    (bp (l + 1) bq)
                           else (Bigint <$> (((==) <$> (readIORef (_bigint_sign a)) <*> (readIORef (_bigint_sign b))) >>= newIORef) <*> (newIORef bq) <*> (newIORef chiffres)) in
                           bp 0 len in
            bo 0

bigint_premiers_chiffres a i =
  do len <- ((min <$> (return i) <*> (readIORef (_bigint_len a))))
     let bw bx =
            ifM ((return (bx /= 0)) <&&> (((==) 0) <$> (join $ readIOA <$> (readIORef (_bigint_chiffres a)) <*> return (bx - 1))))
                (do let by = bx - 1
                    bw by)
                (Bigint <$> ((readIORef (_bigint_sign a)) >>= newIORef) <*> (newIORef bx) <*> ((readIORef (_bigint_chiffres a)) >>= newIORef)) in
            bw len

bigint_shift a i =
  do chiffres <- join $ array_init <$> (((+) i) <$> (readIORef (_bigint_len a))) <*> return (\ k ->
                                                                                               if k >= i
                                                                                               then join $ readIOA <$> (readIORef (_bigint_chiffres a)) <*> return (k - i)
                                                                                               else return 0)
     (Bigint <$> ((readIORef (_bigint_sign a)) >>= newIORef) <*> ((((+) i) <$> (readIORef (_bigint_len a))) >>= newIORef) <*> (newIORef chiffres))

mul_bigint aa bb =
  ifM (((==) 0) <$> (readIORef (_bigint_len aa)))
      (return aa)
      (ifM (((==) 0) <$> (readIORef (_bigint_len bb)))
           (return bb)
           (ifM ((((>) 3) <$> (readIORef (_bigint_len aa))) <||> (((>) 3) <$> (readIORef (_bigint_len bb))))
                (mul_bigint_cp aa bb)
                {- Algorithme de Karatsuba -}
                (do split <- (quot <$> ((min <$> (readIORef (_bigint_len aa)) <*> (readIORef (_bigint_len bb)))) <*> (return 2))
                    a <- bigint_shift aa (- split)
                    b <- bigint_premiers_chiffres aa split
                    c <- bigint_shift bb (- split)
                    d <- bigint_premiers_chiffres bb split
                    amoinsb <- sub_bigint a b
                    cmoinsd <- sub_bigint c d
                    ac <- mul_bigint a c
                    bd <- mul_bigint b d
                    amoinsbcmoinsd <- mul_bigint amoinsb cmoinsd
                    acdec <- bigint_shift ac (2 * split)
                    join $ add_bigint <$> (add_bigint acdec bd) <*> (join $ bigint_shift <$> (join $ sub_bigint <$> (add_bigint ac bd) <*> return amoinsbcmoinsd) <*> return split))))

log10 a =
  let bz ca cb =
         if ca >= 10
         then do let cc = ca `quot` 10
                 let cd = cb + 1
                 bz cc cd
         else return cb in
         bz a 1

bigint_of_int i =
  do size <- log10 i
     let ce = if i == 0
              then 0
              else size
     t <- array_init ce (\ j ->
                           return 0)
     let cf k cg =
            if k <= ce - 1
            then do writeIOA t k (cg `rem` 10)
                    let ch = cg `quot` 10
                    cf (k + 1) ch
            else (Bigint <$> (newIORef True) <*> (newIORef ce) <*> (newIORef t)) in
            cf 0 i

fact_bigint a =
  do one <- bigint_of_int 1
     let ci cj ck =
            ifM (fmap not (bigint_eq cj one))
                (do cl <- mul_bigint cj ck
                    cm <- sub_bigint cj one
                    ci cm cl)
                (return ck) in
            ci a one

sum_chiffres_bigint a =
  do cn <- ((-) <$> (readIORef (_bigint_len a)) <*> (return 1))
     let co i cp =
            if i <= cn
            then do cq <- (((+) cp) <$> (join $ readIOA <$> (readIORef (_bigint_chiffres a)) <*> return i))
                    co (i + 1) cq
            else return cp in
            co 0 0

euler20 () =
  do a <- bigint_of_int 15
     {- normalement c'est 100 -}
     do cr <- fact_bigint a
        sum_chiffres_bigint cr

bigint_exp a b =
  if b == 1
  then return a
  else if (b `rem` 2) == 0
       then join $ bigint_exp <$> (mul_bigint a a) <*> return (b `quot` 2)
       else mul_bigint a =<< (bigint_exp a (b - 1))

bigint_exp_10chiffres a b =
  do cs <- bigint_premiers_chiffres a 10
     if b == 1
     then return cs
     else if (b `rem` 2) == 0
          then join $ bigint_exp_10chiffres <$> (mul_bigint cs cs) <*> return (b `quot` 2)
          else mul_bigint cs =<< (bigint_exp_10chiffres cs (b - 1))

euler48 () =
  do sum <- bigint_of_int 0
     let ct i cu =
            if i <= 100
            then {- 1000 normalement -}
                 do ib <- bigint_of_int i
                    ibeib <- bigint_exp_10chiffres ib i
                    cv <- add_bigint cu ibeib
                    cw <- bigint_premiers_chiffres cv 10
                    ct (i + 1) cw
            else do printf "euler 48 = " :: IO ()
                    print_bigint cu
                    printf "\n" :: IO () in
            ct 1 sum

euler16 () =
  do a <- bigint_of_int 2
     cx <- bigint_exp a 100
     {- 1000 normalement -}
     sum_chiffres_bigint cx

euler25 () =
  do a <- bigint_of_int 1
     b <- bigint_of_int 1
     let cy cz da db =
            ifM (((>) 100) <$> (readIORef (_bigint_len da)))
                {- 1000 normalement -}
                (do c <- add_bigint cz da
                    let dc = db + 1
                    cy da c dc)
                (return db) in
            cy a b 2

euler29 () =
  do a_bigint <- array_init (5 + 1) (\ j ->
                                       bigint_of_int (j * j))
     a0_bigint <- array_init (5 + 1) (\ j2 ->
                                        bigint_of_int j2)
     b <- array_init (5 + 1) (\ k ->
                                return 2)
     let dd de df =
            if de
            then do min0 <- readIOA a0_bigint 0
                    let dg i dh di =
                           if i <= 5
                           then ifM (((>=) 5) <$> (readIOA b i))
                                    (if dh
                                     then ifM (join $ bigint_lt <$> (readIOA a_bigint i) <*> return di)
                                              (do dm <- readIOA a_bigint i
                                                  dg (i + 1) dh dm)
                                              (dg (i + 1) dh di)
                                     else do dl <- readIOA a_bigint i
                                             dg (i + 1) True dl)
                                    (dg (i + 1) dh di)
                           else if dh
                                then do let dj = df + 1
                                        let dk l =
                                               if l <= 5
                                               then ifM ((join $ bigint_eq <$> (readIOA a_bigint l) <*> return di) <&&> (((>=) 5) <$> (readIOA b l)))
                                                        (do writeIOA b l =<< (((+) 1) <$> (readIOA b l))
                                                            writeIOA a_bigint l =<< (join $ mul_bigint <$> (readIOA a_bigint l) <*> (readIOA a0_bigint l))
                                                            dk (l + 1))
                                                        (dk (l + 1))
                                               else dd dh dj in
                                               dk 2
                                else dd dh df in
                           dg 2 False min0
            else return df in
            dd True 0

main =
  do printf "%d\n" =<< ((euler29 ())::IO Int)
     sum <- read_bigint 50
     let dn i dp =
            if i <= 100
            then do skip_whitespaces
                    tmp <- read_bigint 50
                    dq <- add_bigint dp tmp
                    dn (i + 1) dq
            else do printf "euler13 = " :: IO ()
                    print_bigint dp
                    join $ printf "\neuler25 = %d\neuler16 = %d\n" <$> ((euler25 ())::IO Int) <*> ((euler16 ())::IO Int)
                    euler48 ()
                    printf "euler20 = %d\n" =<< ((euler20 ())::IO Int)
                    a <- bigint_of_int 999999
                    b <- bigint_of_int 9951263
                    print_bigint a
                    printf ">>1=" :: IO ()
                    (bigint_shift a (- 1)) >>= print_bigint
                    printf "\n" :: IO ()
                    print_bigint a
                    printf "*" :: IO ()
                    print_bigint b
                    printf "=" :: IO ()
                    (mul_bigint a b) >>= print_bigint
                    printf "\n" :: IO ()
                    print_bigint a
                    printf "*" :: IO ()
                    print_bigint b
                    printf "=" :: IO ()
                    (mul_bigint_cp a b) >>= print_bigint
                    printf "\n" :: IO ()
                    print_bigint a
                    printf "+" :: IO ()
                    print_bigint b
                    printf "=" :: IO ()
                    (add_bigint a b) >>= print_bigint
                    printf "\n" :: IO ()
                    print_bigint b
                    printf "-" :: IO ()
                    print_bigint a
                    printf "=" :: IO ()
                    (sub_bigint b a) >>= print_bigint
                    printf "\n" :: IO ()
                    print_bigint a
                    printf "-" :: IO ()
                    print_bigint b
                    printf "=" :: IO ()
                    (sub_bigint a b) >>= print_bigint
                    printf "\n" :: IO ()
                    print_bigint a
                    printf ">" :: IO ()
                    print_bigint b
                    printf "=" :: IO ()
                    ifM (bigint_gt a b)
                        (printf "True" :: IO ())
                        (printf "False" :: IO ())
                    printf "\n" :: IO () in
            dn 2 sum




<|start_filename|>out/euler10.js<|end_filename|>
var util = require("util");
function eratostene(t, max0){
    var sum = 0;
    for (var i = 2; i < max0; i++)
        if (t[i] == i)
        {
            sum += i;
            if (~~(max0 / i) > i)
            {
                var j = i * i;
                while (j < max0 && j > 0)
                {
                    t[j] = 0;
                    j += i;
                }
            }
        }
    return sum;
}
var n = 100000;
//  normalement on met 2000 000 mais là on se tape des int overflow dans plein de langages 
var t = new Array(n);
for (var i = 0; i < n; i++)
    t[i] = i;
t[1] = 0;
util.print(eratostene(t, n), "\n");



<|start_filename|>out/record3.cc<|end_filename|>
#include <iostream>
#include <vector>
struct toto {
    int foo;
    int bar;
    int blah;
};


toto * mktoto(int v1) {
    toto * t = new toto();
        t->foo = v1;
        t->bar = 0;
        t->blah = 0;;
    return t;
}


int result(std::vector<toto *> * t, int len) {
    int out0 = 0;
    for (int j = 0; j < len; j++)
    {
        t->at(j)->blah++;
        out0 = out0 + t->at(j)->foo + t->at(j)->blah * t->at(j)->bar + t->at(j)->bar * t->at(j)->foo;
    }
    return out0;
}

int main() {
    std::vector<toto *> *t = new std::vector<toto *>( 4 );
    for (int i = 0; i < 4; i++)
        t->at(i) = mktoto(i);
    std::cin >> t->at(0)->bar >> t->at(1)->blah >> std::noskipws;
    int titi = result(t, 4);
    std::cout << titi << t->at(2)->blah;
}



<|start_filename|>out/euler26.groovy<|end_filename|>
import java.util.*

int periode(int[] restes, int len, int a, int b)
{
  while (a != 0)
  {
      int chiffre = a.intdiv(b)
      int reste = a % b
      for (int i = 0; i < len; i++)
          if (restes[i] == reste)
              return len - i
      restes[len] = reste
      len++
      a = reste * 10
  }
  return 0
}

int[] t = new int[1000]
for (int j = 0; j < 1000; j++)
    t[j] = 0
int m = 0
int mi = 0
for (int i = 1; i < 1001; i++)
{
    int p = periode(t, 0, 1, i)
    if (p > m)
    {
        mi = i
        m = p
    }
}
System.out.printf("%d\n%d\n", mi, m)



<|start_filename|>out/euler50.groovy<|end_filename|>
import java.util.*

int eratostene(int[] t, int max0)
{
  int n = 0
  for (int i = 2; i < max0; i++)
      if (t[i] == i)
      {
          n++
          if (max0.intdiv(i) > i)
          {
              int j = i * i
              while (j < max0 && j > 0)
              {
                  t[j] = 0
                  j += i
              }
          }
      }
  return n
}

int maximumprimes = 1000001
int[] era = new int[maximumprimes]
for (int j = 0; j < maximumprimes; j++)
    era[j] = j
int nprimes = eratostene(era, maximumprimes)
int[] primes = new int[nprimes]
for (int o = 0; o < nprimes; o++)
    primes[o] = 0
int l = 0
for (int k = 2; k < maximumprimes; k++)
    if (era[k] == k)
    {
        primes[l] = k
        l++
    }
System.out.printf("%d == %d\n", l, nprimes)
int[] sum = new int[nprimes]
for (int i_ = 0; i_ < nprimes; i_++)
    sum[i_] = primes[i_]
int maxl = 0
boolean process = true
int stop = maximumprimes - 1
int len = 1
int resp = 1
while (process)
{
    process = false
    for (int i = 0; i <= stop; i++)
        if (i + len < nprimes)
        {
            sum[i] += primes[i + len]
            if (maximumprimes > sum[i])
            {
                process = true
                if (era[sum[i]] == sum[i])
                {
                    maxl = len
                    resp = sum[i]
                }
            }
            else
                stop = Math.min(stop, i)
        }
    len++
}
System.out.printf("%d\n%d\n", resp, maxl)



<|start_filename|>out/brainfuck_compiler.cc<|end_filename|>
#include <iostream>
#include <vector>
/*
Ce test permet de tester les macros
C'est un compilateur brainfuck qui lit sur l'entrée standard pendant la compilation
et qui produit les macros metalang correspondante
*/
int main() {
    char input = ' ';
    int current_pos = 500;
    std::vector<int> *mem = new std::vector<int>( 1000 );
    std::fill(mem->begin(), mem->end(), 0);
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    current_pos++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    mem->at(current_pos)++;
    while (mem->at(current_pos) != 0)
    {
        mem->at(current_pos)--;
        current_pos--;
        mem->at(current_pos)++;
        std::cout << (char)(mem->at(current_pos));
        current_pos++;
    }
}



<|start_filename|>out/euler10.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function eratostene (t, max0)
  local sum = 0
  for i = 2, max0 - 1 do
      if t[i + 1] == i then
          sum = sum + i
          if trunc(max0 / i) > i then
              local j = i * i
              while j < max0 and j > 0 do
                  t[j + 1] = 0
                  j = j + i
              end
          end
      end
  end
  return sum
end

local n = 100000
--[[ normalement on met 2000 000 mais là on se tape des int overflow dans plein de langages --]]
local t = {}
for i = 0, n - 1 do
    t[i + 1] = i
end
t[2] = 0
io.write(string.format("%d\n", eratostene(t, n)))


<|start_filename|>out/prologin_template_2charline2.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure prologin_template_2charline2 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PChar(c : in Character) is
begin
  Character'Write (Text_Streams.Stream (Current_Output), c);
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type c is Array (Integer range <>) of Character;
type c_PTR is access c;
function programme_candidat(tableau1 : in c_PTR; taille1 : in Integer; tableau2 : in c_PTR; taille2 : in Integer) return Integer is
  out0 : Integer;
begin
  out0 := 0;
  for i in integer range 0..taille1 - 1 loop
    out0 := out0 + Character'Pos(tableau1(i)) * i;
    PChar(tableau1(i));
  end loop;
  PString(new char_array'( To_C("--" & Character'Val(10))));
  for j in integer range 0..taille2 - 1 loop
    out0 := out0 + Character'Pos(tableau2(j)) * j * 100;
    PChar(tableau2(j));
  end loop;
  PString(new char_array'( To_C("--" & Character'Val(10))));
  return out0;
end;

  taille2 : Integer;
  taille1 : Integer;
  tableau2 : c_PTR;
  tableau1 : c_PTR;
begin
  Get(taille1);
  SkipSpaces;
  Get(taille2);
  SkipSpaces;
  tableau1 := new c (0..taille1 - 1);
  for a in integer range 0..taille1 - 1 loop
    Get(tableau1(a));
  end loop;
  SkipSpaces;
  tableau2 := new c (0..taille2 - 1);
  for b in integer range 0..taille2 - 1 loop
    Get(tableau2(b));
  end loop;
  SkipSpaces;
  PInt(programme_candidat(tableau1, taille1, tableau2, taille2));
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/record2.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
struct
  cell% field ->foo
  cell% field ->bar
  cell% field ->blah
end-struct toto%


: mktoto { v1 }
  toto% %allot { t }
  v1 t ->foo !
  0 t ->bar !
  0 t ->blah !
  t exit
;


: result { t }
  t ->blah @ 1 + t ->blah !
  t ->foo @ t ->blah @ t ->bar @ * + t ->bar @ t ->foo @ * + exit
;

: main
  4 mktoto { t }
  read-int t ->bar !
  skipspaces
  read-int t ->blah !
  t result s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/countchar.cpp<|end_filename|>
#include <iostream>
#include <vector>

int nth(std::vector<char>& tab, char tofind, int len) {
    int out0 = 0;
    for (int i = 0; i < len; i++)
        if (tab[i] == tofind)
            out0++;
    return out0;
}

int main() {
    int len = 0;
    std::cin >> len;
    char tofind = '\u0000';
    std::cin >> tofind;
    std::vector<char> tab( len );
    for (int i = 0; i < len; i++)
    {
        char tmp = '\u0000';
        std::cin >> tmp >> std::noskipws;
        tab[i] = tmp;
    }
    int result = nth(tab, tofind, len);
    std::cout << result;
}



<|start_filename|>out/aaa_08tuple.cpp<|end_filename|>
#include <iostream>
#include <vector>
struct tuple_int_int {
    int tuple_int_int_field_0;
    int tuple_int_int_field_1;
};

struct toto {
    tuple_int_int foo;
    int bar;
};

int main() {
    int d, c, bar_;
    std::cin >> bar_ >> c >> d;
    tuple_int_int e;
        e.tuple_int_int_field_0 = c;
        e.tuple_int_int_field_1 = d;;
    toto t;
        t.foo = e;
        t.bar = bar_;;
    tuple_int_int f = t.foo;
    int a = f.tuple_int_int_field_0;
    int b = f.tuple_int_int_field_1;
    std::cout << a << " " << b << " " << t.bar << "\n";
}



<|start_filename|>out/countchar.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int nth(char[] tab, char tofind, int len)
{
  int out0 = 0
  for (int i = 0; i < len; i++)
      if (tab[i] == tofind)
          out0++
  return out0
}
@Field Scanner scanner = new Scanner(System.in)
int len = 0
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  len = -scanner.nextInt()
}else{
  len = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
char tofind = (char)0
tofind = scanner.findWithinHorizon(".", 1).charAt(0)
scanner.findWithinHorizon("[\n\r ]*", 1)
char[] tab = new char[len]
for (int i = 0; i < len; i++)
{
    char tmp = (char)0
    tmp = scanner.findWithinHorizon(".", 1).charAt(0)
    tab[i] = tmp
}
int result = nth(tab, tofind, len)
print(result)



<|start_filename|>out/euler39.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
main =
  do t <- array_init 1001 (\ i ->
                             return 0)
     let d a =
           if a <= 1000
           then let g b =
                      if b <= 1000
                      then do let c2 = a * a + b * b
                              let c = ((floor . sqrt . fromIntegral) c2)
                              if c * c == c2
                              then do let p = a + b + c
                                      if p <= 1000
                                      then do writeIOA t p =<< (((+) 1) <$> (readIOA t p))
                                              g (b + 1)
                                      else g (b + 1)
                              else g (b + 1)
                      else d (a + 1) in
                      g 1
           else let e k f =
                      if k <= 1000
                      then ifM ((>) <$> (readIOA t k) <*> (readIOA t f))
                               (e (k + 1) k)
                               (e (k + 1) f)
                      else printf "%d" (f :: Int) :: IO () in
                      e 1 0 in
           d 1




<|start_filename|>out/euler46.cc<|end_filename|>
#include <iostream>
#include <vector>

int eratostene(std::vector<int> * t, int max0) {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t->at(i) == i)
        {
            n++;
            if (max0 / i > i)
            {
                int j = i * i;
                while (j < max0 && j > 0)
                {
                    t->at(j) = 0;
                    j += i;
                }
            }
        }
    return n;
}

int main() {
    int maximumprimes = 6000;
    std::vector<int> *era = new std::vector<int>( maximumprimes );
    for (int j_ = 0; j_ < maximumprimes; j_++)
        era->at(j_) = j_;
    int nprimes = eratostene(era, maximumprimes);
    std::vector<int> *primes = new std::vector<int>( nprimes );
    std::fill(primes->begin(), primes->end(), 0);
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era->at(k) == k)
        {
            primes->at(l) = k;
            l++;
        }
    std::cout << l << " == " << nprimes << "\n";
    std::vector<bool> *canbe = new std::vector<bool>( maximumprimes );
    std::fill(canbe->begin(), canbe->end(), false);
    for (int i = 0; i < nprimes; i++)
        for (int j = 0; j < maximumprimes; j++)
        {
            int n = primes->at(i) + 2 * j * j;
            if (n < maximumprimes)
                canbe->at(n) = true;
        }
    for (int m = 1; m <= maximumprimes; m++)
    {
        int m2 = m * 2 + 1;
        if (m2 < maximumprimes && !canbe->at(m2))
            std::cout << m2 << "\n";
    }
}



<|start_filename|>out/test_enum.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure test_enum is


type stringptr is access all char_array;
Type foo_t is (
  Foo,
   Bar,
   Blah);

  foo_val : foo_t;
begin
  foo_val := Foo;
end;


<|start_filename|>out/euler04.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler04 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

function max2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a > b
  then
    return a;
  else
    return b;
  end if;
end;
--
--
--(a + b * 10 + c * 100) * (d + e * 10 + f * 100) =
--a * d + a * e * 10 + a * f * 100 +
--10 * (b * d + b * e * 10 + b * f * 100)+
--100 * (c * d + c * e * 10 + c * f * 100) =
--
--a * d       + a * e * 10   + a * f * 100 +
--b * d * 10  + b * e * 100  + b * f * 1000 +
--c * d * 100 + c * e * 1000 + c * f * 10000 =
--
--a * d +
--10 * ( a * e + b * d) +
--100 * (a * f + b * e + c * d) +
--(c * e + b * f) * 1000 +
--c * f * 10000
--
--

function chiffre(c : in Integer; m : in Integer) return Integer is
begin
  if c = 0
  then
    return m rem 10;
  else
    return chiffre(c - 1, m / 10);
  end if;
end;

  mul : Integer;
  m : Integer;
begin
  m := 1;
  for a in integer range 0..9 loop
    for f in integer range 1..9 loop
      for d in integer range 0..9 loop
        for c in integer range 1..9 loop
          for b in integer range 0..9 loop
            for e in integer range 0..9 loop
              mul := a * d + 10 * (a * e + b * d) + 100 * (a * f + b * e + c * d) + 1000 * (c * e + b * f) + 10000 * c * f;
              if
              (chiffre(0, mul) = chiffre(5, mul) and then chiffre(1, mul) = chiffre(4, mul)) and then chiffre(2, mul) = chiffre(3, mul)
              then
                m := max2_0(mul, m);
              end if;
            end loop;
          end loop;
        end loop;
      end loop;
    end loop;
  end loop;
  PInt(m);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/aaa_11arrayconst.groovy<|end_filename|>
import java.util.*

void test(int[] tab, int len)
{
  for (int i = 0; i < len; i++)
      System.out.printf("%d ", tab[i])
  print("\n")
}

int[] t = new int[5]
for (int i = 0; i < 5; i++)
    t[i] = 1
test(t, 5)



<|start_filename|>out/sumDiv.fs<|end_filename|>
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
: foo {  }
  0 { a }
  \  test 
  
  a 1 + TO a
  \  test 2 
  
;


: foo2 {  }
  
;


: foo3 {  }
  1 1 =
  IF
    
  THEN
;


: sumdiv { n }
  \  On désire renvoyer la somme des diviseurs 
  
  0 { out0 }
  \  On déclare un entier qui contiendra la somme 
  
  n 1 BEGIN 2dup >= WHILE DUP { i }
    \  La boucle : i est le diviseur potentiel
    
    n i % 0 =
    IF
      \  Si i divise 
      
      out0 i + TO out0
      \  On incrémente 
      
    ELSE
      \  nop 
      
    THEN
   1 + REPEAT 2DROP
  out0 exit
  \ On renvoie out
  
;

: main
  \  Programme principal 
  
  0 { n }
  read-int TO n
  \  Lecture de l'entier 
  
  n sumdiv s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/euler28.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
sumdiag n =
  do let nterms = n * 2 - 1
     let a i b c =
           if i <= nterms - 2
           then do let d = 2 * (1 + (i `quot` 4))
                   let e = c + d
                   {- print int d print "=>" print un print " " -}
                   do let f = b + e
                      a (i + 1) f e
           else return b in
           a 0 1 1

main =
  printf "%d" =<< (sumdiag 1001 :: IO Int)




<|start_filename|>out/devine.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function devine0 (nombre, tab, len)
  local min0 = tab[1]
  local max0 = tab[2]
  for i = 2, len - 1 do
      if tab[i + 1] > max0 or tab[i + 1] < min0 then
          return false
      end
      if tab[i + 1] < nombre then
          min0 = tab[i + 1]
      end
      if tab[i + 1] > nombre then
          max0 = tab[i + 1]
      end
      if tab[i + 1] == nombre and len ~= i + 1 then
          return false
      end
  end
  return true
end

local nombre = readint()
stdinsep()
local len = readint()
stdinsep()
local tab = {}
for i = 0, len - 1 do
    local tmp = readint()
    stdinsep()
    tab[i + 1] = tmp
end
if devine0(nombre, tab, len) then
    io.write("True")
else 
    io.write("False")
end


<|start_filename|>out/aaa_readints.lua<|end_filename|>

function readintline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), "-?%d+") do
    tab[index] = tonumber(a)
    index = index + 1
  end
  return tab
end

local len = tonumber(io.read('*l'))
io.write(string.format("%d=len\n", len))
local tab1 = readintline()
for i = 0, len - 1 do
    io.write(string.format("%d=>%d\n", i, tab1[i + 1]))
end
len = tonumber(io.read('*l'))
local tab2 = {}
for a = 0, len - 2 do
    tab2[a + 1] = readintline()
end
for i = 0, len - 2 do
    for j = 0, len - 1 do
        io.write(string.format("%d ", tab2[i + 1][j + 1]))
    end
    io.write("\n")
end


<|start_filename|>out/plus_petit.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func go0(tab []int, a int, b int) int{
  m := (a + b) / 2
  if a == m {
      if tab[a] == m {
          return b
      } else {
          return a
      }
  }
  i := a
  j := b
  for i < j {
      e := tab[i]
      if e < m {
          i++
      } else {
          j--
          tab[i] = tab[j]
          tab[j] = e
      }
  }
  if i < m {
      return go0(tab, a, m)
  } else {
      return go0(tab, m, b)
  }
}
func plus_petit0(tab []int, len int) int{
  return go0(tab, 0, len)
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  len := 0
  fmt.Fscanf(reader, "%d", &len)
  skip()
  var tab []int = make([]int, len)
  for i := 0; i < len; i++ {
      tmp := 0
      fmt.Fscanf(reader, "%d", &tmp)
      skip()
      tab[i] = tmp
  }
  fmt.Printf("%d", plus_petit0(tab, len))
}



<|start_filename|>out/tuple.go<|end_filename|>
package main
import "fmt"

type tuple_int_int struct {
  tuple_int_int_field_0 int;
  tuple_int_int_field_1 int;
}
func f(tuple0 * tuple_int_int) * tuple_int_int{
  var c * tuple_int_int = tuple0
  a := (*c).tuple_int_int_field_0
  b := (*c).tuple_int_int_field_1
  var d * tuple_int_int = new (tuple_int_int)
      (*d).tuple_int_int_field_0=a + 1
      (*d).tuple_int_int_field_1=b + 1
  return d
}
func main() {
  var e * tuple_int_int = new (tuple_int_int)
      (*e).tuple_int_int_field_0=0
      (*e).tuple_int_int_field_1=1
  var t * tuple_int_int = f(e)
  var g * tuple_int_int = t
  a := (*g).tuple_int_int_field_0
  b := (*g).tuple_int_int_field_1
  fmt.Printf("%d -- %d--\n", a, b)
}



<|start_filename|>out/str2.cs<|end_filename|>
using System;

public class str2
{
  
  public static void Main(String[] args)
  {
    Console.Write("ma petite chaine en or");
  }
  
}



<|start_filename|>out/aaa_integer.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
main =
  do let a = 0 - 1
     printf "%d\n" (a::Int) :: IO()
     let b = a + 55
     printf "%d\n" (b::Int) :: IO()
     let c = b * 13
     printf "%d\n" (c::Int) :: IO()
     let d = c `quot` 2
     printf "%d\n" (d::Int) :: IO()
     let e = d + 1
     printf "%d\n" (e::Int) :: IO()
     let f = e `quot` 3
     printf "%d\n" (f::Int) :: IO()
     let g = f - 1
     printf "%d\n" (g::Int) :: IO()
     {-
http://fr.wikipedia.org/wiki/Modulo_(op%C3%A9ration)#Trois_d.C3.A9finitions_de_la_fonction_modulo
-}
     printf "%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n" ((117 `quot` 17)::Int) ((117 `quot` (- 17))::Int) (((- 117) `quot` 17)::Int) (((- 117) `quot` (- 17))::Int) ((117 `rem` 17)::Int) ((117 `rem` (- 17))::Int) (((- 117) `rem` 17)::Int) (((- 117) `rem` (- 17))::Int) :: IO()




<|start_filename|>out/euler09.fs<|end_filename|>
: main
  \ 
  \ 	a + b + c = 1000 && a * a + b * b = c * c
  \ 	
  
  1000 1 BEGIN 2dup >= WHILE DUP { a }
    1000 a 1 + BEGIN 2dup >= WHILE DUP { b }
      1000 a - b - { c }
      a a * b b * + { a2b2 }
      c c * { cc }
      cc a2b2 = c a > AND
      IF
        a s>d 0 d.r
        S\" \n" TYPE
        b s>d 0 d.r
        S\" \n" TYPE
        c s>d 0 d.r
        S\" \n" TYPE
        a b * c * s>d 0 d.r
        S\" \n" TYPE
      THEN
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  ;
main
BYE



<|start_filename|>out/euler09.cpp<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    /*
	a + b + c = 1000 && a * a + b * b = c * c
	*/
    for (int a = 1; a < 1001; a++)
        for (int b = a + 1; b < 1001; b++)
        {
            int c = 1000 - a - b;
            int a2b2 = a * a + b * b;
            int cc = c * c;
            if (cc == a2b2 && c > a)
                std::cout << a << "\n" << b << "\n" << c << "\n" << a * b * c << "\n";
        }
}



<|start_filename|>out/affect_param.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
foo a =
  return ()

main =
  do foo 0
     printf "%d\n" (0::Int) :: IO()




<|start_filename|>out/euler43.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler43 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

type a is Array (Integer range <>) of Boolean;
type a_PTR is access a;

  d6 : Integer;
  d4 : Integer;
  allowed : a_PTR;
begin
  --
  --The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property.
  --
  --Let d1 be the 1st digit, d2 be the 2nd digit, and so on. In this way, we note the following:
  --
  --d2d3d4=406 is divisible by 2
  --d3d4d5=063 is divisible by 3
  --d4d5d6=635 is divisible by 5
  --d5d6d7=357 is divisible by 7
  --d6d7d8=572 is divisible by 11
  --d7d8d9=728 is divisible by 13
  --d8d9d10=289 is divisible by 17
  --Find the sum of all 0 to 9 pandigital numbers with this property.
  --
  --d4 % 2 == 0
  --(d3 + d4 + d5) % 3 == 0
  --d6 = 5 ou d6 = 0
  --(d5 * 100 + d6 * 10 + d7  ) % 7 == 0
  --(d6 * 100 + d7 * 10 + d8  ) % 11 == 0
  --(d7 * 100 + d8 * 10 + d9  ) % 13 == 0
  --(d8 * 100 + d9 * 10 + d10 ) % 17 == 0
  --
  --
  --d4 % 2 == 0
  --d6 = 5 ou d6 = 0
  --
  --(d3 + d4 + d5) % 3 == 0
  --(d5 * 2 + d6 * 3 + d7) % 7 == 0
  --
  
  allowed := new a (0..9);
  for i in integer range 0..9 loop
    allowed(i) := TRUE;
  end loop;
  for i6 in integer range 0..1 loop
    d6 := i6 * 5;
    if allowed(d6)
    then
      allowed(d6) := FALSE;
      for d7 in integer range 0..9 loop
        if allowed(d7)
        then
          allowed(d7) := FALSE;
          for d8 in integer range 0..9 loop
            if allowed(d8)
            then
              allowed(d8) := FALSE;
              for d9 in integer range 0..9 loop
                if allowed(d9)
                then
                  allowed(d9) := FALSE;
                  for d10 in integer range 1..9 loop
                    if
                    ((allowed(d10) and then (d6 * 100 + d7 * 10 + d8) rem 11 = 0) and then (d7 * 100 + d8 * 10 + d9) rem 13 = 0) and then (d8 * 100 + d9 * 10 + d10) rem 17 = 0
                    then
                      allowed(d10) := FALSE;
                      for d5 in integer range 0..9 loop
                        if allowed(d5)
                        then
                          allowed(d5) := FALSE;
                          if (d5 * 100 + d6 * 10 + d7) rem 7 = 0
                          then
                            for i4 in integer range 0..4 loop
                              d4 := i4 * 2;
                              if allowed(d4)
                              then
                                allowed(d4) := FALSE;
                                for d3 in integer range 0..9 loop
                                  if allowed(d3)
                                  then
                                    allowed(d3) := FALSE;
                                    if (d3 + d4 + d5) rem 3 = 0
                                    then
                                      for d2 in integer range 0..9 loop
                                        if allowed(d2)
                                        then
                                          allowed(d2) := FALSE;
                                          for d1 in integer range 0..9 loop
                                            if allowed(d1)
                                            then
                                              allowed(d1) := FALSE;
                                              PInt(d1);
                                              PInt(d2);
                                              PInt(d3);
                                              PInt(d4);
                                              PInt(d5);
                                              PInt(d6);
                                              PInt(d7);
                                              PInt(d8);
                                              PInt(d9);
                                              PInt(d10);
                                              PString(new char_array'( To_C(" + ")));
                                              allowed(d1) := TRUE;
                                            end if;
                                          end loop;
                                          allowed(d2) := TRUE;
                                        end if;
                                      end loop;
                                    end if;
                                    allowed(d3) := TRUE;
                                  end if;
                                end loop;
                                allowed(d4) := TRUE;
                              end if;
                            end loop;
                          end if;
                          allowed(d5) := TRUE;
                        end if;
                      end loop;
                      allowed(d10) := TRUE;
                    end if;
                  end loop;
                  allowed(d9) := TRUE;
                end if;
              end loop;
              allowed(d8) := TRUE;
            end if;
          end loop;
          allowed(d7) := TRUE;
        end if;
      end loop;
      allowed(d6) := TRUE;
    end if;
  end loop;
  PInt(0);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler52.cs<|end_filename|>
using System;

public class euler52
{
  static int chiffre_sort(int a)
  {
    if (a < 10)
        return a;
    else
    {
        int b = chiffre_sort(a / 10);
        int c = a % 10;
        int d = b % 10;
        int e = b / 10;
        if (c < d)
            return c + b * 10;
        else
            return d + chiffre_sort(c + e * 10) * 10;
    }
  }
  
  static bool same_numbers(int a, int b, int c, int d, int e, int f)
  {
    int ca = chiffre_sort(a);
    return ca == chiffre_sort(b) && ca == chiffre_sort(c) && ca == chiffre_sort(d) && ca == chiffre_sort(e) && ca == chiffre_sort(f);
  }
  
  public static void Main(String[] args)
  {
    int num = 142857;
    if (same_numbers(num, num * 2, num * 3, num * 4, num * 6, num * 5))
        Console.Write(num + " " + (num * 2) + " " + (num * 3) + " " + (num * 4) + " " + (num * 5) + " " + (num * 6) + "\n");
  }
  
}



<|start_filename|>out/tuple.cpp<|end_filename|>
#include <iostream>
#include <vector>
struct tuple_int_int {
    int tuple_int_int_field_0;
    int tuple_int_int_field_1;
};


tuple_int_int f(tuple_int_int& tuple0) {
    tuple_int_int c = tuple0;
    int a = c.tuple_int_int_field_0;
    int b = c.tuple_int_int_field_1;
    tuple_int_int d;
        d.tuple_int_int_field_0 = a + 1;
        d.tuple_int_int_field_1 = b + 1;;
    return d;
}

int main() {
    tuple_int_int e;
        e.tuple_int_int_field_0 = 0;
        e.tuple_int_int_field_1 = 1;;
    tuple_int_int t = f(e);
    tuple_int_int g = t;
    int a = g.tuple_int_int_field_0;
    int b = g.tuple_int_int_field_1;
    std::cout << a << " -- " << b << "--\n";
}



<|start_filename|>out/euler01.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
main =
  let a i b =
        if i <= 999
        then if (i `rem` 3) == 0 || (i `rem` 5) == 0
             then do let c = b + i
                     a (i + 1) c
             else a (i + 1) b
        else printf "%d\n" (b::Int) :: IO() in
        a 0 0




<|start_filename|>out/npi.java<|end_filename|>
import java.util.*;

public class npi
{
  static Scanner scanner = new Scanner(System.in);
  static boolean is_number(char c)
  {
    return (int)(c) <= (int)('9') && (int)(c) >= (int)('0');
  }
  /*
Notation polonaise inversée, ce test permet d'évaluer une expression écrite en NPI
*/
  static int npi0(char[] str, int len)
  {
    int[] stack = new int[len];
    for (int i = 0; i < len; i++)
        stack[i] = 0;
    int ptrStack = 0;
    int ptrStr = 0;
    while (ptrStr < len)
        if (str[ptrStr] == ' ')
            ptrStr++;
        else if (is_number(str[ptrStr]))
        {
            int num = 0;
            while (str[ptrStr] != ' ')
            {
                num = num * 10 + (int)(str[ptrStr]) - (int)('0');
                ptrStr++;
            }
            stack[ptrStack] = num;
            ptrStack++;
        }
        else if (str[ptrStr] == '+')
        {
            stack[ptrStack - 2] += stack[ptrStack - 1];
            ptrStack--;
            ptrStr++;
        }
    return stack[0];
  }
  public static void main(String args[])
  {
    int len = 0;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      len = -scanner.nextInt();
    }else{
      len = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    char[] tab = new char[len];
    for (int i = 0; i < len; i++)
    {
        char tmp = '\u0000';
        tmp = scanner.findWithinHorizon(".", 1).charAt(0);
        tab[i] = tmp;
    }
    int result = npi0(tab, len);
    System.out.print(result);
  }
  
}



<|start_filename|>out/euler50.js<|end_filename|>
var util = require("util");
function eratostene(t, max0){
    var n = 0;
    for (var i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            if (~~(max0 / i) > i)
            {
                var j = i * i;
                while (j < max0 && j > 0)
                {
                    t[j] = 0;
                    j += i;
                }
            }
        }
    return n;
}
var maximumprimes = 1000001;
var era = new Array(maximumprimes);
for (var j = 0; j < maximumprimes; j++)
    era[j] = j;
var nprimes = eratostene(era, maximumprimes);
var primes = new Array(nprimes);
for (var o = 0; o < nprimes; o++)
    primes[o] = 0;
var l = 0;
for (var k = 2; k < maximumprimes; k++)
    if (era[k] == k)
    {
        primes[l] = k;
        l++;
    }
util.print(l, " == ", nprimes, "\n");
var sum = new Array(nprimes);
for (var i_ = 0; i_ < nprimes; i_++)
    sum[i_] = primes[i_];
var maxl = 0;
var process0 = true;
var stop = maximumprimes - 1;
var len = 1;
var resp = 1;
while (process0)
{
    process0 = false;
    for (var i = 0; i <= stop; i++)
        if (i + len < nprimes)
        {
            sum[i] += primes[i + len];
            if (maximumprimes > sum[i])
            {
                process0 = true;
                if (era[sum[i]] == sum[i])
                {
                    maxl = len;
                    resp = sum[i];
                }
            }
            else
                stop = Math.min(stop, i);
        }
    len++;
}
util.print(resp, "\n", maxl, "\n");



<|start_filename|>out/euler46.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int eratostene(int* t, int max0) {
    int i;
    int n = 0;
    for (i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            if (max0 / i > i)
            {
                int j = i * i;
                while (j < max0 && j > 0)
                {
                    t[j] = 0;
                    j += i;
                }
            }
        }
    return n;
}
int main(void) {
    int m, i, j, i_, k, o, j_;
    int maximumprimes = 6000;
    int *era = calloc(maximumprimes, sizeof(int));
    for (j_ = 0; j_ < maximumprimes; j_++)
        era[j_] = j_;
    int nprimes = eratostene(era, maximumprimes);
    int *primes = calloc(nprimes, sizeof(int));
    for (o = 0; o < nprimes; o++)
        primes[o] = 0;
    int l = 0;
    for (k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    printf("%d == %d\n", l, nprimes);
    int *canbe = calloc(maximumprimes, sizeof(int));
    for (i_ = 0; i_ < maximumprimes; i_++)
        canbe[i_] = 0;
    for (i = 0; i < nprimes; i++)
        for (j = 0; j < maximumprimes; j++)
        {
            int n = primes[i] + 2 * j * j;
            if (n < maximumprimes)
                canbe[n] = 1;
        }
    for (m = 1; m <= maximumprimes; m++)
    {
        int m2 = m * 2 + 1;
        if (m2 < maximumprimes && !canbe[m2])
            printf("%d\n", m2);
    }
    return 0;
}




<|start_filename|>out/calc.cs<|end_filename|>
using System;

public class calc
{
  /*
La suite de fibonaci
*/
  static int fibo(int a, int b, int i)
  {
    int out_ = 0;
    int a2 = a;
    int b2 = b;
    for (int j = 0; j <= i + 1; j++)
    {
        Console.Write(j);
        out_ += a2;
        int tmp = b2;
        b2 += a2;
        a2 = tmp;
    }
    return out_;
  }
  
  public static void Main(String[] args)
  {
    Console.Write(fibo(1, 2, 4));
  }
  
}



<|start_filename|>out/euler40.js<|end_filename|>
var util = require("util");
function exp0(a, e){
    var o = 1;
    for (var i = 1; i <= e; i++)
        o *= a;
    return o;
}
function e(t, n){
    for (var i = 1; i < 9; i++)
        if (n >= t[i] * i)
            n -= t[i] * i;
        else
        {
            var nombre = exp0(10, i - 1) + ~~(n / i);
            var chiffre = i - 1 - ~~(n % i);
            return ~~(~~(nombre / exp0(10, chiffre)) % 10);
        }
    return -1;
}
var t = new Array(9);
for (var i = 0; i < 9; i++)
    t[i] = exp0(10, i) - exp0(10, i - 1);
for (var i2 = 1; i2 < 9; i2++)
    util.print(i2, " => ", t[i2], "\n");
for (var j = 0; j < 81; j++)
    util.print(e(t, j));
util.print("\n");
for (var k = 1; k < 51; k++)
    util.print(k);
util.print("\n");
for (var j2 = 169; j2 < 221; j2++)
    util.print(e(t, j2));
util.print("\n");
for (var k2 = 90; k2 < 111; k2++)
    util.print(k2);
util.print("\n");
var out0 = 1;
for (var l = 0; l < 7; l++)
{
    var puiss = exp0(10, l);
    var v = e(t, puiss - 1);
    out0 *= v;
    util.print("10^", l, "=", puiss, " v=", v, "\n");
}
util.print(out0, "\n");



<|start_filename|>out/euler27.fs<|end_filename|>
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: eratostene { t max0 }
  0 { n }
  max0 1 - 2 BEGIN 2dup >= WHILE DUP { i }
    t  i cells +  @ i =
    IF
      n 1 + TO n
      i i * { j }
      BEGIN
        j max0 < j 0 > AND
      WHILE
        0 t  j cells +  !
        j i + TO j
      REPEAT
    THEN
   1 + REPEAT 2DROP
  n exit
;


: isPrime { n primes len }
  0 { i }
  n 0 <
  IF
    n NEGATE TO n
  THEN
  BEGIN
    primes  i cells +  @ primes  i cells +  @ * n <
  WHILE
    n primes  i cells +  @ % 0 =
    IF
      false exit
    THEN
    i 1 + TO i
  REPEAT
  true exit
;


: test { a b primes len }
  200 0 BEGIN 2dup >= WHILE DUP { n }
    n n * a n * + b + { j }
    j primes len isPrime INVERT
    IF
      DROP DROP n exit
    THEN
   1 + REPEAT 2DROP
  200 exit
;

: main
  1000 { maximumprimes }
  HERE maximumprimes cells allot { era }
  maximumprimes 1 - 0 BEGIN 2dup >= WHILE DUP { j }
    j era  j cells +  !
   1 + REPEAT 2DROP
  0 { result }
  0 { max0 }
  era maximumprimes eratostene { nprimes }
  HERE nprimes cells allot { primes }
  nprimes 1 - 0 BEGIN 2dup >= WHILE DUP { o }
    0 primes  o cells +  !
   1 + REPEAT 2DROP
  0 { l }
  maximumprimes 1 - 2 BEGIN 2dup >= WHILE DUP { k }
    era  k cells +  @ k =
    IF
      k primes  l cells +  !
      l 1 + TO l
    THEN
   1 + REPEAT 2DROP
  l s>d 0 d.r
  S"  == " TYPE
  nprimes s>d 0 d.r
  S\" \n" TYPE
  0 { ma }
  0 { mb }
  999 3 BEGIN 2dup >= WHILE DUP { b }
    era  b cells +  @ b =
    IF
      999 999 NEGATE BEGIN 2dup >= WHILE DUP { a }
        a b primes nprimes test { n1 }
        a b NEGATE primes nprimes test { n2 }
        n1 max0 >
        IF
          n1 TO max0
          a b * TO result
          a TO ma
          b TO mb
        THEN
        n2 max0 >
        IF
          n2 TO max0
          a NEGATE b * TO result
          a TO ma
          b NEGATE TO mb
        THEN
       1 + REPEAT 2DROP
    THEN
   1 + REPEAT 2DROP
  ma s>d 0 d.r
  S"  " TYPE
  mb s>d 0 d.r
  S\" \n" TYPE
  max0 s>d 0 d.r
  S\" \n" TYPE
  result s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/euler06.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler06 is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;


  sumcarres : Integer;
  sum : Integer;
  lim : Integer;
  carressum : Integer;
begin
  lim := 100;
  sum := lim * (lim + 1) / 2;
  carressum := sum * sum;
  sumcarres := lim * (lim + 1) * (2 * lim + 1) / 6;
  PInt(carressum - sumcarres);
end;


<|start_filename|>out/euler19.fs<|end_filename|>
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: is_leap { year }
  year 400 % 0 = year 100 % 0 <> year 4 % 0 = AND OR exit
;


: ndayinmonth { month year }
  month 0 =
  IF
    31 exit
  ELSE
    month 1 =
    IF
      year is_leap
      IF
        29 exit
      ELSE
        28 exit
      THEN
    ELSE
      month 2 =
      IF
        31 exit
      ELSE
        month 3 =
        IF
          30 exit
        ELSE
          month 4 =
          IF
            31 exit
          ELSE
            month 5 =
            IF
              30 exit
            ELSE
              month 6 =
              IF
                31 exit
              ELSE
                month 7 =
                IF
                  31 exit
                ELSE
                  month 8 =
                  IF
                    30 exit
                  ELSE
                    month 9 =
                    IF
                      31 exit
                    ELSE
                      month 10 =
                      IF
                        30 exit
                      ELSE
                        month 11 =
                        IF
                          31 exit
                        THEN
                      THEN
                    THEN
                  THEN
                THEN
              THEN
            THEN
          THEN
        THEN
      THEN
    THEN
  THEN
  0 exit
;

: main
  0 { month }
  1901 { year }
  1 { dayofweek }
  \  01-01-1901 : mardi 
  
  0 { count }
  BEGIN
    year 2001 <>
  WHILE
    month year ndayinmonth { ndays }
    dayofweek ndays + 7 % TO dayofweek
    month 1 + TO month
    month 12 =
    IF
      0 TO month
      year 1 + TO year
    THEN
    dayofweek 7 % 6 =
    IF
      count 1 + TO count
    THEN
  REPEAT
  count s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/euler52.cpp<|end_filename|>
#include <iostream>
#include <vector>

int chiffre_sort(int a) {
    if (a < 10)
        return a;
    else
    {
        int b = chiffre_sort(a / 10);
        int c = a % 10;
        int d = b % 10;
        int e = b / 10;
        if (c < d)
            return c + b * 10;
        else
            return d + chiffre_sort(c + e * 10) * 10;
    }
}


bool same_numbers(int a, int b, int c, int d, int e, int f) {
    int ca = chiffre_sort(a);
    return ca == chiffre_sort(b) && ca == chiffre_sort(c) && ca == chiffre_sort(d) && ca == chiffre_sort(e) && ca == chiffre_sort(f);
}

int main() {
    int num = 142857;
    if (same_numbers(num, num * 2, num * 3, num * 4, num * 6, num * 5))
        std::cout << num << " " << num * 2 << " " << num * 3 << " " << num * 4 << " " << num * 5 << " " << num * 6 << "\n";
}



<|start_filename|>out/tictactoe.cs<|end_filename|>
using System;

public class tictactoe
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static void stdin_sep(){
  do{
    if (eof) return;
    char c = readChar_();
    if (c == ' ' || c == '\n' || c == '\t' || c == '\r'){
      consommeChar();
    }else{
      return;
    }
  } while(true);
}
static int readInt(){
  int i = 0;
  char s = readChar_();
  int sign = 1;
  if (s == '-'){
    sign = -1;
    consommeChar();
  }
  do{
    char c = readChar_();
    if (c <= '9' && c >= '0'){
      i = i * 10 + c - '0';
      consommeChar();
    }else{
      return i * sign;
    }
  } while(true);
} 
  /*
Tictactoe : un tictactoe avec une IA
*/
  //  La structure de donnée 
  public class gamestate {
    public int[][] cases;
    public bool firstToPlay;
    public int note;
    public bool ended;
  }
  //  Un Mouvement 
  public class move {
    public int x;
    public int y;
  }
  //  On affiche l'état 
  static void print_state(gamestate g)
  {
    Console.Write("\n|");
    for (int y = 0; y < 3; y++)
    {
        for (int x = 0; x < 3; x++)
        {
            if (g.cases[x][y] == 0)
                Console.Write(" ");
            else if (g.cases[x][y] == 1)
                Console.Write("O");
            else
                Console.Write("X");
            Console.Write("|");
        }
        if (y != 2)
            Console.Write("\n|-|-|-|\n|");
    }
    Console.Write("\n");
  }
  
  //  On dit qui gagne (info stoquées dans g.ended et g.note ) 
  static void eval0(gamestate g)
  {
    int win = 0;
    int freecase = 0;
    for (int y = 0; y < 3; y++)
    {
        int col = -1;
        int lin = -1;
        for (int x = 0; x < 3; x++)
        {
            if (g.cases[x][y] == 0)
                freecase++;
            int colv = g.cases[x][y];
            int linv = g.cases[y][x];
            if (col == -1 && colv != 0)
                col = colv;
            else if (colv != col)
                col = -2;
            if (lin == -1 && linv != 0)
                lin = linv;
            else if (linv != lin)
                lin = -2;
        }
        if (col >= 0)
            win = col;
        else if (lin >= 0)
            win = lin;
    }
    for (int x = 1; x < 3; x++)
    {
        if (g.cases[0][0] == x && g.cases[1][1] == x && g.cases[2][2] == x)
            win = x;
        if (g.cases[0][2] == x && g.cases[1][1] == x && g.cases[2][0] == x)
            win = x;
    }
    g.ended = win != 0 || freecase == 0;
    if (win == 1)
        g.note = 1000;
    else if (win == 2)
        g.note = -1000;
    else
        g.note = 0;
  }
  
  //  On applique un mouvement 
  static void apply_move_xy(int x, int y, gamestate g)
  {
    int player = 2;
    if (g.firstToPlay)
        player = 1;
    g.cases[x][y] = player;
    g.firstToPlay = !g.firstToPlay;
  }
  
  static void apply_move(move m, gamestate g)
  {
    apply_move_xy(m.x, m.y, g);
  }
  
  static void cancel_move_xy(int x, int y, gamestate g)
  {
    g.cases[x][y] = 0;
    g.firstToPlay = !g.firstToPlay;
    g.ended = false;
  }
  
  static void cancel_move(move m, gamestate g)
  {
    cancel_move_xy(m.x, m.y, g);
  }
  
  static bool can_move_xy(int x, int y, gamestate g)
  {
    return g.cases[x][y] == 0;
  }
  
  static bool can_move(move m, gamestate g)
  {
    return can_move_xy(m.x, m.y, g);
  }
  
  /*
Un minimax classique, renvoie la note du plateau
*/
  static int minmax(gamestate g)
  {
    eval0(g);
    if (g.ended)
        return g.note;
    int maxNote = -10000;
    if (!g.firstToPlay)
        maxNote = 10000;
    for (int x = 0; x < 3; x++)
        for (int y = 0; y < 3; y++)
            if (can_move_xy(x, y, g))
            {
                apply_move_xy(x, y, g);
                int currentNote = minmax(g);
                cancel_move_xy(x, y, g);
                //  Minimum ou Maximum selon le coté ou l'on joue
                if (currentNote > maxNote == g.firstToPlay)
                    maxNote = currentNote;
            }
    return maxNote;
  }
  
  /*
Renvoie le coup de l'IA
*/
  static move play(gamestate g)
  {
    move minMove = new move();
    minMove.x = 0;
    minMove.y = 0;
    int minNote = 10000;
    for (int x = 0; x < 3; x++)
        for (int y = 0; y < 3; y++)
            if (can_move_xy(x, y, g))
            {
                apply_move_xy(x, y, g);
                int currentNote = minmax(g);
                Console.Write(x + ", " + y + ", " + currentNote + "\n");
                cancel_move_xy(x, y, g);
                if (currentNote < minNote)
                {
                    minNote = currentNote;
                    minMove.x = x;
                    minMove.y = y;
                }
            }
    Console.Write("" + minMove.x + minMove.y + "\n");
    return minMove;
  }
  
  static gamestate init0()
  {
    int[][] cases = new int[3][];
    for (int i = 0; i < 3; i++)
    {
        int[] tab = new int[3];
        for (int j = 0; j < 3; j++)
            tab[j] = 0;
        cases[i] = tab;
    }
    gamestate a = new gamestate();
    a.cases = cases;
    a.firstToPlay = true;
    a.note = 0;
    a.ended = false;
    return a;
  }
  
  static move read_move()
  {
    int x = readInt();
    stdin_sep();
    int y = readInt();
    stdin_sep();
    move b = new move();
    b.x = x;
    b.y = y;
    return b;
  }
  
  public static void Main(String[] args)
  {
    for (int i = 0; i < 2; i++)
    {
        gamestate state = init0();
        move c = new move();
        c.x = 1;
        c.y = 1;
        apply_move(c, state);
        move d = new move();
        d.x = 0;
        d.y = 0;
        apply_move(d, state);
        while (!state.ended)
        {
            print_state(state);
            apply_move(play(state), state);
            eval0(state);
            print_state(state);
            if (!state.ended)
            {
                apply_move(play(state), state);
                eval0(state);
            }
        }
        print_state(state);
        Console.Write(state.note + "\n");
    }
  }
  
}



<|start_filename|>out/plus_petit.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function go0(tab, a, b){
    var m = ~~((a + b) / 2);
    if (a == m)
        if (tab[a] == m)
            return b;
        else
            return a;
    var i = a;
    var j = b;
    while (i < j)
    {
        var e = tab[i];
        if (e < m)
            i++;
        else
        {
            j--;
            tab[i] = tab[j];
            tab[j] = e;
        }
    }
    if (i < m)
        return go0(tab, a, m);
    else
        return go0(tab, m, b);
}
function plus_petit0(tab, len){
    return go0(tab, 0, len);
}
var len = 0;
len = read_int_();
stdinsep();
var tab = new Array(len);
for (var i = 0; i < len; i++)
{
    var tmp = 0;
    tmp = read_int_();
    stdinsep();
    tab[i] = tmp;
}
util.print(plus_petit0(tab, len));



<|start_filename|>out/prologin_template_intmatrix.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure prologin_template_intmatrix is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type d is Array (Integer range <>) of Integer;
type d_PTR is access d;
type e is Array (Integer range <>) of d_PTR;
type e_PTR is access e;
function programme_candidat(tableau : in e_PTR; x : in Integer; y : in Integer) return Integer is
  out0 : Integer;
begin
  out0 := 0;
  for i in integer range 0..y - 1 loop
    for j in integer range 0..x - 1 loop
      out0 := out0 + tableau(i)(j) * (i * 2 + j);
    end loop;
  end loop;
  return out0;
end;

  taille_y : Integer;
  taille_x : Integer;
  tableau : e_PTR;
  b : d_PTR;
begin
  Get(taille_x);
  SkipSpaces;
  Get(taille_y);
  SkipSpaces;
  tableau := new e (0..taille_y - 1);
  for a in integer range 0..taille_y - 1 loop
    b := new d (0..taille_x - 1);
    for c in integer range 0..taille_x - 1 loop
      Get(b(c));
      SkipSpaces;
    end loop;
    tableau(a) := b;
  end loop;
  PInt(programme_candidat(tableau, taille_x, taille_y));
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler27.go<|end_filename|>
package main
import "fmt"
func eratostene(t []int, max0 int) int{
  n := 0
  for i := 2; i < max0; i++ {
      if t[i] == i {
          n++
          j := i * i
          for j < max0 && j > 0 {
              t[j] = 0
              j += i
          }
      }
  }
  return n
}
func isPrime(n int, primes []int, len int) bool{
  i := 0
  if n < 0 {
      n = -n
  }
  for primes[i] * primes[i] < n {
      if n % primes[i] == 0 {
          return false
      }
      i++
  }
  return true
}
func test(a int, b int, primes []int, len int) int{
  for n := 0; n < 201; n++ {
      j := n * n + a * n + b
      if !isPrime(j, primes, len) {
          return n
      }
  }
  return 200
}
func main() {
  maximumprimes := 1000
  var era []int = make([]int, maximumprimes)
  for j := 0; j < maximumprimes; j++ {
      era[j] = j
  }
  result := 0
  max0 := 0
  nprimes := eratostene(era, maximumprimes)
  var primes []int = make([]int, nprimes)
  for o := 0; o < nprimes; o++ {
      primes[o] = 0
  }
  l := 0
  for k := 2; k < maximumprimes; k++ {
      if era[k] == k {
          primes[l] = k
          l++
      }
  }
  fmt.Printf("%d == %d\n", l, nprimes)
  ma := 0
  mb := 0
  for b := 3; b < 1000; b++ {
      if era[b] == b {
          for a := -999; a < 1000; a++ {
              n1 := test(a, b, primes, nprimes)
              n2 := test(a, -b, primes, nprimes)
              if n1 > max0 {
                  max0 = n1
                  result = a * b
                  ma = a
                  mb = b
              }
              if n2 > max0 {
                  max0 = n2
                  result = -a * b
                  ma = a
                  mb = -b
              }
          }
      }
  }
  fmt.Printf("%d %d\n%d\n%d\n", ma, mb, max0, result)
}



<|start_filename|>out/pathfindList.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
pathfind_aux cache tab len pos =
  if pos >= len - 1
  then return 0
  else ifM (((/=) (- 1)) <$> (readIOA cache pos))
           (readIOA cache pos)
           (do writeIOA cache pos (len * 2)
               posval <- pathfind_aux cache tab len =<< (readIOA tab pos)
               oneval <- pathfind_aux cache tab len (pos + 1)
               let a = if posval < oneval
                       then 1 + posval
                       else 1 + oneval
               writeIOA cache pos a
               return a)

pathfind tab len =
  do cache <- array_init len (\ i ->
                                return (- 1))
     pathfind_aux cache tab len 0

main =
  do b <- read_int
     skip_whitespaces
     tab <- array_init b (\ i ->
                            do c <- read_int
                               skip_whitespaces
                               return c)
     result <- pathfind tab b
     printf "%d" (result :: Int) :: IO ()




<|start_filename|>out/aaa_02if.js<|end_filename|>
var util = require("util");
function f(i){
    if (i == 0)
        return true;
    return false;
}
if (f(4))
    util.print("true <-\n ->\n");
else
    util.print("false <-\n ->\n");
util.print("small test end\n");



<|start_filename|>out/aaa_09chars.fs<|end_filename|>
: main
  1 s>d 0 d.r
  S" =>" TYPE
  1 EMIT
  S"  " TYPE
  1 s>d 0 d.r
  S"  " TYPE
  1 EMIT
  S\" \n" TYPE
  2 s>d 0 d.r
  S" =>" TYPE
  2 EMIT
  S"  " TYPE
  2 s>d 0 d.r
  S"  " TYPE
  2 EMIT
  S\" \n" TYPE
  3 s>d 0 d.r
  S" =>" TYPE
  3 EMIT
  S"  " TYPE
  3 s>d 0 d.r
  S"  " TYPE
  3 EMIT
  S\" \n" TYPE
  4 s>d 0 d.r
  S" =>" TYPE
  4 EMIT
  S"  " TYPE
  4 s>d 0 d.r
  S"  " TYPE
  4 EMIT
  S\" \n" TYPE
  5 s>d 0 d.r
  S" =>" TYPE
  5 EMIT
  S"  " TYPE
  5 s>d 0 d.r
  S"  " TYPE
  5 EMIT
  S\" \n" TYPE
  6 s>d 0 d.r
  S" =>" TYPE
  6 EMIT
  S"  " TYPE
  6 s>d 0 d.r
  S"  " TYPE
  6 EMIT
  S\" \n" TYPE
  7 s>d 0 d.r
  S" =>" TYPE
  7 EMIT
  S"  " TYPE
  7 s>d 0 d.r
  S"  " TYPE
  7 EMIT
  S\" \n" TYPE
  8 s>d 0 d.r
  S" =>" TYPE
  8 EMIT
  S"  " TYPE
  8 s>d 0 d.r
  S"  " TYPE
  8 EMIT
  S\" \n" TYPE
  9 s>d 0 d.r
  S" =>" TYPE
  9 EMIT
  S"  " TYPE
  9 s>d 0 d.r
  S"  " TYPE
  9 EMIT
  S\" \n" TYPE
  10 s>d 0 d.r
  S" =>" TYPE
  10 EMIT
  S"  " TYPE
  10 s>d 0 d.r
  S"  " TYPE
  10 EMIT
  S\" \n" TYPE
  11 s>d 0 d.r
  S" =>" TYPE
  11 EMIT
  S"  " TYPE
  11 s>d 0 d.r
  S"  " TYPE
  11 EMIT
  S\" \n" TYPE
  12 s>d 0 d.r
  S" =>" TYPE
  12 EMIT
  S"  " TYPE
  12 s>d 0 d.r
  S"  " TYPE
  12 EMIT
  S\" \n" TYPE
  13 s>d 0 d.r
  S" =>" TYPE
  13 EMIT
  S"  " TYPE
  13 s>d 0 d.r
  S"  " TYPE
  13 EMIT
  S\" \n" TYPE
  14 s>d 0 d.r
  S" =>" TYPE
  14 EMIT
  S"  " TYPE
  14 s>d 0 d.r
  S"  " TYPE
  14 EMIT
  S\" \n" TYPE
  15 s>d 0 d.r
  S" =>" TYPE
  15 EMIT
  S"  " TYPE
  15 s>d 0 d.r
  S"  " TYPE
  15 EMIT
  S\" \n" TYPE
  16 s>d 0 d.r
  S" =>" TYPE
  16 EMIT
  S"  " TYPE
  16 s>d 0 d.r
  S"  " TYPE
  16 EMIT
  S\" \n" TYPE
  17 s>d 0 d.r
  S" =>" TYPE
  17 EMIT
  S"  " TYPE
  17 s>d 0 d.r
  S"  " TYPE
  17 EMIT
  S\" \n" TYPE
  18 s>d 0 d.r
  S" =>" TYPE
  18 EMIT
  S"  " TYPE
  18 s>d 0 d.r
  S"  " TYPE
  18 EMIT
  S\" \n" TYPE
  19 s>d 0 d.r
  S" =>" TYPE
  19 EMIT
  S"  " TYPE
  19 s>d 0 d.r
  S"  " TYPE
  19 EMIT
  S\" \n" TYPE
  20 s>d 0 d.r
  S" =>" TYPE
  20 EMIT
  S"  " TYPE
  20 s>d 0 d.r
  S"  " TYPE
  20 EMIT
  S\" \n" TYPE
  21 s>d 0 d.r
  S" =>" TYPE
  21 EMIT
  S"  " TYPE
  21 s>d 0 d.r
  S"  " TYPE
  21 EMIT
  S\" \n" TYPE
  22 s>d 0 d.r
  S" =>" TYPE
  22 EMIT
  S"  " TYPE
  22 s>d 0 d.r
  S"  " TYPE
  22 EMIT
  S\" \n" TYPE
  23 s>d 0 d.r
  S" =>" TYPE
  23 EMIT
  S"  " TYPE
  23 s>d 0 d.r
  S"  " TYPE
  23 EMIT
  S\" \n" TYPE
  24 s>d 0 d.r
  S" =>" TYPE
  24 EMIT
  S"  " TYPE
  24 s>d 0 d.r
  S"  " TYPE
  24 EMIT
  S\" \n" TYPE
  25 s>d 0 d.r
  S" =>" TYPE
  25 EMIT
  S"  " TYPE
  25 s>d 0 d.r
  S"  " TYPE
  25 EMIT
  S\" \n" TYPE
  26 s>d 0 d.r
  S" =>" TYPE
  26 EMIT
  S"  " TYPE
  26 s>d 0 d.r
  S"  " TYPE
  26 EMIT
  S\" \n" TYPE
  27 s>d 0 d.r
  S" =>" TYPE
  27 EMIT
  S"  " TYPE
  27 s>d 0 d.r
  S"  " TYPE
  27 EMIT
  S\" \n" TYPE
  28 s>d 0 d.r
  S" =>" TYPE
  28 EMIT
  S"  " TYPE
  28 s>d 0 d.r
  S"  " TYPE
  28 EMIT
  S\" \n" TYPE
  29 s>d 0 d.r
  S" =>" TYPE
  29 EMIT
  S"  " TYPE
  29 s>d 0 d.r
  S"  " TYPE
  29 EMIT
  S\" \n" TYPE
  30 s>d 0 d.r
  S" =>" TYPE
  30 EMIT
  S"  " TYPE
  30 s>d 0 d.r
  S"  " TYPE
  30 EMIT
  S\" \n" TYPE
  31 s>d 0 d.r
  S" =>" TYPE
  31 EMIT
  S"  " TYPE
  31 s>d 0 d.r
  S"  " TYPE
  31 EMIT
  S\" \n" TYPE
  32 s>d 0 d.r
  S" =>" TYPE
  32 EMIT
  S"  " TYPE
  32 s>d 0 d.r
  S"  " TYPE
  32 EMIT
  S\" \n" TYPE
  33 s>d 0 d.r
  S" =>" TYPE
  33 EMIT
  S"  " TYPE
  33 s>d 0 d.r
  S"  " TYPE
  33 EMIT
  S\" \n" TYPE
  34 s>d 0 d.r
  S" =>" TYPE
  34 EMIT
  S"  " TYPE
  34 s>d 0 d.r
  S"  " TYPE
  34 EMIT
  S\" \n" TYPE
  35 s>d 0 d.r
  S" =>" TYPE
  35 EMIT
  S"  " TYPE
  35 s>d 0 d.r
  S"  " TYPE
  35 EMIT
  S\" \n" TYPE
  36 s>d 0 d.r
  S" =>" TYPE
  36 EMIT
  S"  " TYPE
  36 s>d 0 d.r
  S"  " TYPE
  36 EMIT
  S\" \n" TYPE
  37 s>d 0 d.r
  S" =>" TYPE
  37 EMIT
  S"  " TYPE
  37 s>d 0 d.r
  S"  " TYPE
  37 EMIT
  S\" \n" TYPE
  38 s>d 0 d.r
  S" =>" TYPE
  38 EMIT
  S"  " TYPE
  38 s>d 0 d.r
  S"  " TYPE
  38 EMIT
  S\" \n" TYPE
  39 s>d 0 d.r
  S" =>" TYPE
  39 EMIT
  S"  " TYPE
  39 s>d 0 d.r
  S"  " TYPE
  39 EMIT
  S\" \n" TYPE
  40 s>d 0 d.r
  S" =>" TYPE
  40 EMIT
  S"  " TYPE
  40 s>d 0 d.r
  S"  " TYPE
  40 EMIT
  S\" \n" TYPE
  41 s>d 0 d.r
  S" =>" TYPE
  41 EMIT
  S"  " TYPE
  41 s>d 0 d.r
  S"  " TYPE
  41 EMIT
  S\" \n" TYPE
  42 s>d 0 d.r
  S" =>" TYPE
  42 EMIT
  S"  " TYPE
  42 s>d 0 d.r
  S"  " TYPE
  42 EMIT
  S\" \n" TYPE
  43 s>d 0 d.r
  S" =>" TYPE
  43 EMIT
  S"  " TYPE
  43 s>d 0 d.r
  S"  " TYPE
  43 EMIT
  S\" \n" TYPE
  44 s>d 0 d.r
  S" =>" TYPE
  44 EMIT
  S"  " TYPE
  44 s>d 0 d.r
  S"  " TYPE
  44 EMIT
  S\" \n" TYPE
  45 s>d 0 d.r
  S" =>" TYPE
  45 EMIT
  S"  " TYPE
  45 s>d 0 d.r
  S"  " TYPE
  45 EMIT
  S\" \n" TYPE
  46 s>d 0 d.r
  S" =>" TYPE
  46 EMIT
  S"  " TYPE
  46 s>d 0 d.r
  S"  " TYPE
  46 EMIT
  S\" \n" TYPE
  47 s>d 0 d.r
  S" =>" TYPE
  47 EMIT
  S"  " TYPE
  47 s>d 0 d.r
  S"  " TYPE
  47 EMIT
  S\" \n" TYPE
  48 s>d 0 d.r
  S" =>" TYPE
  [char] 0 EMIT
  S"  " TYPE
  [char] 0 s>d 0 d.r
  S"  " TYPE
  48 EMIT
  S\" \n" TYPE
  49 s>d 0 d.r
  S" =>" TYPE
  [char] 1 EMIT
  S"  " TYPE
  [char] 1 s>d 0 d.r
  S"  " TYPE
  49 EMIT
  S\" \n" TYPE
  50 s>d 0 d.r
  S" =>" TYPE
  [char] 2 EMIT
  S"  " TYPE
  [char] 2 s>d 0 d.r
  S"  " TYPE
  50 EMIT
  S\" \n" TYPE
  51 s>d 0 d.r
  S" =>" TYPE
  [char] 3 EMIT
  S"  " TYPE
  [char] 3 s>d 0 d.r
  S"  " TYPE
  51 EMIT
  S\" \n" TYPE
  52 s>d 0 d.r
  S" =>" TYPE
  [char] 4 EMIT
  S"  " TYPE
  [char] 4 s>d 0 d.r
  S"  " TYPE
  52 EMIT
  S\" \n" TYPE
  53 s>d 0 d.r
  S" =>" TYPE
  [char] 5 EMIT
  S"  " TYPE
  [char] 5 s>d 0 d.r
  S"  " TYPE
  53 EMIT
  S\" \n" TYPE
  54 s>d 0 d.r
  S" =>" TYPE
  [char] 6 EMIT
  S"  " TYPE
  [char] 6 s>d 0 d.r
  S"  " TYPE
  54 EMIT
  S\" \n" TYPE
  55 s>d 0 d.r
  S" =>" TYPE
  [char] 7 EMIT
  S"  " TYPE
  [char] 7 s>d 0 d.r
  S"  " TYPE
  55 EMIT
  S\" \n" TYPE
  56 s>d 0 d.r
  S" =>" TYPE
  [char] 8 EMIT
  S"  " TYPE
  [char] 8 s>d 0 d.r
  S"  " TYPE
  56 EMIT
  S\" \n" TYPE
  57 s>d 0 d.r
  S" =>" TYPE
  [char] 9 EMIT
  S"  " TYPE
  [char] 9 s>d 0 d.r
  S"  " TYPE
  57 EMIT
  S\" \n" TYPE
  58 s>d 0 d.r
  S" =>" TYPE
  [char] : EMIT
  S"  " TYPE
  [char] : s>d 0 d.r
  S"  " TYPE
  58 EMIT
  S\" \n" TYPE
  59 s>d 0 d.r
  S" =>" TYPE
  [char] ; EMIT
  S"  " TYPE
  [char] ; s>d 0 d.r
  S"  " TYPE
  59 EMIT
  S\" \n" TYPE
  60 s>d 0 d.r
  S" =>" TYPE
  [char] < EMIT
  S"  " TYPE
  [char] < s>d 0 d.r
  S"  " TYPE
  60 EMIT
  S\" \n" TYPE
  61 s>d 0 d.r
  S" =>" TYPE
  [char] = EMIT
  S"  " TYPE
  [char] = s>d 0 d.r
  S"  " TYPE
  61 EMIT
  S\" \n" TYPE
  62 s>d 0 d.r
  S" =>" TYPE
  [char] > EMIT
  S"  " TYPE
  [char] > s>d 0 d.r
  S"  " TYPE
  62 EMIT
  S\" \n" TYPE
  63 s>d 0 d.r
  S" =>" TYPE
  [char] ? EMIT
  S"  " TYPE
  [char] ? s>d 0 d.r
  S"  " TYPE
  63 EMIT
  S\" \n" TYPE
  64 s>d 0 d.r
  S" =>" TYPE
  [char] @ EMIT
  S"  " TYPE
  [char] @ s>d 0 d.r
  S"  " TYPE
  64 EMIT
  S\" \n" TYPE
  65 s>d 0 d.r
  S" =>" TYPE
  [char] A EMIT
  S"  " TYPE
  [char] A s>d 0 d.r
  S"  " TYPE
  65 EMIT
  S\" \n" TYPE
  66 s>d 0 d.r
  S" =>" TYPE
  [char] B EMIT
  S"  " TYPE
  [char] B s>d 0 d.r
  S"  " TYPE
  66 EMIT
  S\" \n" TYPE
  67 s>d 0 d.r
  S" =>" TYPE
  [char] C EMIT
  S"  " TYPE
  [char] C s>d 0 d.r
  S"  " TYPE
  67 EMIT
  S\" \n" TYPE
  68 s>d 0 d.r
  S" =>" TYPE
  [char] D EMIT
  S"  " TYPE
  [char] D s>d 0 d.r
  S"  " TYPE
  68 EMIT
  S\" \n" TYPE
  69 s>d 0 d.r
  S" =>" TYPE
  [char] E EMIT
  S"  " TYPE
  [char] E s>d 0 d.r
  S"  " TYPE
  69 EMIT
  S\" \n" TYPE
  70 s>d 0 d.r
  S" =>" TYPE
  [char] F EMIT
  S"  " TYPE
  [char] F s>d 0 d.r
  S"  " TYPE
  70 EMIT
  S\" \n" TYPE
  71 s>d 0 d.r
  S" =>" TYPE
  [char] G EMIT
  S"  " TYPE
  [char] G s>d 0 d.r
  S"  " TYPE
  71 EMIT
  S\" \n" TYPE
  72 s>d 0 d.r
  S" =>" TYPE
  [char] H EMIT
  S"  " TYPE
  [char] H s>d 0 d.r
  S"  " TYPE
  72 EMIT
  S\" \n" TYPE
  73 s>d 0 d.r
  S" =>" TYPE
  [char] I EMIT
  S"  " TYPE
  [char] I s>d 0 d.r
  S"  " TYPE
  73 EMIT
  S\" \n" TYPE
  74 s>d 0 d.r
  S" =>" TYPE
  [char] J EMIT
  S"  " TYPE
  [char] J s>d 0 d.r
  S"  " TYPE
  74 EMIT
  S\" \n" TYPE
  75 s>d 0 d.r
  S" =>" TYPE
  [char] K EMIT
  S"  " TYPE
  [char] K s>d 0 d.r
  S"  " TYPE
  75 EMIT
  S\" \n" TYPE
  76 s>d 0 d.r
  S" =>" TYPE
  [char] L EMIT
  S"  " TYPE
  [char] L s>d 0 d.r
  S"  " TYPE
  76 EMIT
  S\" \n" TYPE
  77 s>d 0 d.r
  S" =>" TYPE
  [char] M EMIT
  S"  " TYPE
  [char] M s>d 0 d.r
  S"  " TYPE
  77 EMIT
  S\" \n" TYPE
  78 s>d 0 d.r
  S" =>" TYPE
  [char] N EMIT
  S"  " TYPE
  [char] N s>d 0 d.r
  S"  " TYPE
  78 EMIT
  S\" \n" TYPE
  79 s>d 0 d.r
  S" =>" TYPE
  [char] O EMIT
  S"  " TYPE
  [char] O s>d 0 d.r
  S"  " TYPE
  79 EMIT
  S\" \n" TYPE
  80 s>d 0 d.r
  S" =>" TYPE
  [char] P EMIT
  S"  " TYPE
  [char] P s>d 0 d.r
  S"  " TYPE
  80 EMIT
  S\" \n" TYPE
  81 s>d 0 d.r
  S" =>" TYPE
  [char] Q EMIT
  S"  " TYPE
  [char] Q s>d 0 d.r
  S"  " TYPE
  81 EMIT
  S\" \n" TYPE
  82 s>d 0 d.r
  S" =>" TYPE
  [char] R EMIT
  S"  " TYPE
  [char] R s>d 0 d.r
  S"  " TYPE
  82 EMIT
  S\" \n" TYPE
  83 s>d 0 d.r
  S" =>" TYPE
  [char] S EMIT
  S"  " TYPE
  [char] S s>d 0 d.r
  S"  " TYPE
  83 EMIT
  S\" \n" TYPE
  84 s>d 0 d.r
  S" =>" TYPE
  [char] T EMIT
  S"  " TYPE
  [char] T s>d 0 d.r
  S"  " TYPE
  84 EMIT
  S\" \n" TYPE
  85 s>d 0 d.r
  S" =>" TYPE
  [char] U EMIT
  S"  " TYPE
  [char] U s>d 0 d.r
  S"  " TYPE
  85 EMIT
  S\" \n" TYPE
  86 s>d 0 d.r
  S" =>" TYPE
  [char] V EMIT
  S"  " TYPE
  [char] V s>d 0 d.r
  S"  " TYPE
  86 EMIT
  S\" \n" TYPE
  87 s>d 0 d.r
  S" =>" TYPE
  [char] W EMIT
  S"  " TYPE
  [char] W s>d 0 d.r
  S"  " TYPE
  87 EMIT
  S\" \n" TYPE
  88 s>d 0 d.r
  S" =>" TYPE
  [char] X EMIT
  S"  " TYPE
  [char] X s>d 0 d.r
  S"  " TYPE
  88 EMIT
  S\" \n" TYPE
  89 s>d 0 d.r
  S" =>" TYPE
  [char] Y EMIT
  S"  " TYPE
  [char] Y s>d 0 d.r
  S"  " TYPE
  89 EMIT
  S\" \n" TYPE
  90 s>d 0 d.r
  S" =>" TYPE
  [char] Z EMIT
  S"  " TYPE
  [char] Z s>d 0 d.r
  S"  " TYPE
  90 EMIT
  S\" \n" TYPE
  91 s>d 0 d.r
  S" =>" TYPE
  [char] [ EMIT
  S"  " TYPE
  [char] [ s>d 0 d.r
  S"  " TYPE
  91 EMIT
  S\" \n" TYPE
  92 s>d 0 d.r
  S" =>" TYPE
  [char] \ EMIT
  S"  " TYPE
  [char] \ s>d 0 d.r
  S"  " TYPE
  92 EMIT
  S\" \n" TYPE
  93 s>d 0 d.r
  S" =>" TYPE
  [char] ] EMIT
  S"  " TYPE
  [char] ] s>d 0 d.r
  S"  " TYPE
  93 EMIT
  S\" \n" TYPE
  94 s>d 0 d.r
  S" =>" TYPE
  [char] ^ EMIT
  S"  " TYPE
  [char] ^ s>d 0 d.r
  S"  " TYPE
  94 EMIT
  S\" \n" TYPE
  95 s>d 0 d.r
  S" =>" TYPE
  [char] _ EMIT
  S"  " TYPE
  [char] _ s>d 0 d.r
  S"  " TYPE
  95 EMIT
  S\" \n" TYPE
  96 s>d 0 d.r
  S" =>" TYPE
  [char] ` EMIT
  S"  " TYPE
  [char] ` s>d 0 d.r
  S"  " TYPE
  96 EMIT
  S\" \n" TYPE
  97 s>d 0 d.r
  S" =>" TYPE
  [char] a EMIT
  S"  " TYPE
  [char] a s>d 0 d.r
  S"  " TYPE
  97 EMIT
  S\" \n" TYPE
  98 s>d 0 d.r
  S" =>" TYPE
  [char] b EMIT
  S"  " TYPE
  [char] b s>d 0 d.r
  S"  " TYPE
  98 EMIT
  S\" \n" TYPE
  99 s>d 0 d.r
  S" =>" TYPE
  [char] c EMIT
  S"  " TYPE
  [char] c s>d 0 d.r
  S"  " TYPE
  99 EMIT
  S\" \n" TYPE
  100 s>d 0 d.r
  S" =>" TYPE
  [char] d EMIT
  S"  " TYPE
  [char] d s>d 0 d.r
  S"  " TYPE
  100 EMIT
  S\" \n" TYPE
  101 s>d 0 d.r
  S" =>" TYPE
  [char] e EMIT
  S"  " TYPE
  [char] e s>d 0 d.r
  S"  " TYPE
  101 EMIT
  S\" \n" TYPE
  102 s>d 0 d.r
  S" =>" TYPE
  [char] f EMIT
  S"  " TYPE
  [char] f s>d 0 d.r
  S"  " TYPE
  102 EMIT
  S\" \n" TYPE
  103 s>d 0 d.r
  S" =>" TYPE
  [char] g EMIT
  S"  " TYPE
  [char] g s>d 0 d.r
  S"  " TYPE
  103 EMIT
  S\" \n" TYPE
  104 s>d 0 d.r
  S" =>" TYPE
  [char] h EMIT
  S"  " TYPE
  [char] h s>d 0 d.r
  S"  " TYPE
  104 EMIT
  S\" \n" TYPE
  105 s>d 0 d.r
  S" =>" TYPE
  [char] i EMIT
  S"  " TYPE
  [char] i s>d 0 d.r
  S"  " TYPE
  105 EMIT
  S\" \n" TYPE
  106 s>d 0 d.r
  S" =>" TYPE
  [char] j EMIT
  S"  " TYPE
  [char] j s>d 0 d.r
  S"  " TYPE
  106 EMIT
  S\" \n" TYPE
  107 s>d 0 d.r
  S" =>" TYPE
  [char] k EMIT
  S"  " TYPE
  [char] k s>d 0 d.r
  S"  " TYPE
  107 EMIT
  S\" \n" TYPE
  108 s>d 0 d.r
  S" =>" TYPE
  [char] l EMIT
  S"  " TYPE
  [char] l s>d 0 d.r
  S"  " TYPE
  108 EMIT
  S\" \n" TYPE
  109 s>d 0 d.r
  S" =>" TYPE
  [char] m EMIT
  S"  " TYPE
  [char] m s>d 0 d.r
  S"  " TYPE
  109 EMIT
  S\" \n" TYPE
  110 s>d 0 d.r
  S" =>" TYPE
  [char] n EMIT
  S"  " TYPE
  [char] n s>d 0 d.r
  S"  " TYPE
  110 EMIT
  S\" \n" TYPE
  111 s>d 0 d.r
  S" =>" TYPE
  [char] o EMIT
  S"  " TYPE
  [char] o s>d 0 d.r
  S"  " TYPE
  111 EMIT
  S\" \n" TYPE
  112 s>d 0 d.r
  S" =>" TYPE
  [char] p EMIT
  S"  " TYPE
  [char] p s>d 0 d.r
  S"  " TYPE
  112 EMIT
  S\" \n" TYPE
  113 s>d 0 d.r
  S" =>" TYPE
  [char] q EMIT
  S"  " TYPE
  [char] q s>d 0 d.r
  S"  " TYPE
  113 EMIT
  S\" \n" TYPE
  114 s>d 0 d.r
  S" =>" TYPE
  [char] r EMIT
  S"  " TYPE
  [char] r s>d 0 d.r
  S"  " TYPE
  114 EMIT
  S\" \n" TYPE
  115 s>d 0 d.r
  S" =>" TYPE
  [char] s EMIT
  S"  " TYPE
  [char] s s>d 0 d.r
  S"  " TYPE
  115 EMIT
  S\" \n" TYPE
  116 s>d 0 d.r
  S" =>" TYPE
  [char] t EMIT
  S"  " TYPE
  [char] t s>d 0 d.r
  S"  " TYPE
  116 EMIT
  S\" \n" TYPE
  117 s>d 0 d.r
  S" =>" TYPE
  [char] u EMIT
  S"  " TYPE
  [char] u s>d 0 d.r
  S"  " TYPE
  117 EMIT
  S\" \n" TYPE
  118 s>d 0 d.r
  S" =>" TYPE
  [char] v EMIT
  S"  " TYPE
  [char] v s>d 0 d.r
  S"  " TYPE
  118 EMIT
  S\" \n" TYPE
  119 s>d 0 d.r
  S" =>" TYPE
  [char] w EMIT
  S"  " TYPE
  [char] w s>d 0 d.r
  S"  " TYPE
  119 EMIT
  S\" \n" TYPE
  120 s>d 0 d.r
  S" =>" TYPE
  [char] x EMIT
  S"  " TYPE
  [char] x s>d 0 d.r
  S"  " TYPE
  120 EMIT
  S\" \n" TYPE
  121 s>d 0 d.r
  S" =>" TYPE
  [char] y EMIT
  S"  " TYPE
  [char] y s>d 0 d.r
  S"  " TYPE
  121 EMIT
  S\" \n" TYPE
  122 s>d 0 d.r
  S" =>" TYPE
  [char] z EMIT
  S"  " TYPE
  [char] z s>d 0 d.r
  S"  " TYPE
  122 EMIT
  S\" \n" TYPE
  123 s>d 0 d.r
  S" =>" TYPE
  [char] { EMIT
  S"  " TYPE
  [char] { s>d 0 d.r
  S"  " TYPE
  123 EMIT
  S\" \n" TYPE
  124 s>d 0 d.r
  S" =>" TYPE
  [char] | EMIT
  S"  " TYPE
  [char] | s>d 0 d.r
  S"  " TYPE
  124 EMIT
  S\" \n" TYPE
  125 s>d 0 d.r
  S" =>" TYPE
  [char] } EMIT
  S"  " TYPE
  [char] } s>d 0 d.r
  S"  " TYPE
  125 EMIT
  S\" \n" TYPE
  126 s>d 0 d.r
  S" =>" TYPE
  [char] ~ EMIT
  S"  " TYPE
  [char] ~ s>d 0 d.r
  S"  " TYPE
  126 EMIT
  S\" \n" TYPE
  127 s>d 0 d.r
  S" =>" TYPE
  [char]  EMIT
  S"  " TYPE
  [char]  s>d 0 d.r
  S"  " TYPE
  127 EMIT
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/sumDiv.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end
function foo ()
  local a = 0
  --[[ test --]]
  a = a + 1
  --[[ test 2 --]]
end

function foo2 ()
  
end

function foo3 ()
  if 1 == 1 then
      
  end
end

function sumdiv (n)
  --[[ On désire renvoyer la somme des diviseurs --]]
  local out0 = 0
  --[[ On déclare un entier qui contiendra la somme --]]
  for i = 1, n do
      --[[ La boucle : i est le diviseur potentiel--]]
      if math.fmod(n, i) == 0 then
          --[[ Si i divise --]]
          out0 = out0 + i
          --[[ On incrémente --]]
      else 
          --[[ nop --]]
      end
  end
  return out0
  --[[On renvoie out--]]
end

--[[ Programme principal --]]
local n = 0
n = readint()
--[[ Lecture de l'entier --]]
io.write(sumdiv(n))


<|start_filename|>out/euler15.groovy<|end_filename|>
import java.util.*



int n = 10
//  normalement on doit mettre 20 mais là on se tape un overflow 
n++
int[][] tab = new int[n][]
for (int i = 0; i < n; i++)
{
    int[] tab2 = new int[n]
    for (int j = 0; j < n; j++)
        tab2[j] = 0
    tab[i] = tab2
}
for (int l = 0; l < n; l++)
{
    tab[n - 1][l] = 1
    tab[l][n - 1] = 1
}
for (int o = 2; o <= n; o++)
{
    int r = n - o
    for (int p = 2; p <= n; p++)
    {
        int q = n - p
        tab[r][q] = tab[r + 1][q] + tab[r][q + 1]
    }
}
for (int m = 0; m < n; m++)
{
    for (int k = 0; k < n; k++)
        System.out.printf("%d ", tab[m][k])
    print("\n")
}
System.out.printf("%d\n", tab[0][0])



<|start_filename|>out/devine.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
devine0 nombre tab len =
  do min0 <- readIOA tab 0
     max0 <- readIOA tab 1
     let a i b c =
           if i <= len - 1
           then ifM ((((<) b) <$> (readIOA tab i)) <||> (((>) c) <$> (readIOA tab i)))
                    (return False)
                    (do d <- ifM (((>) nombre) <$> (readIOA tab i))
                                 (readIOA tab i)
                                 (return c)
                        e <- ifM (((<) nombre) <$> (readIOA tab i))
                                 (readIOA tab i)
                                 (return b)
                        ifM (((&&) (len /= i + 1)) <$> (((==) nombre) <$> (readIOA tab i)))
                            (return False)
                            (a (i + 1) e d))
           else return True in
           a 2 max0 min0

main =
  do nombre <- read_int
     skip_whitespaces
     len <- read_int
     skip_whitespaces
     tab <- array_init len (\ i ->
                              do tmp <- read_int
                                 skip_whitespaces
                                 return tmp)
     ifM (devine0 nombre tab len)
         (printf "True" :: IO ())
         (printf "False" :: IO ())




<|start_filename|>out/aaa_missing.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class aaa_missing
{
  /*
  Ce test a été généré par Metalang.
*/
  static int result(int len, int[] tab)
  {
    bool[] tab2 = new bool[len];
    for (int i = 0; i < len; i++)
        tab2[i] = false;
    for (int i1 = 0; i1 < len; i1++)
    {
        Console.Write(tab[i1] + " ");
        tab2[tab[i1]] = true;
    }
    Console.Write("\n");
    for (int i2 = 0; i2 < len; i2++)
        if (!tab2[i2])
            return i2;
    return -1;
  }
  
  public static void Main(String[] args)
  {
    int len = int.Parse(Console.ReadLine());
    Console.Write(len + "\n");
    int[] tab = new List<string>(Console.ReadLine().Split(" ".ToCharArray())).ConvertAll(int.Parse).ToArray();
    Console.Write(result(len, tab) + "\n");
  }
  
}



<|start_filename|>out/prologin_template_intlist.cpp<|end_filename|>
#include <iostream>
#include <vector>

int programme_candidat(std::vector<int>& tableau, int taille) {
    int out0 = 0;
    for (int i = 0; i < taille; i++)
        out0 += tableau[i];
    return out0;
}

int main() {
    int taille;
    std::cin >> taille;
    std::vector<int> tableau( taille );
    for (int a = 0; a < taille; a++)
    {
        std::cin >> tableau[a];
    }
    std::cout << programme_candidat(tableau, taille) << "\n";
}



<|start_filename|>out/affect.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure affect is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
--
--Ce test permet de vérifier que l'implémentation de l'affectation fonctionne correctement
--

type toto;
type toto_PTR is access toto;
type toto is record
  foo : Integer;
  bar : Integer;
  blah : Integer;
end record;
function mktoto(v1 : in Integer) return toto_PTR is
  t : toto_PTR;
begin
  t := new toto;
  t.foo := v1;
  t.bar := v1;
  t.blah := v1;
  return t;
end;
function mktoto2(v1 : in Integer) return toto_PTR is
  t : toto_PTR;
begin
  t := new toto;
  t.foo := v1 + 3;
  t.bar := v1 + 2;
  t.blah := v1 + 1;
  return t;
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function result(t_0 : in toto_PTR; t2_0 : in toto_PTR) return Integer is
  t3 : toto_PTR;
  t2 : toto_PTR;
  t : toto_PTR;
  len : Integer;
  cache2 : a_PTR;
  cache1 : a_PTR;
  cache0 : a_PTR;
begin
  t := t_0;
  t2 := t2_0;
  t3 := new toto;
  t3.foo := 0;
  t3.bar := 0;
  t3.blah := 0;
  t3 := t2;
  t := t2;
  t2 := t3;
  t.blah := t.blah + 1;
  len := 1;
  cache0 := new a (0..len - 1);
  for i in integer range 0..len - 1 loop
    cache0(i) := (-i);
  end loop;
  cache1 := new a (0..len - 1);
  for j in integer range 0..len - 1 loop
    cache1(j) := j;
  end loop;
  cache2 := cache0;
  cache0 := cache1;
  cache2 := cache0;
  return t.foo + t.blah * t.bar + t.bar * t.foo;
end;

  t2 : toto_PTR;
  t : toto_PTR;
begin
  t := mktoto(4);
  t2 := mktoto(5);
  Get(t.bar);
  SkipSpaces;
  Get(t.blah);
  SkipSpaces;
  Get(t2.bar);
  SkipSpaces;
  Get(t2.blah);
  PInt(result(t, t2));
  PInt(t.blah);
end;


<|start_filename|>out/pathfinding0.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func min2_(a int, b int) int{
  if a < b {
      return a
  } else {
      return b
  }
}
func pathfind_aux(cache [][]int, tab [][]byte, x int, y int, posX int, posY int) int{
  if posX == x - 1 && posY == y - 1 {
      return 0
  } else if posX < 0 || posY < 0 || posX >= x || posY >= y {
      return x * y * 10
  } else if tab[posY][posX] == '#' {
      return x * y * 10
  } else if cache[posY][posX] != -1 {
      return cache[posY][posX]
  } else {
      cache[posY][posX] = x * y * 10
      val1 := pathfind_aux(cache, tab, x, y, posX + 1, posY)
      val2 := pathfind_aux(cache, tab, x, y, posX - 1, posY)
      val3 := pathfind_aux(cache, tab, x, y, posX, posY - 1)
      val4 := pathfind_aux(cache, tab, x, y, posX, posY + 1)
      out0 := 1 + min2_(min2_(min2_(val1, val2), val3), val4)
      cache[posY][posX] = out0
      return out0
  }
}
func pathfind(tab [][]byte, x int, y int) int{
  var cache [][]int = make([][]int, y)
  for i := 0; i < y; i++ {
      var tmp []int = make([]int, x)
      for j := 0; j < x; j++ {
          fmt.Printf("%c", tab[i][j])
          tmp[j] = -1
      }
      fmt.Printf("\n")
      cache[i] = tmp
  }
  return pathfind_aux(cache, tab, x, y, 0, 0)
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var y int
  var x int
  fmt.Fscanf(reader, "%d", &x)
  skip()
  fmt.Fscanf(reader, "%d", &y)
  skip()
  fmt.Printf("%d %d\n", x, y)
  var e [][]byte = make([][]byte, y)
  for f := 0; f < y; f++ {
      var g []byte = make([]byte, x)
      for h := 0; h < x; h++ {
          fmt.Fscanf(reader, "%c", &g[h])
      }
      skip()
      e[f] = g
  }
  var tab [][]byte = e
  result := pathfind(tab, x, y)
  fmt.Printf("%d", result)
}



<|start_filename|>out/euler11.cc<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

int find(int n, std::vector<std::vector<int> *> * m, int x, int y, int dx, int dy) {
    if (x < 0 || x == 20 || y < 0 || y == 20)
        return -1;
    else if (n == 0)
        return 1;
    else
        return m->at(y)->at(x) * find(n - 1, m, x + dx, y + dy, dx, dy);
}

struct tuple_int_int {
    int tuple_int_int_field_0;
    int tuple_int_int_field_1;
};

int main() {
    std::vector<tuple_int_int *> *directions = new std::vector<tuple_int_int *>( 8 );
    for (int i = 0; i < 8; i++)
        if (i == 0)
        {
            tuple_int_int * c = new tuple_int_int();
                c->tuple_int_int_field_0 = 0;
                c->tuple_int_int_field_1 = 1;;
            directions->at(i) = c;
        }
        else if (i == 1)
        {
            tuple_int_int * d = new tuple_int_int();
                d->tuple_int_int_field_0 = 1;
                d->tuple_int_int_field_1 = 0;;
            directions->at(i) = d;
        }
        else if (i == 2)
        {
            tuple_int_int * e = new tuple_int_int();
                e->tuple_int_int_field_0 = 0;
                e->tuple_int_int_field_1 = -1;;
            directions->at(i) = e;
        }
        else if (i == 3)
        {
            tuple_int_int * f = new tuple_int_int();
                f->tuple_int_int_field_0 = -1;
                f->tuple_int_int_field_1 = 0;;
            directions->at(i) = f;
        }
        else if (i == 4)
        {
            tuple_int_int * g = new tuple_int_int();
                g->tuple_int_int_field_0 = 1;
                g->tuple_int_int_field_1 = 1;;
            directions->at(i) = g;
        }
        else if (i == 5)
        {
            tuple_int_int * h = new tuple_int_int();
                h->tuple_int_int_field_0 = 1;
                h->tuple_int_int_field_1 = -1;;
            directions->at(i) = h;
        }
        else if (i == 6)
        {
            tuple_int_int * k = new tuple_int_int();
                k->tuple_int_int_field_0 = -1;
                k->tuple_int_int_field_1 = 1;;
            directions->at(i) = k;
        }
        else
        {
            tuple_int_int * l = new tuple_int_int();
                l->tuple_int_int_field_0 = -1;
                l->tuple_int_int_field_1 = -1;;
            directions->at(i) = l;
        }
    int max0 = 0;
    std::vector<std::vector<int> *> *m = new std::vector<std::vector<int> *>( 20 );
    for (int o = 0; o < 20; o++)
    {
        std::vector<int> *p = new std::vector<int>( 20 );
        for (int q = 0; q < 20; q++)
        {
            std::cin >> p->at(q);
        }
        m->at(o) = p;
    }
    for (int j = 0; j < 8; j++)
    {
        tuple_int_int * r = directions->at(j);
        int dx = r->tuple_int_int_field_0;
        int dy = r->tuple_int_int_field_1;
        for (int x = 0; x < 20; x++)
            for (int y = 0; y < 20; y++)
                max0 = std::max(max0, find(4, m, x, y, dx, dy));
    }
    std::cout << max0 << "\n";
}



<|start_filename|>out/test_instant.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int foo(int a, int b) {
    return a + b;
}
int main(void) {
    printf("%d", 10);
    return 0;
}




<|start_filename|>out/euler15.lua<|end_filename|>

local n = 10
--[[ normalement on doit mettre 20 mais là on se tape un overflow --]]
n = n + 1
local tab = {}
for i = 0, n - 1 do
    local tab2 = {}
    for j = 0, n - 1 do
        tab2[j + 1] = 0
    end
    tab[i + 1] = tab2
end
for l = 0, n - 1 do
    tab[n][l + 1] = 1
    tab[l + 1][n] = 1
end
for o = 2, n do
    local r = n - o
    for p = 2, n do
        local q = n - p
        tab[r + 1][q + 1] = tab[r + 2][q + 1] + tab[r + 1][q + 2]
    end
end
for m = 0, n - 1 do
    for k = 0, n - 1 do
        io.write(string.format("%d ", tab[m + 1][k + 1]))
    end
    io.write("\n")
end
io.write(string.format("%d\n", tab[1][1]))


<|start_filename|>out/euler30.lua<|end_filename|>

--[[
a + b * 10 + c * 100 + d * 1000 + e * 10 000 =
  a ^ 5 +
  b ^ 5 +
  c ^ 5 +
  d ^ 5 +
  e ^ 5
--]]
local p = {}
for i = 0, 9 do
    p[i + 1] = i * i * i * i * i
end
local sum = 0
for a = 0, 9 do
    for b = 0, 9 do
        for c = 0, 9 do
            for d = 0, 9 do
                for e = 0, 9 do
                    for f = 0, 9 do
                        local s = p[a + 1] + p[b + 1] + p[c + 1] + p[d + 1] + p[e + 1] + p[f + 1]
                        local r = a + b * 10 + c * 100 + d * 1000 + e * 10000 + f * 100000
                        if s == r and r ~= 1 then
                            io.write(string.format("%d%d%d%d%d%d %d\n", f, e, d, c, b, a, r))
                            sum = sum + r
                        end
                    end
                end
            end
        end
    end
end
io.write(sum)


<|start_filename|>out/euler05.cc<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

std::vector<int> * primesfactors(int n) {
    std::vector<int> *tab = new std::vector<int>( n + 1 );
    std::fill(tab->begin(), tab->end(), 0);
    int d = 2;
    while (n != 1 && d * d <= n)
        if (n % d == 0)
        {
            tab->at(d)++;
            n /= d;
        }
        else
            d++;
    tab->at(n)++;
    return tab;
}

int main() {
    int lim = 20;
    std::vector<int> *o = new std::vector<int>( lim + 1 );
    std::fill(o->begin(), o->end(), 0);
    for (int i = 1; i <= lim; i++)
    {
        std::vector<int> * t = primesfactors(i);
        for (int j = 1; j <= i; j++)
            o->at(j) = std::max(o->at(j), t->at(j));
    }
    int product = 1;
    for (int k = 1; k <= lim; k++)
        for (int l = 1; l <= o->at(k); l++)
            product *= k;
    std::cout << product << "\n";
}



<|start_filename|>out/euler19.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
is_leap year =
  return ((year `rem` 400) == 0 || ((year `rem` 100) /= 0 && (year `rem` 4) == 0))

ndayinmonth month year =
  if month == 0
  then return 31
  else if month == 1
       then ifM (is_leap year)
                (return 29)
                (return 28)
       else return (if month == 2
                    then 31
                    else if month == 3
                         then 30
                         else if month == 4
                              then 31
                              else if month == 5
                                   then 30
                                   else if month == 6
                                        then 31
                                        else if month == 7
                                             then 31
                                             else if month == 8
                                                  then 30
                                                  else if month == 9
                                                       then 31
                                                       else if month == 10
                                                            then 30
                                                            else if month == 11
                                                                 then 31
                                                                 else 0)

main =
  {- 01-01-1901 : mardi -}
  let a b c d e =
        if e /= 2001
        then do ndays <- ndayinmonth d e
                let f = (c + ndays) `rem` 7
                let g = d + 1
                (\ (i, j) ->
                  if (f `rem` 7) == 6
                  then do let k = b + 1
                          a k f i j
                  else a b f i j) (if g == 12
                                   then let h = e + 1
                                                in (0, h)
                                   else (g, e))
        else printf "%d\n" (b::Int) :: IO() in
        a 0 1 0 1901




<|start_filename|>out/aaa_03binding.lua<|end_filename|>
function g (i)
  local j = i * 4
  if math.fmod(j, 2) == 1 then
      return 0
  end
  return j
end

function h (i)
  io.write(string.format("%d\n", i))
end

h(14)
local a = 4
local b = 5
io.write(a + b)
--[[ main --]]
h(15)
a = 2
b = 1
io.write(a + b)


<|start_filename|>out/record2.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure record2 is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type toto;
type toto_PTR is access toto;
type toto is record
  foo : Integer;
  bar : Integer;
  blah : Integer;
end record;
function mktoto(v1 : in Integer) return toto_PTR is
  t : toto_PTR;
begin
  t := new toto;
  t.foo := v1;
  t.bar := 0;
  t.blah := 0;
  return t;
end;
function result(t : in toto_PTR) return Integer is
begin
  t.blah := t.blah + 1;
  return t.foo + t.blah * t.bar + t.bar * t.foo;
end;

  t : toto_PTR;
begin
  t := mktoto(4);
  Get(t.bar);
  SkipSpaces;
  Get(t.blah);
  PInt(result(t));
end;


<|start_filename|>out/euler12.go<|end_filename|>
package main
import "fmt"
func max2_(a int, b int) int{
  if a > b {
      return a
  } else {
      return b
  }
}
func eratostene(t []int, max0 int) int{
  n := 0
  for i := 2; i < max0; i++ {
      if t[i] == i {
          j := i * i
          n++
          for j < max0 && j > 0 {
              t[j] = 0
              j += i
          }
      }
  }
  return n
}
func fillPrimesFactors(t []int, n int, primes []int, nprimes int) int{
  for i := 0; i < nprimes; i++ {
      d := primes[i]
      for n % d == 0 {
          t[d]++
          n /= d
      }
      if n == 1 {
          return primes[i]
      }
  }
  return n
}
func find(ndiv2 int) int{
  maximumprimes := 110
  var era []int = make([]int, maximumprimes)
  for j := 0; j < maximumprimes; j++ {
      era[j] = j
  }
  nprimes := eratostene(era, maximumprimes)
  var primes []int = make([]int, nprimes)
  for o := 0; o < nprimes; o++ {
      primes[o] = 0
  }
  l := 0
  for k := 2; k < maximumprimes; k++ {
      if era[k] == k {
          primes[l] = k
          l++
      }
  }
  for n := 1; n < 10001; n++ {
      var primesFactors []int = make([]int, n + 2)
      for m := 0; m <= n + 1; m++ {
          primesFactors[m] = 0
      }
      max0 := max2_(fillPrimesFactors(primesFactors, n, primes, nprimes), fillPrimesFactors(primesFactors, n + 1, primes, nprimes))
      primesFactors[2]--
      ndivs := 1
      for i := 0; i <= max0; i++ {
          if primesFactors[i] != 0 {
              ndivs *= 1 + primesFactors[i]
          }
      }
      if ndivs > ndiv2 {
          return n * (n + 1) / 2
      }
      /* print "n=" print n print "\t" print (n * (n + 1) / 2 ) print " " print ndivs print "\n" */
  }
  return 0
}
func main() {
  fmt.Printf("%d\n", find(500))
}



<|start_filename|>out/devine.java<|end_filename|>
import java.util.*;

public class devine
{
  static Scanner scanner = new Scanner(System.in);
  static boolean devine0(int nombre, int[] tab, int len)
  {
    int min0 = tab[0];
    int max0 = tab[1];
    for (int i = 2; i < len; i++)
    {
        if (tab[i] > max0 || tab[i] < min0)
            return false;
        if (tab[i] < nombre)
            min0 = tab[i];
        if (tab[i] > nombre)
            max0 = tab[i];
        if (tab[i] == nombre && len != i + 1)
            return false;
    }
    return true;
  }
  public static void main(String args[])
  {
    int nombre;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      nombre = scanner.nextInt();
    } else {
      nombre = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int len;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      len = scanner.nextInt();
    } else {
      len = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int[] tab = new int[len];
    for (int i = 0; i < len; i++)
    {
        int tmp;
        if (scanner.hasNext("^-")) {
          scanner.next("^-");
          tmp = scanner.nextInt();
        } else {
          tmp = scanner.nextInt();
        }
        scanner.findWithinHorizon("[\n\r ]*", 1);
        tab[i] = tmp;
    }
    if (devine0(nombre, tab, len))
        System.out.print("True");
    else
        System.out.print("False");
  }
  
}



<|start_filename|>out/aaa_missing.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

/* 
  Ce test a été généré par Metalang.
 */


int result(int len, int* tab) {
    int i2, i1, i;
    int *tab2 = calloc(len, sizeof(int));
    for (i = 0; i < len; i++)
        tab2[i] = 0;
    for (i1 = 0; i1 < len; i1++)
    {
        printf("%d ", tab[i1]);
        tab2[tab[i1]] = 1;
    }
    printf("\n");
    for (i2 = 0; i2 < len; i2++)
        if (!tab2[i2])
            return i2;
    return -1;
}
int main(void) {
    int a, len;
    scanf("%d ", &len);
    printf("%d\n", len);
    int *tab = calloc(len, sizeof(int));
    for (a = 0; a < len; a++)
        scanf("%d ", &tab[a]);
    printf("%d\n", result(len, tab));
    return 0;
}




<|start_filename|>out/aaa_01hello.cpp<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    std::cout << "Hello World";
    int a = 5;
    std::cout << (4 + 6) * 2 << " \n" << a << "foo";
    if (1 + 2 * 2 * (3 + 8) / 4 - 2 == 12 && true)
        std::cout << "True";
    else
        std::cout << "False";
    std::cout << "\n";
    if ((3 * (4 + 11) * 2 == 45) == false)
        std::cout << "True";
    else
        std::cout << "False";
    std::cout << " ";
    if ((2 == 1) == false)
        std::cout << "True";
    else
        std::cout << "False";
    std::cout << " " << 5 / 3 / 3 << 4 * 1 / 3 / 2 * 1;
    if (!(!(a == 0) && !(a == 4)))
        std::cout << "True";
    else
        std::cout << "False";
    if (true && !false && !(true && false))
        std::cout << "True";
    else
        std::cout << "False";
    std::cout << "\n";
}



<|start_filename|>out/euler46.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler46 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function eratostene(t : in a_PTR; max0 : in Integer) return Integer is
  n : Integer;
  j : Integer;
begin
  n := 0;
  for i in integer range 2..max0 - 1 loop
    if t(i) = i
    then
      n := n + 1;
      if max0 / i > i
      then
        j := i * i;
        while j < max0 and then j > 0 loop
          t(j) := 0;
          j := j + i;
        end loop;
      end if;
    end if;
  end loop;
  return n;
end;
type b is Array (Integer range <>) of Boolean;
type b_PTR is access b;

  primes : a_PTR;
  nprimes : Integer;
  n : Integer;
  maximumprimes : Integer;
  m2 : Integer;
  l : Integer;
  era : a_PTR;
  canbe : b_PTR;
begin
  maximumprimes := 6000;
  era := new a (0..maximumprimes - 1);
  for j_0 in integer range 0..maximumprimes - 1 loop
    era(j_0) := j_0;
  end loop;
  nprimes := eratostene(era, maximumprimes);
  primes := new a (0..nprimes - 1);
  for o in integer range 0..nprimes - 1 loop
    primes(o) := 0;
  end loop;
  l := 0;
  for k in integer range 2..maximumprimes - 1 loop
    if era(k) = k
    then
      primes(l) := k;
      l := l + 1;
    end if;
  end loop;
  PInt(l);
  PString(new char_array'( To_C(" == ")));
  PInt(nprimes);
  PString(new char_array'( To_C("" & Character'Val(10))));
  canbe := new b (0..maximumprimes - 1);
  for i_0 in integer range 0..maximumprimes - 1 loop
    canbe(i_0) := FALSE;
  end loop;
  for i in integer range 0..nprimes - 1 loop
    for j in integer range 0..maximumprimes - 1 loop
      n := primes(i) + 2 * j * j;
      if n < maximumprimes
      then
        canbe(n) := TRUE;
      end if;
    end loop;
  end loop;
  for m in integer range 1..maximumprimes loop
    m2 := m * 2 + 1;
    if m2 < maximumprimes and then not canbe(m2)
    then
      PInt(m2);
      PString(new char_array'( To_C("" & Character'Val(10))));
    end if;
  end loop;
end;


<|start_filename|>out/linkedList.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
struct
  cell% field ->head
  cell% field ->tail
end-struct intlist%


: cons { list i }
  intlist% %allot { out0 }
  i out0 ->head !
  list out0 ->tail !
  out0 exit
;


: is_empty { foo }
  true exit
;


: rev2 recursive { acc torev }
  torev is_empty
  IF
    acc exit
  ELSE
    intlist% %allot { acc2 }
    torev ->head @ acc2 ->head !
    acc acc2 ->tail !
    acc torev ->tail @ rev2 exit
  THEN
;


: rev { empty torev }
  empty torev rev2 exit
;


: test { empty }
  empty { list }
  1 NEGATE { i }
  BEGIN
    i 0 <>
  WHILE
    read-int TO i
    i 0 <>
    IF
      list i cons TO list
    THEN
  REPEAT
;

: main
  
  ;
main
BYE



<|start_filename|>out/testing_count.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
count t = do
  (a,b) <- getBounds t
  return (b - a + 1)

array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
main =
  do tab <- array_init 40 (\ i ->
                             return (i * i))
     printf "%d\n" =<< ((count (tab))::IO Int)




<|start_filename|>out/aaa_read.java<|end_filename|>
import java.util.*;

public class aaa_read
{
  static Scanner scanner = new Scanner(System.in);
  /*
Ce test permet de vérifier si les différents backends pour les langages implémentent bien
read int, read char et skip
*/
  public static void main(String args[])
  {
    int len;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      len = scanner.nextInt();
    } else {
      len = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    System.out.printf("%d=len\n", len);
    len *= 2;
    System.out.printf("len*2=%d\n", len);
    len /= 2;
    int[] tab = new int[len];
    for (int i = 0; i < len; i++)
    {
        int tmpi1;
        if (scanner.hasNext("^-")) {
          scanner.next("^-");
          tmpi1 = scanner.nextInt();
        } else {
          tmpi1 = scanner.nextInt();
        }
        scanner.findWithinHorizon("[\n\r ]*", 1);
        System.out.printf("%d=>%d ", i, tmpi1);
        tab[i] = tmpi1;
    }
    System.out.print("\n");
    int[] tab2 = new int[len];
    for (int i_ = 0; i_ < len; i_++)
    {
        int tmpi2;
        if (scanner.hasNext("^-")) {
          scanner.next("^-");
          tmpi2 = scanner.nextInt();
        } else {
          tmpi2 = scanner.nextInt();
        }
        scanner.findWithinHorizon("[\n\r ]*", 1);
        System.out.printf("%d==>%d ", i_, tmpi2);
        tab2[i_] = tmpi2;
    }
    int strlen;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      strlen = scanner.nextInt();
    } else {
      strlen = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    System.out.printf("%d=strlen\n", strlen);
    char[] tab4 = new char[strlen];
    for (int toto = 0; toto < strlen; toto++)
    {
        char tmpc = scanner.findWithinHorizon(".", 1).charAt(0);
        int c = (int)(tmpc);
        System.out.printf("%c:%d ", tmpc, c);
        if (tmpc != ' ')
            c = (c - (int)('a') + 13) % 26 + (int)('a');
        tab4[toto] = (char)(c);
    }
    for (int j = 0; j < strlen; j++)
        System.out.print(tab4[j]);
  }
  
}



<|start_filename|>out/euler32.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

/* 
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once;
for example, the 5-digit number, 15234, is 1 through 5 pandigital.

The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier,
and product is 1 through 9 pandigital.

Find the sum of all products whose multiplicand/multiplier/product identity can be written as a
1 through 9 pandigital.

HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.


(a * 10 + b) ( c * 100 + d * 10 + e) =
  a * c * 1000 +
  a * d * 100 +
  a * e * 10 +
  b * c * 100 +
  b * d * 10 +
  b * e
  => b != e != b * e % 10 ET
  a != d != (b * e / 10 + b * d + a * e ) % 10
 */


int okdigits(int* ok, int n) {
    if (n == 0)
        return 1;
    else
    {
        int digit = n % 10;
        if (ok[digit])
        {
            ok[digit] = 0;
            int o = okdigits(ok, n / 10);
            ok[digit] = 1;
            return o;
        }
        else
            return 0;
    }
}
int main(void) {
    int e, b, a, c, d, j, i;
    int count = 0;
    int *allowed = calloc(10, sizeof(int));
    for (i = 0; i < 10; i++)
        allowed[i] = i != 0;
    int *counted = calloc(100000, sizeof(int));
    for (j = 0; j < 100000; j++)
        counted[j] = 0;
    for (e = 1; e < 10; e++)
    {
        allowed[e] = 0;
        for (b = 1; b < 10; b++)
            if (allowed[b])
            {
                allowed[b] = 0;
                int be = b * e % 10;
                if (allowed[be])
                {
                    allowed[be] = 0;
                    for (a = 1; a < 10; a++)
                        if (allowed[a])
                        {
                            allowed[a] = 0;
                            for (c = 1; c < 10; c++)
                                if (allowed[c])
                                {
                                    allowed[c] = 0;
                                    for (d = 1; d < 10; d++)
                                        if (allowed[d])
                                        {
                                            allowed[d] = 0;
                                            /* 2 * 3 digits */
                                            int product = (a * 10 + b) * (c * 100 + d * 10 + e);
                                            if (!counted[product] && okdigits(allowed, product / 10))
                                            {
                                                counted[product] = 1;
                                                count += product;
                                                printf("%d ", product);
                                            }
                                            /* 1  * 4 digits */
                                            int product2 = b * (a * 1000 + c * 100 + d * 10 + e);
                                            if (!counted[product2] && okdigits(allowed, product2 / 10))
                                            {
                                                counted[product2] = 1;
                                                count += product2;
                                                printf("%d ", product2);
                                            }
                                            allowed[d] = 1;
                                        }
                                    allowed[c] = 1;
                                }
                            allowed[a] = 1;
                        }
                    allowed[be] = 1;
                }
                allowed[b] = 1;
            }
        allowed[e] = 1;
    }
    printf("%d\n", count);
    return 0;
}




<|start_filename|>out/affect_param.cpp<|end_filename|>
#include <iostream>
#include <vector>

void foo(int a) {
    a = 4;
}

int main() {
    int a = 0;
    foo(a);
    std::cout << a << "\n";
}



<|start_filename|>out/euler27.js<|end_filename|>
var util = require("util");
function eratostene(t, max0){
    var n = 0;
    for (var i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            var j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
}
function isPrime(n, primes, len){
    var i = 0;
    if (n < 0)
        n = -n;
    while (primes[i] * primes[i] < n)
    {
        if (~~(n % primes[i]) == 0)
            return false;
        i++;
    }
    return true;
}
function test(a, b, primes, len){
    for (var n = 0; n < 201; n++)
    {
        var j = n * n + a * n + b;
        if (!isPrime(j, primes, len))
            return n;
    }
    return 200;
}
var maximumprimes = 1000;
var era = new Array(maximumprimes);
for (var j = 0; j < maximumprimes; j++)
    era[j] = j;
var result = 0;
var max0 = 0;
var nprimes = eratostene(era, maximumprimes);
var primes = new Array(nprimes);
for (var o = 0; o < nprimes; o++)
    primes[o] = 0;
var l = 0;
for (var k = 2; k < maximumprimes; k++)
    if (era[k] == k)
    {
        primes[l] = k;
        l++;
    }
util.print(l, " == ", nprimes, "\n");
var ma = 0;
var mb = 0;
for (var b = 3; b < 1000; b++)
    if (era[b] == b)
        for (var a = -999; a < 1000; a++)
        {
            var n1 = test(a, b, primes, nprimes);
            var n2 = test(a, -b, primes, nprimes);
            if (n1 > max0)
            {
                max0 = n1;
                result = a * b;
                ma = a;
                mb = b;
            }
            if (n2 > max0)
            {
                max0 = n2;
                result = -a * b;
                ma = a;
                mb = -b;
            }
        }
util.print(ma, " ", mb, "\n", max0, "\n", result, "\n");



<|start_filename|>out/ocaml01.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure ocaml01 is


type stringptr is access all char_array;
function foo return Integer is
begin
  for i in integer range 0..10 loop
    NULL;
    
  end loop;
  return 0;
end;
function bar return Integer is
  a : Integer;
begin
  for i in integer range 0..10 loop
    a := 0;
  end loop;
  return 0;
end;

begin
  NULL;
  
end;


<|start_filename|>out/euler27.lua<|end_filename|>
function eratostene (t, max0)
  local n = 0
  for i = 2, max0 - 1 do
      if t[i + 1] == i then
          n = n + 1
          local j = i * i
          while j < max0 and j > 0 do
              t[j + 1] = 0
              j = j + i
          end
      end
  end
  return n
end

function isPrime (n, primes, len)
  local i = 0
  if n < 0 then
      n = -n
  end
  while primes[i + 1] * primes[i + 1] < n do
      if math.fmod(n, primes[i + 1]) == 0 then
          return false
      end
      i = i + 1
  end
  return true
end

function test (a, b, primes, len)
  for n = 0, 200 do
      local j = n * n + a * n + b
      if not(isPrime(j, primes, len)) then
          return n
      end
  end
  return 200
end

local maximumprimes = 1000
local era = {}
for j = 0, maximumprimes - 1 do
    era[j + 1] = j
end
local result = 0
local max0 = 0
local nprimes = eratostene(era, maximumprimes)
local primes = {}
for o = 0, nprimes - 1 do
    primes[o + 1] = 0
end
local l = 0
for k = 2, maximumprimes - 1 do
    if era[k + 1] == k then
        primes[l + 1] = k
        l = l + 1
    end
end
io.write(string.format("%d == %d\n", l, nprimes))
local ma = 0
local mb = 0
for b = 3, 999 do
    if era[b + 1] == b then
        for a = -999, 999 do
            local n1 = test(a, b, primes, nprimes)
            local n2 = test(a, -b, primes, nprimes)
            if n1 > max0 then
                max0 = n1
                result = a * b
                ma = a
                mb = b
            end
            if n2 > max0 then
                max0 = n2
                result = -a * b
                ma = a
                mb = -b
            end
        end
    end
end
io.write(string.format("%d %d\n%d\n%d\n", ma, mb, max0, result))


<|start_filename|>out/euler02.js<|end_filename|>
var util = require("util");

var a = 1;
var b = 2;
var sum = 0;
while (a < 4000000)
{
    if (~~(a % 2) == 0)
        sum += a;
    var c = a;
    a = b;
    b += c;
}
util.print(sum, "\n");



<|start_filename|>out/euler04.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
\ 
\ 
\ (a + b * 10 + c * 100) * (d + e * 10 + f * 100) =
\ a * d + a * e * 10 + a * f * 100 +
\ 10 * (b * d + b * e * 10 + b * f * 100)+
\ 100 * (c * d + c * e * 10 + c * f * 100) =
\ 
\ a * d       + a * e * 10   + a * f * 100 +
\ b * d * 10  + b * e * 100  + b * f * 1000 +
\ c * d * 100 + c * e * 1000 + c * f * 10000 =
\ 
\ a * d +
\ 10 * ( a * e + b * d) +
\ 100 * (a * f + b * e + c * d) +
\ (c * e + b * f) * 1000 +
\ c * f * 10000
\ 
\ 

: chiffre recursive { c m }
  c 0 =
  IF
    m 10 % exit
  ELSE
    c 1 - m 10 // chiffre exit
  THEN
;

: main
  1 { m }
  9 0 BEGIN 2dup >= WHILE DUP { a }
    9 1 BEGIN 2dup >= WHILE DUP { f }
      9 0 BEGIN 2dup >= WHILE DUP { d }
        9 1 BEGIN 2dup >= WHILE DUP { c }
          9 0 BEGIN 2dup >= WHILE DUP { b }
            9 0 BEGIN 2dup >= WHILE DUP { e }
              a d * 10 a e * b d * + * + 100 a f * b e * + c d * + * + 1000 c e * b f * + * + 10000 c * f * +
              { mul }
              0 mul chiffre 5 mul chiffre = 1 mul chiffre 4 mul chiffre = AND 2 mul chiffre 3 mul chiffre = AND
              IF
                mul m max TO m
              THEN
             1 + REPEAT 2DROP
           1 + REPEAT 2DROP
         1 + REPEAT 2DROP
       1 + REPEAT 2DROP
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  m s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/testing_count.cc<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    std::vector<int> *tab = new std::vector<int>( 40 );
    for (int i = 0; i < 40; i++)
        tab->at(i) = i * i;
    std::cout << (tab)->size() << "\n";
}



<|start_filename|>out/affect.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
data Toto = Toto {
                    _foo :: IORef Int,
                    _bar :: IORef Int,
                    _blah :: IORef Int
                    }
  deriving Eq


mktoto v1 =
  (Toto <$> (newIORef v1) <*> (newIORef v1) <*> (newIORef v1))

mktoto2 v1 =
  (Toto <$> (newIORef (v1 + 3)) <*> (newIORef (v1 + 2)) <*> (newIORef (v1 + 1)))

result t_ t2_ =
  do t3 <- (Toto <$> (newIORef 0) <*> (newIORef 0) <*> (newIORef 0))
     writeIORef (_blah t2_) =<< (((+) 1) <$> (readIORef (_blah t2_)))
     cache0 <- array_init 1 (\ i ->
                               return (- i))
     cache1 <- array_init 1 (\ j ->
                               return j)
     ((+) <$> ((+) <$> (readIORef (_foo t2_)) <*> ((*) <$> (readIORef (_blah t2_)) <*> (readIORef (_bar t2_)))) <*> ((*) <$> (readIORef (_bar t2_)) <*> (readIORef (_foo t2_))))

main =
  do t <- mktoto 4
     t2 <- mktoto 5
     a <- read_int
     writeIORef (_bar t) a
     skip_whitespaces
     b <- read_int
     writeIORef (_blah t) b
     skip_whitespaces
     c <- read_int
     writeIORef (_bar t2) c
     skip_whitespaces
     d <- read_int
     writeIORef (_blah t2) d
     join $ printf "%d%d" <$> ((result t t2)::IO Int) <*> ((readIORef (_blah t))::IO Int)




<|start_filename|>out/bigints.cc<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>
struct bigint {
    bool bigint_sign;
    int bigint_len;
    std::vector<int> * bigint_chiffres;
};


bigint * read_bigint(int len) {
    char c;
    std::vector<int> *chiffres = new std::vector<int>( len );
    for (int j = 0; j < len; j++)
    {
        std::cin >> c >> std::noskipws;
        chiffres->at(j) = (int)(c);
    }
    for (int i = 0; i <= (len - 1) / 2; i++)
    {
        int tmp = chiffres->at(i);
        chiffres->at(i) = chiffres->at(len - 1 - i);
        chiffres->at(len - 1 - i) = tmp;
    }
    bigint * e = new bigint();
        e->bigint_sign = true;
        e->bigint_len = len;
        e->bigint_chiffres = chiffres;;
    return e;
}


void print_bigint(bigint * a) {
    if (!a->bigint_sign)
        std::cout << '-';
    for (int i = 0; i < a->bigint_len; i++)
        std::cout << a->bigint_chiffres->at(a->bigint_len - 1 - i);
}


bool bigint_eq(bigint * a, bigint * b) {
    //  Renvoie vrai si a = b 
    if (a->bigint_sign != b->bigint_sign)
        return false;
    else if (a->bigint_len != b->bigint_len)
        return false;
    else
    {
        for (int i = 0; i < a->bigint_len; i++)
            if (a->bigint_chiffres->at(i) != b->bigint_chiffres->at(i))
                return false;
        return true;
    }
}


bool bigint_gt(bigint * a, bigint * b) {
    //  Renvoie vrai si a > b 
    if (a->bigint_sign && !b->bigint_sign)
        return true;
    else if (!a->bigint_sign && b->bigint_sign)
        return false;
    else
    {
        if (a->bigint_len > b->bigint_len)
            return a->bigint_sign;
        else if (a->bigint_len < b->bigint_len)
            return !a->bigint_sign;
        else
            for (int i = 0; i < a->bigint_len; i++)
            {
                int j = a->bigint_len - 1 - i;
                if (a->bigint_chiffres->at(j) > b->bigint_chiffres->at(j))
                    return a->bigint_sign;
                else if (a->bigint_chiffres->at(j) < b->bigint_chiffres->at(j))
                    return !a->bigint_sign;
            }
        return true;
    }
}


bool bigint_lt(bigint * a, bigint * b) {
    return !bigint_gt(a, b);
}


bigint * add_bigint_positif(bigint * a, bigint * b) {
    //  Une addition ou on en a rien a faire des signes 
    int len = std::max(a->bigint_len, b->bigint_len) + 1;
    int retenue = 0;
    std::vector<int> *chiffres = new std::vector<int>( len );
    for (int i = 0; i < len; i++)
    {
        int tmp = retenue;
        if (i < a->bigint_len)
            tmp += a->bigint_chiffres->at(i);
        if (i < b->bigint_len)
            tmp += b->bigint_chiffres->at(i);
        retenue = tmp / 10;
        chiffres->at(i) = tmp % 10;
    }
    while (len > 0 && chiffres->at(len - 1) == 0)
        len--;
    bigint * f = new bigint();
        f->bigint_sign = true;
        f->bigint_len = len;
        f->bigint_chiffres = chiffres;;
    return f;
}


bigint * sub_bigint_positif(bigint * a, bigint * b) {
    /* Une soustraction ou on en a rien a faire des signes
Pré-requis : a > b
*/
    int len = a->bigint_len;
    int retenue = 0;
    std::vector<int> *chiffres = new std::vector<int>( len );
    for (int i = 0; i < len; i++)
    {
        int tmp = retenue + a->bigint_chiffres->at(i);
        if (i < b->bigint_len)
            tmp -= b->bigint_chiffres->at(i);
        if (tmp < 0)
        {
            tmp += 10;
            retenue = -1;
        }
        else
            retenue = 0;
        chiffres->at(i) = tmp;
    }
    while (len > 0 && chiffres->at(len - 1) == 0)
        len--;
    bigint * g = new bigint();
        g->bigint_sign = true;
        g->bigint_len = len;
        g->bigint_chiffres = chiffres;;
    return g;
}


bigint * neg_bigint(bigint * a) {
    bigint * h = new bigint();
        h->bigint_sign = !a->bigint_sign;
        h->bigint_len = a->bigint_len;
        h->bigint_chiffres = a->bigint_chiffres;;
    return h;
}


bigint * add_bigint(bigint * a, bigint * b) {
    if (a->bigint_sign == b->bigint_sign)
        if (a->bigint_sign)
            return add_bigint_positif(a, b);
        else
            return neg_bigint(add_bigint_positif(a, b));
    else if (a->bigint_sign)
    {
        //  a positif, b negatif 
        if (bigint_gt(a, neg_bigint(b)))
            return sub_bigint_positif(a, b);
        else
            return neg_bigint(sub_bigint_positif(b, a));
    }
    else
        //  a negatif, b positif 
        if (bigint_gt(neg_bigint(a), b))
            return neg_bigint(sub_bigint_positif(a, b));
        else
            return sub_bigint_positif(b, a);
}


bigint * sub_bigint(bigint * a, bigint * b) {
    return add_bigint(a, neg_bigint(b));
}


bigint * mul_bigint_cp(bigint * a, bigint * b) {
    /* Cet algorithm est quadratique.
C'est le même que celui qu'on enseigne aux enfants en CP.
D'ou le nom de la fonction. */
    int len = a->bigint_len + b->bigint_len + 1;
    std::vector<int> *chiffres = new std::vector<int>( len );
    std::fill(chiffres->begin(), chiffres->end(), 0);
    for (int i = 0; i < a->bigint_len; i++)
    {
        int retenue = 0;
        for (int j = 0; j < b->bigint_len; j++)
        {
            chiffres->at(i + j) += retenue + b->bigint_chiffres->at(j) * a->bigint_chiffres->at(i);
            retenue = chiffres->at(i + j) / 10;
            chiffres->at(i + j) = chiffres->at(i + j) % 10;
        }
        chiffres->at(i + b->bigint_len) += retenue;
    }
    chiffres->at(a->bigint_len + b->bigint_len) = chiffres->at(a->bigint_len + b->bigint_len - 1) / 10;
    chiffres->at(a->bigint_len + b->bigint_len - 1) = chiffres->at(a->bigint_len + b->bigint_len - 1) % 10;
    for (int l = 0; l < 3; l++)
        if (len != 0 && chiffres->at(len - 1) == 0)
            len--;
    bigint * m = new bigint();
        m->bigint_sign = a->bigint_sign == b->bigint_sign;
        m->bigint_len = len;
        m->bigint_chiffres = chiffres;;
    return m;
}


bigint * bigint_premiers_chiffres(bigint * a, int i) {
    int len = std::min(i, a->bigint_len);
    while (len != 0 && a->bigint_chiffres->at(len - 1) == 0)
        len--;
    bigint * o = new bigint();
        o->bigint_sign = a->bigint_sign;
        o->bigint_len = len;
        o->bigint_chiffres = a->bigint_chiffres;;
    return o;
}


bigint * bigint_shift(bigint * a, int i) {
    std::vector<int> *chiffres = new std::vector<int>( a->bigint_len + i );
    for (int k = 0; k < a->bigint_len + i; k++)
        if (k >= i)
            chiffres->at(k) = a->bigint_chiffres->at(k - i);
        else
            chiffres->at(k) = 0;
    bigint * p = new bigint();
        p->bigint_sign = a->bigint_sign;
        p->bigint_len = a->bigint_len + i;
        p->bigint_chiffres = chiffres;;
    return p;
}


bigint * mul_bigint(bigint * aa, bigint * bb) {
    if (aa->bigint_len == 0)
        return aa;
    else if (bb->bigint_len == 0)
        return bb;
    else if (aa->bigint_len < 3 || bb->bigint_len < 3)
        return mul_bigint_cp(aa, bb);
    //  Algorithme de Karatsuba 
    int split = std::min(aa->bigint_len, bb->bigint_len) / 2;
    bigint * a = bigint_shift(aa, -split);
    bigint * b = bigint_premiers_chiffres(aa, split);
    bigint * c = bigint_shift(bb, -split);
    bigint * d = bigint_premiers_chiffres(bb, split);
    bigint * amoinsb = sub_bigint(a, b);
    bigint * cmoinsd = sub_bigint(c, d);
    bigint * ac = mul_bigint(a, c);
    bigint * bd = mul_bigint(b, d);
    bigint * amoinsbcmoinsd = mul_bigint(amoinsb, cmoinsd);
    bigint * acdec = bigint_shift(ac, 2 * split);
    return add_bigint(add_bigint(acdec, bd), bigint_shift(sub_bigint(add_bigint(ac, bd), amoinsbcmoinsd), split));
    //  ac × 102k + (ac + bd – (a – b)(c – d)) × 10k + bd 
}

/*
Division,
Modulo
*/

int log10(int a) {
    int out0 = 1;
    while (a >= 10)
    {
        a /= 10;
        out0++;
    }
    return out0;
}


bigint * bigint_of_int(int i) {
    int size = log10(i);
    if (i == 0)
        size = 0;
    std::vector<int> *t = new std::vector<int>( size );
    std::fill(t->begin(), t->end(), 0);
    for (int k = 0; k < size; k++)
    {
        t->at(k) = i % 10;
        i /= 10;
    }
    bigint * q = new bigint();
        q->bigint_sign = true;
        q->bigint_len = size;
        q->bigint_chiffres = t;;
    return q;
}


bigint * fact_bigint(bigint * a) {
    bigint * one = bigint_of_int(1);
    bigint * out0 = one;
    while (!bigint_eq(a, one))
    {
        out0 = mul_bigint(a, out0);
        a = sub_bigint(a, one);
    }
    return out0;
}


int sum_chiffres_bigint(bigint * a) {
    int out0 = 0;
    for (int i = 0; i < a->bigint_len; i++)
        out0 += a->bigint_chiffres->at(i);
    return out0;
}

//  http://projecteuler.net/problem=20 

int euler20() {
    bigint * a = bigint_of_int(15);
    //  normalement c'est 100 
    a = fact_bigint(a);
    return sum_chiffres_bigint(a);
}


bigint * bigint_exp(bigint * a, int b) {
    if (b == 1)
        return a;
    else if (b % 2 == 0)
        return bigint_exp(mul_bigint(a, a), b / 2);
    else
        return mul_bigint(a, bigint_exp(a, b - 1));
}


bigint * bigint_exp_10chiffres(bigint * a, int b) {
    a = bigint_premiers_chiffres(a, 10);
    if (b == 1)
        return a;
    else if (b % 2 == 0)
        return bigint_exp_10chiffres(mul_bigint(a, a), b / 2);
    else
        return mul_bigint(a, bigint_exp_10chiffres(a, b - 1));
}


void euler48() {
    bigint * sum = bigint_of_int(0);
    for (int i = 1; i < 101; i++)
    {
        //  1000 normalement 
        bigint * ib = bigint_of_int(i);
        bigint * ibeib = bigint_exp_10chiffres(ib, i);
        sum = add_bigint(sum, ibeib);
        sum = bigint_premiers_chiffres(sum, 10);
    }
    std::cout << "euler 48 = ";
    print_bigint(sum);
    std::cout << "\n";
}


int euler16() {
    bigint * a = bigint_of_int(2);
    a = bigint_exp(a, 100);
    //  1000 normalement 
    return sum_chiffres_bigint(a);
}


int euler25() {
    int i = 2;
    bigint * a = bigint_of_int(1);
    bigint * b = bigint_of_int(1);
    while (b->bigint_len < 100)
    {
        //  1000 normalement 
        bigint * c = add_bigint(a, b);
        a = b;
        b = c;
        i++;
    }
    return i;
}


int euler29() {
    int maxA = 5;
    int maxB = 5;
    std::vector<bigint *> *a_bigint = new std::vector<bigint *>( maxA + 1 );
    for (int j = 0; j <= maxA; j++)
        a_bigint->at(j) = bigint_of_int(j * j);
    std::vector<bigint *> *a0_bigint = new std::vector<bigint *>( maxA + 1 );
    for (int j2 = 0; j2 <= maxA; j2++)
        a0_bigint->at(j2) = bigint_of_int(j2);
    std::vector<int> *b = new std::vector<int>( maxA + 1 );
    std::fill(b->begin(), b->end(), 2);
    int n = 0;
    bool found = true;
    while (found)
    {
        bigint * min0 = a0_bigint->at(0);
        found = false;
        for (int i = 2; i <= maxA; i++)
            if (b->at(i) <= maxB)
                if (found)
                {
                    if (bigint_lt(a_bigint->at(i), min0))
                        min0 = a_bigint->at(i);
                }
                else
                {
                    min0 = a_bigint->at(i);
                    found = true;
                }
        if (found)
        {
            n++;
            for (int l = 2; l <= maxA; l++)
                if (bigint_eq(a_bigint->at(l), min0) && b->at(l) <= maxB)
                {
                    b->at(l)++;
                    a_bigint->at(l) = mul_bigint(a_bigint->at(l), a0_bigint->at(l));
                }
        }
    }
    return n;
}

int main() {
    std::cout << euler29() << "\n";
    bigint * sum = read_bigint(50);
    for (int i = 2; i < 101; i++)
    {
        std::cin >> std::skipws;
        bigint * tmp = read_bigint(50);
        sum = add_bigint(sum, tmp);
    }
    std::cout << "euler13 = ";
    print_bigint(sum);
    std::cout << "\neuler25 = " << euler25() << "\neuler16 = " << euler16() << "\n";
    euler48();
    std::cout << "euler20 = " << euler20() << "\n";
    bigint * a = bigint_of_int(999999);
    bigint * b = bigint_of_int(9951263);
    print_bigint(a);
    std::cout << ">>1=";
    print_bigint(bigint_shift(a, -1));
    std::cout << "\n";
    print_bigint(a);
    std::cout << "*";
    print_bigint(b);
    std::cout << "=";
    print_bigint(mul_bigint(a, b));
    std::cout << "\n";
    print_bigint(a);
    std::cout << "*";
    print_bigint(b);
    std::cout << "=";
    print_bigint(mul_bigint_cp(a, b));
    std::cout << "\n";
    print_bigint(a);
    std::cout << "+";
    print_bigint(b);
    std::cout << "=";
    print_bigint(add_bigint(a, b));
    std::cout << "\n";
    print_bigint(b);
    std::cout << "-";
    print_bigint(a);
    std::cout << "=";
    print_bigint(sub_bigint(b, a));
    std::cout << "\n";
    print_bigint(a);
    std::cout << "-";
    print_bigint(b);
    std::cout << "=";
    print_bigint(sub_bigint(a, b));
    std::cout << "\n";
    print_bigint(a);
    std::cout << ">";
    print_bigint(b);
    std::cout << "=";
    if (bigint_gt(a, b))
        std::cout << "True";
    else
        std::cout << "False";
    std::cout << "\n";
}



<|start_filename|>out/euler07.js<|end_filename|>
var util = require("util");
function divisible(n, t, size){
    for (var i = 0; i < size; i++)
        if (~~(n % t[i]) == 0)
            return true;
    return false;
}
function find(n, t, used, nth){
    while (used != nth)
        if (divisible(n, t, used))
            n++;
        else
        {
            t[used] = n;
            n++;
            used++;
        }
    return t[used - 1];
}
var n = 10001;
var t = new Array(n);
for (var i = 0; i < n; i++)
    t[i] = 2;
util.print(find(3, t, 1, n), "\n");



<|start_filename|>out/euler46.java<|end_filename|>
import java.util.*;

public class euler46
{
  
  static int eratostene(int[] t, int max0)
  {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            if (max0 / i > i)
            {
                int j = i * i;
                while (j < max0 && j > 0)
                {
                    t[j] = 0;
                    j += i;
                }
            }
        }
    return n;
  }
  public static void main(String args[])
  {
    int maximumprimes = 6000;
    int[] era = new int[maximumprimes];
    for (int j_ = 0; j_ < maximumprimes; j_++)
        era[j_] = j_;
    int nprimes = eratostene(era, maximumprimes);
    int[] primes = new int[nprimes];
    for (int o = 0; o < nprimes; o++)
        primes[o] = 0;
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    System.out.printf("%d == %d\n", l, nprimes);
    boolean[] canbe = new boolean[maximumprimes];
    for (int i_ = 0; i_ < maximumprimes; i_++)
        canbe[i_] = false;
    for (int i = 0; i < nprimes; i++)
        for (int j = 0; j < maximumprimes; j++)
        {
            int n = primes[i] + 2 * j * j;
            if (n < maximumprimes)
                canbe[n] = true;
        }
    for (int m = 1; m <= maximumprimes; m++)
    {
        int m2 = m * 2 + 1;
        if (m2 < maximumprimes && !canbe[m2])
            System.out.printf("%d\n", m2);
    }
  }
  
}



<|start_filename|>out/prologin_template_intmatrix.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function programme_candidat(tableau, x, y){
    var out0 = 0;
    for (var i = 0; i < y; i++)
        for (var j = 0; j < x; j++)
            out0 += tableau[i][j] * (i * 2 + j);
    return out0;
}
var taille_x = read_int_();
stdinsep();
var taille_y = read_int_();
stdinsep();
var tableau = new Array(taille_y);
for (var a = 0; a < taille_y; a++)
{
    var b = new Array(taille_x);
    for (var c = 0; c < taille_x; c++)
    {
        b[c] = read_int_();
        stdinsep();
    }
    tableau[a] = b;
}
util.print(programme_candidat(tableau, taille_x, taille_y), "\n");



<|start_filename|>out/longest_increasing_subsequence.cc<|end_filename|>
#include <iostream>
#include <vector>

int dichofind(int len, std::vector<int> * tab, int tofind, int a, int b) {
    if (a >= b - 1)
        return a;
    else
    {
        int c = (a + b) / 2;
        if (tab->at(c) < tofind)
            return dichofind(len, tab, tofind, c, b);
        else
            return dichofind(len, tab, tofind, a, c);
    }
}


int process(int len, std::vector<int> * tab) {
    std::vector<int> *size = new std::vector<int>( len );
    for (int j = 0; j < len; j++)
        if (j == 0)
            size->at(j) = 0;
        else
            size->at(j) = len * 2;
    for (int i = 0; i < len; i++)
    {
        int k = dichofind(len, size, tab->at(i), 0, len - 1);
        if (size->at(k + 1) > tab->at(i))
            size->at(k + 1) = tab->at(i);
    }
    for (int l = 0; l < len; l++)
        std::cout << size->at(l) << " ";
    for (int m = 0; m < len; m++)
    {
        int k = len - 1 - m;
        if (size->at(k) != len * 2)
            return k;
    }
    return 0;
}

int main() {
    int len, n;
    std::cin >> n;
    for (int i = 1; i <= n; i++)
    {
        std::cin >> len;
        std::vector<int> *d = new std::vector<int>( len );
        for (int e = 0; e < len; e++)
        {
            std::cin >> d->at(e);
        }
        std::cout << process(len, d) << "\n";
    }
}



<|start_filename|>out/euler39.js<|end_filename|>
var util = require("util");

var t = new Array(1001);
for (var i = 0; i < 1001; i++)
    t[i] = 0;
for (var a = 1; a < 1001; a++)
    for (var b = 1; b < 1001; b++)
    {
        var c2 = a * a + b * b;
        var c = Math.floor(Math.sqrt(c2));
        if (c * c == c2)
        {
            var p = a + b + c;
            if (p < 1001)
                t[p]++;
        }
    }
var j = 0;
for (var k = 1; k < 1001; k++)
    if (t[k] > t[j])
        j = k;
util.print(j);



<|start_filename|>out/euler40.cpp<|end_filename|>
#include <iostream>
#include <vector>

int exp0(int a, int e) {
    int o = 1;
    for (int i = 1; i <= e; i++)
        o *= a;
    return o;
}


int e(std::vector<int>& t, int n) {
    for (int i = 1; i < 9; i++)
        if (n >= t[i] * i)
            n -= t[i] * i;
        else
        {
            int nombre = exp0(10, i - 1) + n / i;
            int chiffre = i - 1 - n % i;
            return nombre / exp0(10, chiffre) % 10;
        }
    return -1;
}

int main() {
    std::vector<int> t( 9 );
    for (int i = 0; i < 9; i++)
        t[i] = exp0(10, i) - exp0(10, i - 1);
    for (int i2 = 1; i2 < 9; i2++)
        std::cout << i2 << " => " << t[i2] << "\n";
    for (int j = 0; j < 81; j++)
        std::cout << e(t, j);
    std::cout << "\n";
    for (int k = 1; k < 51; k++)
        std::cout << k;
    std::cout << "\n";
    for (int j2 = 169; j2 < 221; j2++)
        std::cout << e(t, j2);
    std::cout << "\n";
    for (int k2 = 90; k2 < 111; k2++)
        std::cout << k2;
    std::cout << "\n";
    int out0 = 1;
    for (int l = 0; l < 7; l++)
    {
        int puiss = exp0(10, l);
        int v = e(t, puiss - 1);
        out0 *= v;
        std::cout << "10^" << l << "=" << puiss << " v=" << v << "\n";
    }
    std::cout << out0 << "\n";
}



<|start_filename|>out/euler42.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;
with Ada.Numerics.Elementary_Functions;
procedure euler42 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
function is_triangular(n : in Integer) return Boolean is
  a : Integer;
begin
  --
  --   n = k * (k + 1) / 2
  --	  n * 2 = k * (k + 1)
  --   
  
  a := Integer(Float'Truncation(Ada.Numerics.Elementary_Functions.Sqrt(Float(n * 2))));
  return a * (a + 1) = n * 2;
end;
function score return Integer is
  sum : Integer;
  len : Integer;
  c : Character;
begin
  SkipSpaces;
  Get(len);
  SkipSpaces;
  sum := 0;
  for i in integer range 1..len loop
    Get(c);
    sum := sum + Character'Pos(c) - Character'Pos('A') + 1;
    --		print c print " " print sum print " " 
    
  end loop;
  if is_triangular(sum)
  then
    return 1;
  else
    return 0;
  end if;
end;

  sum : Integer;
  n : Integer;
begin
  for i in integer range 1..55 loop
    if is_triangular(i)
    then
      PInt(i);
      PString(new char_array'( To_C(" ")));
    end if;
  end loop;
  PString(new char_array'( To_C("" & Character'Val(10))));
  sum := 0;
  Get(n);
  for i in integer range 1..n loop
    sum := sum + score;
  end loop;
  PInt(sum);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/npi.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
: read-char current-char next-char ;
: is_number { c }
  c [char] 9 <= c [char] 0 >= AND exit
;


\ 
\ Notation polonaise inversée, ce test permet d'évaluer une expression écrite en NPI
\ 

: npi0 { str len }
  HERE len cells allot { stack }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    0 stack  i cells +  !
   1 + REPEAT 2DROP
  0 { ptrStack }
  0 { ptrStr }
  BEGIN
    ptrStr len <
  WHILE
    str  ptrStr cells +  @ 32 =
    IF
      ptrStr 1 + TO ptrStr
    ELSE
      str  ptrStr cells +  @ is_number
      IF
        0 { num }
        BEGIN
          str  ptrStr cells +  @ 32 <>
        WHILE
          num 10 * str  ptrStr cells +  @ + [char] 0 - TO num
          ptrStr 1 + TO ptrStr
        REPEAT
        num stack  ptrStack cells +  !
        ptrStack 1 + TO ptrStack
      ELSE
        str  ptrStr cells +  @ 43 =
        IF
          stack  ptrStack 2 - cells +  @ stack  ptrStack 1 - cells +  @ + stack  ptrStack 2 - cells +  !
          ptrStack 1 - TO ptrStack
          ptrStr 1 + TO ptrStr
        THEN
      THEN
    THEN
  REPEAT
  stack  0 cells +  @ exit
;

: main
  0 { len }
  read-int TO len
  skipspaces
  HERE len cells allot { tab }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    0 { tmp }
    read-char TO tmp
    tmp tab  i cells +  !
   1 + REPEAT 2DROP
  tab len npi0 { result }
  result s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/euler30.cs<|end_filename|>
using System;

public class euler30
{
  
  public static void Main(String[] args)
  {
    /*
a + b * 10 + c * 100 + d * 1000 + e * 10 000 =
  a ^ 5 +
  b ^ 5 +
  c ^ 5 +
  d ^ 5 +
  e ^ 5
*/
    int[] p = new int[10];
    for (int i = 0; i < 10; i++)
        p[i] = i * i * i * i * i;
    int sum = 0;
    for (int a = 0; a < 10; a++)
        for (int b = 0; b < 10; b++)
            for (int c = 0; c < 10; c++)
                for (int d = 0; d < 10; d++)
                    for (int e = 0; e < 10; e++)
                        for (int f = 0; f < 10; f++)
                        {
                            int s = p[a] + p[b] + p[c] + p[d] + p[e] + p[f];
                            int r = a + b * 10 + c * 100 + d * 1000 + e * 10000 + f * 100000;
                            if (s == r && r != 1)
                            {
                                Console.Write("" + f + e + d + c + b + a + " " + r + "\n");
                                sum += r;
                            }
                        }
    Console.Write(sum);
  }
  
}



<|start_filename|>out/euler08.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    char e, c;
    int i = 1;
    std::vector<int> last( 5 );
    for (int j = 0; j < 5; j++)
    {
        std::cin >> c >> std::noskipws;
        int d = (int)(c) - (int)('0');
        i *= d;
        last[j] = d;
    }
    int max0 = i;
    int index = 0;
    int nskipdiv = 0;
    for (int k = 1; k < 996; k++)
    {
        std::cin >> e >> std::noskipws;
        int f = (int)(e) - (int)('0');
        if (f == 0)
        {
            i = 1;
            nskipdiv = 4;
        }
        else
        {
            i *= f;
            if (nskipdiv < 0)
                i /= last[index];
            nskipdiv--;
        }
        last[index] = f;
        index = (index + 1) % 5;
        max0 = std::max(max0, i);
    }
    std::cout << max0 << "\n";
}



<|start_filename|>out/tuple.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

typedef struct tuple_int_int {
  int tuple_int_int_field_0;
    int tuple_int_int_field_1;
} tuple_int_int;

struct tuple_int_int * f(struct tuple_int_int * tuple0) {
    struct tuple_int_int * c = tuple0;
    int a = c->tuple_int_int_field_0;
    int b = c->tuple_int_int_field_1;
    struct tuple_int_int * d = malloc(sizeof(tuple_int_int));
    d->tuple_int_int_field_0 = a + 1;
    d->tuple_int_int_field_1 = b + 1;
    return d;
}
int main(void) {
    struct tuple_int_int * e = malloc(sizeof(tuple_int_int));
    e->tuple_int_int_field_0 = 0;
    e->tuple_int_int_field_1 = 1;
    struct tuple_int_int * t = f(e);
    struct tuple_int_int * g = t;
    int a = g->tuple_int_int_field_0;
    int b = g->tuple_int_int_field_1;
    printf("%d -- %d--\n", a, b);
    return 0;
}




<|start_filename|>out/linkedList.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

class Intlist {
  int head
  Intlist tail
}
Intlist cons(Intlist list, int i)
{
  Intlist out0 = new Intlist()
  out0.head = i
  out0.tail = list
  return out0
}
boolean is_empty(Intlist foo)
{
  return true
}
Intlist rev2(Intlist acc, Intlist torev)
{
  if (is_empty(torev))
      return acc
  else
  {
      Intlist acc2 = new Intlist()
      acc2.head = torev.head
      acc2.tail = acc
      return rev2(acc, torev.tail)
  }
}
Intlist rev(Intlist empty, Intlist torev)
{
  return rev2(empty, torev)
}
void test(Intlist empty)
{
  Intlist list = empty
  int i = -1
  while (i != 0)
  {
      if (scanner.hasNext("^-")) {
        scanner.next("^-")
        i = -scanner.nextInt()
      }else{
        i = scanner.nextInt()
      }
      if (i != 0)
          list = cons(list, i)
  }
}
@Field Scanner scanner = new Scanner(System.in)




<|start_filename|>out/euler42.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>


int is_triangular(int n) {
    /*
   n = k * (k + 1) / 2
	  n * 2 = k * (k + 1)
   */
    int a = (int)sqrt(n * 2);
    return a * (a + 1) == n * 2;
}

int score() {
    int i, len;
    char c;
    scanf(" %d ", &len);
    int sum = 0;
    for (i = 1; i <= len; i++)
    {
        scanf("%c", &c);
        sum += (int)(c) - (int)('A') + 1;
        /*		print c print " " print sum print " " */
    }
    if (is_triangular(sum))
        return 1;
    else
        return 0;
}
int main(void) {
    int n, i;
    for (i = 1; i < 56; i++)
        if (is_triangular(i))
            printf("%d ", i);
    printf("\n");
    int sum = 0;
    scanf("%d", &n);
    for (i = 1; i <= n; i++)
        sum += score();
    printf("%d\n", sum);
    return 0;
}




<|start_filename|>out/aaa_06readcouple.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class aaa_06readcouple
{
  
  public static void Main(String[] args)
  {
    for (int i = 1; i < 4; i++)
    {
        int[] c = new List<string>(Console.ReadLine().Split(" ".ToCharArray())).ConvertAll(int.Parse).ToArray();
        int a = c[0];
        int b = c[1];
        Console.Write("a = " + a + " b = " + b + "\n");
    }
    int[] l = new List<string>(Console.ReadLine().Split(" ".ToCharArray())).ConvertAll(int.Parse).ToArray();
    for (int j = 0; j < 10; j++)
        Console.Write(l[j] + "\n");
  }
  
}



<|start_filename|>out/aaa_08tuple.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}

type tuple_int_int struct {
  tuple_int_int_field_0 int;
  tuple_int_int_field_1 int;
}

type toto struct {
  foo * tuple_int_int;
  bar int;
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var d int
  var c int
  var bar_ int
  fmt.Fscanf(reader, "%d", &bar_)
  skip()
  fmt.Fscanf(reader, "%d", &c)
  skip()
  fmt.Fscanf(reader, "%d", &d)
  skip()
  var e * tuple_int_int = new (tuple_int_int)
      (*e).tuple_int_int_field_0=c
      (*e).tuple_int_int_field_1=d
  var t * toto = new (toto)
      (*t).foo=e
      (*t).bar=bar_
  var f * tuple_int_int = (*t).foo
  a := (*f).tuple_int_int_field_0
  b := (*f).tuple_int_int_field_1
  fmt.Printf("%d %d %d\n", a, b, (*t).bar)
}



<|start_filename|>out/euler17.lua<|end_filename|>

io.write(string.format("%d\n", 3 + 16))
local one_to_nine = 3 + 33
io.write(string.format("%d\n", one_to_nine))
local one_to_ten = one_to_nine + 3
local one_to_twenty = one_to_ten + 73
local one_to_thirty = one_to_twenty + 6 * 9 + one_to_nine + 6
local one_to_forty = one_to_thirty + 6 * 9 + one_to_nine + 5
local one_to_fifty = one_to_forty + 5 * 9 + one_to_nine + 5
local one_to_sixty = one_to_fifty + 5 * 9 + one_to_nine + 5
local one_to_seventy = one_to_sixty + 5 * 9 + one_to_nine + 7
local one_to_eighty = one_to_seventy + 7 * 9 + one_to_nine + 6
local one_to_ninety = one_to_eighty + 6 * 9 + one_to_nine + 6
local one_to_ninety_nine = one_to_ninety + 6 * 9 + one_to_nine
io.write(string.format("%d\n%d\n", one_to_ninety_nine, 100 * one_to_nine + one_to_ninety_nine * 10 + 10 * 9 * 99 + 7 * 9 + 11))


<|start_filename|>out/fibo.cs<|end_filename|>
using System;

public class fibo
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static void stdin_sep(){
  do{
    if (eof) return;
    char c = readChar_();
    if (c == ' ' || c == '\n' || c == '\t' || c == '\r'){
      consommeChar();
    }else{
      return;
    }
  } while(true);
}
static int readInt(){
  int i = 0;
  char s = readChar_();
  int sign = 1;
  if (s == '-'){
    sign = -1;
    consommeChar();
  }
  do{
    char c = readChar_();
    if (c <= '9' && c >= '0'){
      i = i * 10 + c - '0';
      consommeChar();
    }else{
      return i * sign;
    }
  } while(true);
} 
  /*
La suite de fibonaci
*/
  static int fibo0(int a, int b, int i)
  {
    int out0 = 0;
    int a2 = a;
    int b2 = b;
    for (int j = 0; j <= i + 1; j++)
    {
        out0 += a2;
        int tmp = b2;
        b2 += a2;
        a2 = tmp;
    }
    return out0;
  }
  
  public static void Main(String[] args)
  {
    int a = readInt();
    stdin_sep();
    int b = readInt();
    stdin_sep();
    int i = readInt();
    Console.Write(fibo0(a, b, i));
  }
  
}



<|start_filename|>out/prologin_template_intlist.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray

main :: IO ()
programme_candidat tableau taille =
  let a i b =
        if i <= taille - 1
        then do c <- (((+) b) <$> (readIOA tableau i))
                a (i + 1) c
        else return b in
        a 0 0

main =
  do taille <- (fmap read getLine)
     tableau <- (join (newListArray . (,) 0 . subtract 1 <$> return taille <*> fmap (map read . words) getLine))
     printf "%d\n" =<< ((programme_candidat tableau taille)::IO Int)




<|start_filename|>out/pathfinding0.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure pathfinding0 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PChar(c : in Character) is
begin
  Character'Write (Text_Streams.Stream (Current_Output), c);
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
function min2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a < b
  then
    return a;
  else
    return b;
  end if;
end;
type k is Array (Integer range <>) of Integer;
type k_PTR is access k;
type l is Array (Integer range <>) of k_PTR;
type l_PTR is access l;
type m is Array (Integer range <>) of Character;
type m_PTR is access m;
type o is Array (Integer range <>) of m_PTR;
type o_PTR is access o;
function pathfind_aux(cache : in l_PTR; tab : in o_PTR; x : in Integer; y : in Integer; posX : in Integer; posY : in Integer) return Integer is
  val4 : Integer;
  val3 : Integer;
  val2 : Integer;
  val1 : Integer;
  out0 : Integer;
begin
  if posX = x - 1 and then posY = y - 1
  then
    return 0;
  else
    if ((posX < 0 or else posY < 0) or else posX >= x) or else posY >= y
    then
      return x * y * 10;
    else
      if tab(posY)(posX) = '#'
      then
        return x * y * 10;
      else
        if cache(posY)(posX) /= (-1)
        then
          return cache(posY)(posX);
        else
          cache(posY)(posX) := x * y * 10;
          val1 := pathfind_aux(cache, tab, x, y, posX + 1, posY);
          val2 := pathfind_aux(cache, tab, x, y, posX - 1, posY);
          val3 := pathfind_aux(cache, tab, x, y, posX, posY - 1);
          val4 := pathfind_aux(cache, tab, x, y, posX, posY + 1);
          out0 := 1 + min2_0(min2_0(min2_0(val1, val2), val3), val4);
          cache(posY)(posX) := out0;
          return out0;
        end if;
      end if;
    end if;
  end if;
end;
function pathfind(tab : in o_PTR; x : in Integer; y : in Integer) return Integer is
  tmp : k_PTR;
  cache : l_PTR;
begin
  cache := new l (0..y - 1);
  for i in integer range 0..y - 1 loop
    tmp := new k (0..x - 1);
    for j in integer range 0..x - 1 loop
      PChar(tab(i)(j));
      tmp(j) := (-1);
    end loop;
    PString(new char_array'( To_C("" & Character'Val(10))));
    cache(i) := tmp;
  end loop;
  return pathfind_aux(cache, tab, x, y, 0, 0);
end;

  y : Integer;
  x : Integer;
  tab : o_PTR;
  result : Integer;
  g : m_PTR;
  e : o_PTR;
begin
  Get(x);
  SkipSpaces;
  Get(y);
  SkipSpaces;
  PInt(x);
  PString(new char_array'( To_C(" ")));
  PInt(y);
  PString(new char_array'( To_C("" & Character'Val(10))));
  e := new o (0..y - 1);
  for f in integer range 0..y - 1 loop
    g := new m (0..x - 1);
    for h in integer range 0..x - 1 loop
      Get(g(h));
    end loop;
    SkipSpaces;
    e(f) := g;
  end loop;
  tab := e;
  result := pathfind(tab, x, y);
  PInt(result);
end;


<|start_filename|>out/loop_unroll.go<|end_filename|>
package main
import "fmt"
/*
Ce test permet de vérifier le comportement des macros
Il effectue du loop unrolling
*/
func main() {
  j := 0
  j = 0
  fmt.Printf("%d\n", j)
  j = 1
  fmt.Printf("%d\n", j)
  j = 2
  fmt.Printf("%d\n", j)
  j = 3
  fmt.Printf("%d\n", j)
  j = 4
  fmt.Printf("%d\n", j)
}



<|start_filename|>out/aaa_03binding.go<|end_filename|>
package main
import "fmt"
func g(i int) int{
  j := i * 4
  if j % 2 == 1 {
      return 0
  }
  return j
}
func h(i int) {
  fmt.Printf("%d\n", i)
}
func main() {
  h(14)
  a := 4
  b := 5
  fmt.Printf("%d", a + b)
  /* main */
  h(15)
  a = 2
  b = 1
  fmt.Printf("%d", a + b)
}



<|start_filename|>out/euler26.cs<|end_filename|>
using System;

public class euler26
{
  static int periode(int[] restes, int len, int a, int b)
  {
    while (a != 0)
    {
        int chiffre = a / b;
        int reste = a % b;
        for (int i = 0; i < len; i++)
            if (restes[i] == reste)
                return len - i;
        restes[len] = reste;
        len++;
        a = reste * 10;
    }
    return 0;
  }
  
  public static void Main(String[] args)
  {
    int[] t = new int[1000];
    for (int j = 0; j < 1000; j++)
        t[j] = 0;
    int m = 0;
    int mi = 0;
    for (int i = 1; i < 1001; i++)
    {
        int p = periode(t, 0, 1, i);
        if (p > m)
        {
            mi = i;
            m = p;
        }
    }
    Console.Write(mi + "\n" + m + "\n");
  }
  
}



<|start_filename|>out/euler03.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include<cmath>

int main() {
    int maximum = 1;
    int b0 = 2;
    int a = 408464633;
    int sqrtia = (int)sqrt(a);
    while (a != 1)
    {
        int b = b0;
        bool found = false;
        while (b <= sqrtia)
        {
            if (a % b == 0)
            {
                a /= b;
                b0 = b;
                b = a;
                sqrtia = (int)sqrt(a);
                found = true;
            }
            b++;
        }
        if (!found)
        {
            std::cout << a << "\n";
            a = 1;
        }
    }
}



<|start_filename|>out/aaa_02if.cpp<|end_filename|>
#include <iostream>
#include <vector>

bool f(int i) {
    if (i == 0)
        return true;
    return false;
}

int main() {
    if (f(4))
        std::cout << "true <-\n ->\n";
    else
        std::cout << "false <-\n ->\n";
    std::cout << "small test end\n";
}



<|start_filename|>out/test_enum.groovy<|end_filename|>
import java.util.*

enum Foo_t { 
  Foo,
   Bar,
   Blah}

Foo_t foo_val = Foo_t.Foo



<|start_filename|>out/euler24.java<|end_filename|>
import java.util.*;

public class euler24
{
  
  static int fact(int n)
  {
    int prod = 1;
    for (int i = 2; i <= n; i++)
        prod *= i;
    return prod;
  }
  static void show(int lim, int nth)
  {
    int[] t = new int[lim];
    for (int i = 0; i < lim; i++)
        t[i] = i;
    boolean[] pris = new boolean[lim];
    for (int j = 0; j < lim; j++)
        pris[j] = false;
    for (int k = 1; k < lim; k++)
    {
        int n = fact(lim - k);
        int nchiffre = nth / n;
        nth = nth % n;
        for (int l = 0; l < lim; l++)
            if (!pris[l])
            {
                if (nchiffre == 0)
                {
                    System.out.print(l);
                    pris[l] = true;
                }
                nchiffre--;
            }
    }
    for (int m = 0; m < lim; m++)
        if (!pris[m])
            System.out.print(m);
    System.out.print("\n");
  }
  public static void main(String args[])
  {
    show(10, 999999);
  }
  
}



<|start_filename|>out/npi.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func is_number(c byte) bool{
  return (int)(c) <= (int)('9') && (int)(c) >= (int)('0')
}
/*
Notation polonaise inversée, ce test permet d'évaluer une expression écrite en NPI
*/
func npi0(str []byte, len int) int{
  var stack []int = make([]int, len)
  for i := 0; i < len; i++ {
      stack[i] = 0
  }
  ptrStack := 0
  ptrStr := 0
  for ptrStr < len {
      if str[ptrStr] == ' ' {
          ptrStr++
      } else if is_number(str[ptrStr]) {
          num := 0
          for str[ptrStr] != ' ' {
              num = num * 10 + (int)(str[ptrStr]) - (int)('0')
              ptrStr++
          }
          stack[ptrStack] = num
          ptrStack++
      } else if str[ptrStr] == '+' {
          stack[ptrStack - 2] += stack[ptrStack - 1]
          ptrStack--
          ptrStr++
      }
  }
  return stack[0]
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  len := 0
  fmt.Fscanf(reader, "%d", &len)
  skip()
  var tab []byte = make([]byte, len)
  for i := 0; i < len; i++ {
      var tmp byte = '\x00'
      fmt.Fscanf(reader, "%c", &tmp)
      tab[i] = tmp
  }
  result := npi0(tab, len)
  fmt.Printf("%d", result)
}



<|start_filename|>out/euler06.groovy<|end_filename|>
import java.util.*



int lim = 100
int sum = (lim * (lim + 1)).intdiv(2)
int carressum = sum * sum
int sumcarres = (lim * (lim + 1) * (2 * lim + 1)).intdiv(6)
print(carressum - sumcarres)



<|start_filename|>out/plus_petit.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int go0(int[] tab, int a, int b)
{
  int m = (a + b).intdiv(2)
  if (a == m)
      if (tab[a] == m)
          return b
      else
          return a
  int i = a
  int j = b
  while (i < j)
  {
      int e = tab[i]
      if (e < m)
          i++
      else
      {
          j--
          tab[i] = tab[j]
          tab[j] = e
      }
  }
  if (i < m)
      return go0(tab, a, m)
  else
      return go0(tab, m, b)
}
int plus_petit0(int[] tab, int len)
{
  return go0(tab, 0, len)
}
@Field Scanner scanner = new Scanner(System.in)
int len = 0
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  len = -scanner.nextInt()
}else{
  len = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
int[] tab = new int[len]
for (int i = 0; i < len; i++)
{
    int tmp = 0
    if (scanner.hasNext("^-")) {
      scanner.next("^-")
      tmp = -scanner.nextInt()
    }else{
      tmp = scanner.nextInt()
    }
    scanner.findWithinHorizon("[\n\r ]*", 1)
    tab[i] = tmp
}
print(plus_petit0(tab, len))



<|start_filename|>out/euler28.cs<|end_filename|>
using System;

public class euler28
{
  /*

43 44 45 46 47 48 49
42 21 22 23 24 25 26
41 20  7  8  9 10 27
40 19  6  1  2 11 28
39 18  5  4  3 12 29
38 17 16 15 14 13 30
37 36 35 34 33 32 31

1 3 5 7 9 13 17 21 25 31 37 43 49
  2 2 2 2 4  4  4  4  6   6  6  6


*/
  static int sumdiag(int n)
  {
    int nterms = n * 2 - 1;
    int un = 1;
    int sum = 1;
    for (int i = 0; i < nterms - 1; i++)
    {
        int d = 2 * (1 + i / 4);
        un += d;
        //  print int d print "=>" print un print " " 
        sum += un;
    }
    return sum;
  }
  
  public static void Main(String[] args)
  {
    Console.Write(sumdiag(1001));
  }
  
}



<|start_filename|>out/sumDiv.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function foo(){
    var a = 0;
    //  test 
    a++;
    //  test 2 
}
function foo2(){
    
}
function foo3(){
    if (1 == 1)
    {
        
    }
}
function sumdiv(n){
    //  On désire renvoyer la somme des diviseurs 
    var out0 = 0;
    //  On déclare un entier qui contiendra la somme 
    for (var i = 1; i <= n; i++)
        //  La boucle : i est le diviseur potentiel
        if (~~(n % i) == 0)
        {
            //  Si i divise 
            out0 += i;
            //  On incrémente 
        }
        else
        {
            //  nop 
        }
    return out0;
    // On renvoie out
}
//  Programme principal 
var n = 0;
n = read_int_();
//  Lecture de l'entier 
util.print(sumdiv(n));



<|start_filename|>out/abstest.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure abstest is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;


begin
  PInt(abs(5 + 2) * 3);
  PInt(3 * abs(5 + 2));
end;


<|start_filename|>out/pathfindList.cpp<|end_filename|>
#include <iostream>
#include <vector>

int pathfind_aux(std::vector<int>& cache, std::vector<int>& tab, int len, int pos) {
    if (pos >= len - 1)
        return 0;
    else if (cache[pos] != -1)
        return cache[pos];
    else
    {
        cache[pos] = len * 2;
        int posval = pathfind_aux(cache, tab, len, tab[pos]);
        int oneval = pathfind_aux(cache, tab, len, pos + 1);
        int out0 = 0;
        if (posval < oneval)
            out0 = 1 + posval;
        else
            out0 = 1 + oneval;
        cache[pos] = out0;
        return out0;
    }
}


int pathfind(std::vector<int>& tab, int len) {
    std::vector<int> cache( len );
    for (int i = 0; i < len; i++)
        cache[i] = -1;
    return pathfind_aux(cache, tab, len, 0);
}

int main() {
    int len = 0;
    std::cin >> len;
    std::vector<int> tab( len );
    for (int i = 0; i < len; i++)
    {
        int tmp = 0;
        std::cin >> tmp;
        tab[i] = tmp;
    }
    int result = pathfind(tab, len);
    std::cout << result;
}



<|start_filename|>out/ocaml01.js<|end_filename|>
var util = require("util");
function foo(){
    for (var i = 0; i < 11; i++)
    {
        
    }
    return 0;
}
function bar(){
    for (var i = 0; i < 11; i++)
        var a = 0;
    return 0;
}




<|start_filename|>out/euler01.js<|end_filename|>
var util = require("util");

var sum = 0;
for (var i = 0; i < 1000; i++)
    if (~~(i % 3) == 0 || ~~(i % 5) == 0)
        sum += i;
util.print(sum, "\n");



<|start_filename|>out/bigints.java<|end_filename|>
import java.util.*;

public class bigints
{
  static Scanner scanner = new Scanner(System.in);
  static class bigint {
    public boolean bigint_sign;
    public int bigint_len;
    public int[] bigint_chiffres;
  }
  static bigint read_bigint(int len)
  {
    int[] chiffres = new int[len];
    for (int j = 0; j < len; j++)
    {
        char c = scanner.findWithinHorizon(".", 1).charAt(0);
        chiffres[j] = (int)(c);
    }
    for (int i = 0; i <= (len - 1) / 2; i++)
    {
        int tmp = chiffres[i];
        chiffres[i] = chiffres[len - 1 - i];
        chiffres[len - 1 - i] = tmp;
    }
    bigint e = new bigint();
    e.bigint_sign = true;
    e.bigint_len = len;
    e.bigint_chiffres = chiffres;
    return e;
  }
  static void print_bigint(bigint a)
  {
    if (!a.bigint_sign)
        System.out.print('-');
    for (int i = 0; i < a.bigint_len; i++)
        System.out.print(a.bigint_chiffres[a.bigint_len - 1 - i]);
  }
  static boolean bigint_eq(bigint a, bigint b)
  {
    //  Renvoie vrai si a = b 
    if (a.bigint_sign != b.bigint_sign)
        return false;
    else if (a.bigint_len != b.bigint_len)
        return false;
    else
    {
        for (int i = 0; i < a.bigint_len; i++)
            if (a.bigint_chiffres[i] != b.bigint_chiffres[i])
                return false;
        return true;
    }
  }
  static boolean bigint_gt(bigint a, bigint b)
  {
    //  Renvoie vrai si a > b 
    if (a.bigint_sign && !b.bigint_sign)
        return true;
    else if (!a.bigint_sign && b.bigint_sign)
        return false;
    else
    {
        if (a.bigint_len > b.bigint_len)
            return a.bigint_sign;
        else if (a.bigint_len < b.bigint_len)
            return !a.bigint_sign;
        else
            for (int i = 0; i < a.bigint_len; i++)
            {
                int j = a.bigint_len - 1 - i;
                if (a.bigint_chiffres[j] > b.bigint_chiffres[j])
                    return a.bigint_sign;
                else if (a.bigint_chiffres[j] < b.bigint_chiffres[j])
                    return !a.bigint_sign;
            }
        return true;
    }
  }
  static boolean bigint_lt(bigint a, bigint b)
  {
    return !bigint_gt(a, b);
  }
  static bigint add_bigint_positif(bigint a, bigint b)
  {
    //  Une addition ou on en a rien a faire des signes 
    int len = Math.max(a.bigint_len, b.bigint_len) + 1;
    int retenue = 0;
    int[] chiffres = new int[len];
    for (int i = 0; i < len; i++)
    {
        int tmp = retenue;
        if (i < a.bigint_len)
            tmp += a.bigint_chiffres[i];
        if (i < b.bigint_len)
            tmp += b.bigint_chiffres[i];
        retenue = tmp / 10;
        chiffres[i] = tmp % 10;
    }
    while (len > 0 && chiffres[len - 1] == 0)
        len--;
    bigint f = new bigint();
    f.bigint_sign = true;
    f.bigint_len = len;
    f.bigint_chiffres = chiffres;
    return f;
  }
  static bigint sub_bigint_positif(bigint a, bigint b)
  {
    /* Une soustraction ou on en a rien a faire des signes
Pré-requis : a > b
*/
    int len = a.bigint_len;
    int retenue = 0;
    int[] chiffres = new int[len];
    for (int i = 0; i < len; i++)
    {
        int tmp = retenue + a.bigint_chiffres[i];
        if (i < b.bigint_len)
            tmp -= b.bigint_chiffres[i];
        if (tmp < 0)
        {
            tmp += 10;
            retenue = -1;
        }
        else
            retenue = 0;
        chiffres[i] = tmp;
    }
    while (len > 0 && chiffres[len - 1] == 0)
        len--;
    bigint g = new bigint();
    g.bigint_sign = true;
    g.bigint_len = len;
    g.bigint_chiffres = chiffres;
    return g;
  }
  static bigint neg_bigint(bigint a)
  {
    bigint h = new bigint();
    h.bigint_sign = !a.bigint_sign;
    h.bigint_len = a.bigint_len;
    h.bigint_chiffres = a.bigint_chiffres;
    return h;
  }
  static bigint add_bigint(bigint a, bigint b)
  {
    if (a.bigint_sign == b.bigint_sign)
        if (a.bigint_sign)
            return add_bigint_positif(a, b);
        else
            return neg_bigint(add_bigint_positif(a, b));
    else if (a.bigint_sign)
    {
        //  a positif, b negatif 
        if (bigint_gt(a, neg_bigint(b)))
            return sub_bigint_positif(a, b);
        else
            return neg_bigint(sub_bigint_positif(b, a));
    }
    else
        //  a negatif, b positif 
        if (bigint_gt(neg_bigint(a), b))
            return neg_bigint(sub_bigint_positif(a, b));
        else
            return sub_bigint_positif(b, a);
  }
  static bigint sub_bigint(bigint a, bigint b)
  {
    return add_bigint(a, neg_bigint(b));
  }
  static bigint mul_bigint_cp(bigint a, bigint b)
  {
    /* Cet algorithm est quadratique.
C'est le même que celui qu'on enseigne aux enfants en CP.
D'ou le nom de la fonction. */
    int len = a.bigint_len + b.bigint_len + 1;
    int[] chiffres = new int[len];
    for (int k = 0; k < len; k++)
        chiffres[k] = 0;
    for (int i = 0; i < a.bigint_len; i++)
    {
        int retenue = 0;
        for (int j = 0; j < b.bigint_len; j++)
        {
            chiffres[i + j] += retenue + b.bigint_chiffres[j] * a.bigint_chiffres[i];
            retenue = chiffres[i + j] / 10;
            chiffres[i + j] = chiffres[i + j] % 10;
        }
        chiffres[i + b.bigint_len] += retenue;
    }
    chiffres[a.bigint_len + b.bigint_len] = chiffres[a.bigint_len + b.bigint_len - 1] / 10;
    chiffres[a.bigint_len + b.bigint_len - 1] = chiffres[a.bigint_len + b.bigint_len - 1] % 10;
    for (int l = 0; l < 3; l++)
        if (len != 0 && chiffres[len - 1] == 0)
            len--;
    bigint m = new bigint();
    m.bigint_sign = a.bigint_sign == b.bigint_sign;
    m.bigint_len = len;
    m.bigint_chiffres = chiffres;
    return m;
  }
  static bigint bigint_premiers_chiffres(bigint a, int i)
  {
    int len = Math.min(i, a.bigint_len);
    while (len != 0 && a.bigint_chiffres[len - 1] == 0)
        len--;
    bigint o = new bigint();
    o.bigint_sign = a.bigint_sign;
    o.bigint_len = len;
    o.bigint_chiffres = a.bigint_chiffres;
    return o;
  }
  static bigint bigint_shift(bigint a, int i)
  {
    int[] chiffres = new int[a.bigint_len + i];
    for (int k = 0; k < a.bigint_len + i; k++)
        if (k >= i)
            chiffres[k] = a.bigint_chiffres[k - i];
        else
            chiffres[k] = 0;
    bigint p = new bigint();
    p.bigint_sign = a.bigint_sign;
    p.bigint_len = a.bigint_len + i;
    p.bigint_chiffres = chiffres;
    return p;
  }
  static bigint mul_bigint(bigint aa, bigint bb)
  {
    if (aa.bigint_len == 0)
        return aa;
    else if (bb.bigint_len == 0)
        return bb;
    else if (aa.bigint_len < 3 || bb.bigint_len < 3)
        return mul_bigint_cp(aa, bb);
    //  Algorithme de Karatsuba 
    int split = Math.min(aa.bigint_len, bb.bigint_len) / 2;
    bigint a = bigint_shift(aa, -split);
    bigint b = bigint_premiers_chiffres(aa, split);
    bigint c = bigint_shift(bb, -split);
    bigint d = bigint_premiers_chiffres(bb, split);
    bigint amoinsb = sub_bigint(a, b);
    bigint cmoinsd = sub_bigint(c, d);
    bigint ac = mul_bigint(a, c);
    bigint bd = mul_bigint(b, d);
    bigint amoinsbcmoinsd = mul_bigint(amoinsb, cmoinsd);
    bigint acdec = bigint_shift(ac, 2 * split);
    return add_bigint(add_bigint(acdec, bd), bigint_shift(sub_bigint(add_bigint(ac, bd), amoinsbcmoinsd), split));
    //  ac × 102k + (ac + bd – (a – b)(c – d)) × 10k + bd 
  }
  /*
Division,
Modulo
*/
  static int log10(int a)
  {
    int out0 = 1;
    while (a >= 10)
    {
        a /= 10;
        out0++;
    }
    return out0;
  }
  static bigint bigint_of_int(int i)
  {
    int size = log10(i);
    if (i == 0)
        size = 0;
    int[] t = new int[size];
    for (int j = 0; j < size; j++)
        t[j] = 0;
    for (int k = 0; k < size; k++)
    {
        t[k] = i % 10;
        i /= 10;
    }
    bigint q = new bigint();
    q.bigint_sign = true;
    q.bigint_len = size;
    q.bigint_chiffres = t;
    return q;
  }
  static bigint fact_bigint(bigint a)
  {
    bigint one = bigint_of_int(1);
    bigint out0 = one;
    while (!bigint_eq(a, one))
    {
        out0 = mul_bigint(a, out0);
        a = sub_bigint(a, one);
    }
    return out0;
  }
  static int sum_chiffres_bigint(bigint a)
  {
    int out0 = 0;
    for (int i = 0; i < a.bigint_len; i++)
        out0 += a.bigint_chiffres[i];
    return out0;
  }
  //  http://projecteuler.net/problem=20 
  static int euler20()
  {
    bigint a = bigint_of_int(15);
    //  normalement c'est 100 
    a = fact_bigint(a);
    return sum_chiffres_bigint(a);
  }
  static bigint bigint_exp(bigint a, int b)
  {
    if (b == 1)
        return a;
    else if (b % 2 == 0)
        return bigint_exp(mul_bigint(a, a), b / 2);
    else
        return mul_bigint(a, bigint_exp(a, b - 1));
  }
  static bigint bigint_exp_10chiffres(bigint a, int b)
  {
    a = bigint_premiers_chiffres(a, 10);
    if (b == 1)
        return a;
    else if (b % 2 == 0)
        return bigint_exp_10chiffres(mul_bigint(a, a), b / 2);
    else
        return mul_bigint(a, bigint_exp_10chiffres(a, b - 1));
  }
  static void euler48()
  {
    bigint sum = bigint_of_int(0);
    for (int i = 1; i < 101; i++)
    {
        //  1000 normalement 
        bigint ib = bigint_of_int(i);
        bigint ibeib = bigint_exp_10chiffres(ib, i);
        sum = add_bigint(sum, ibeib);
        sum = bigint_premiers_chiffres(sum, 10);
    }
    System.out.print("euler 48 = ");
    print_bigint(sum);
    System.out.print("\n");
  }
  static int euler16()
  {
    bigint a = bigint_of_int(2);
    a = bigint_exp(a, 100);
    //  1000 normalement 
    return sum_chiffres_bigint(a);
  }
  static int euler25()
  {
    int i = 2;
    bigint a = bigint_of_int(1);
    bigint b = bigint_of_int(1);
    while (b.bigint_len < 100)
    {
        //  1000 normalement 
        bigint c = add_bigint(a, b);
        a = b;
        b = c;
        i++;
    }
    return i;
  }
  static int euler29()
  {
    int maxA = 5;
    int maxB = 5;
    bigint[] a_bigint = new bigint[maxA + 1];
    for (int j = 0; j <= maxA; j++)
        a_bigint[j] = bigint_of_int(j * j);
    bigint[] a0_bigint = new bigint[maxA + 1];
    for (int j2 = 0; j2 <= maxA; j2++)
        a0_bigint[j2] = bigint_of_int(j2);
    int[] b = new int[maxA + 1];
    for (int k = 0; k <= maxA; k++)
        b[k] = 2;
    int n = 0;
    boolean found = true;
    while (found)
    {
        bigint min0 = a0_bigint[0];
        found = false;
        for (int i = 2; i <= maxA; i++)
            if (b[i] <= maxB)
                if (found)
                {
                    if (bigint_lt(a_bigint[i], min0))
                        min0 = a_bigint[i];
                }
                else
                {
                    min0 = a_bigint[i];
                    found = true;
                }
        if (found)
        {
            n++;
            for (int l = 2; l <= maxA; l++)
                if (bigint_eq(a_bigint[l], min0) && b[l] <= maxB)
                {
                    b[l]++;
                    a_bigint[l] = mul_bigint(a_bigint[l], a0_bigint[l]);
                }
        }
    }
    return n;
  }
  public static void main(String args[])
  {
    System.out.printf("%d\n", euler29());
    bigint sum = read_bigint(50);
    for (int i = 2; i < 101; i++)
    {
        scanner.findWithinHorizon("[\n\r ]*", 1);
        bigint tmp = read_bigint(50);
        sum = add_bigint(sum, tmp);
    }
    System.out.print("euler13 = ");
    print_bigint(sum);
    System.out.printf("\neuler25 = %d\neuler16 = %d\n", euler25(), euler16());
    euler48();
    System.out.printf("euler20 = %d\n", euler20());
    bigint a = bigint_of_int(999999);
    bigint b = bigint_of_int(9951263);
    print_bigint(a);
    System.out.print(">>1=");
    print_bigint(bigint_shift(a, -1));
    System.out.print("\n");
    print_bigint(a);
    System.out.print("*");
    print_bigint(b);
    System.out.print("=");
    print_bigint(mul_bigint(a, b));
    System.out.print("\n");
    print_bigint(a);
    System.out.print("*");
    print_bigint(b);
    System.out.print("=");
    print_bigint(mul_bigint_cp(a, b));
    System.out.print("\n");
    print_bigint(a);
    System.out.print("+");
    print_bigint(b);
    System.out.print("=");
    print_bigint(add_bigint(a, b));
    System.out.print("\n");
    print_bigint(b);
    System.out.print("-");
    print_bigint(a);
    System.out.print("=");
    print_bigint(sub_bigint(b, a));
    System.out.print("\n");
    print_bigint(a);
    System.out.print("-");
    print_bigint(b);
    System.out.print("=");
    print_bigint(sub_bigint(a, b));
    System.out.print("\n");
    print_bigint(a);
    System.out.print(">");
    print_bigint(b);
    System.out.print("=");
    if (bigint_gt(a, b))
        System.out.print("True");
    else
        System.out.print("False");
    System.out.print("\n");
  }
  
}



<|start_filename|>out/aaa_041comment.cs<|end_filename|>
using System;

public class aaa_041comment
{
  
  public static void Main(String[] args)
  {
    int i = 4;
    // while i < 10 do 
    Console.Write(i);
    i++;
    //   end 
    Console.Write(i);
  }
  
}



<|start_filename|>out/test_returns.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int is_pair(int i) {
    int j = 1;
    if (i < 10)
    {
        j = 2;
        if (i == 0)
        {
            j = 4;
            return 1;
        }
        j = 3;
        if (i == 2)
        {
            j = 4;
            return 1;
        }
        j = 5;
    }
    j = 6;
    if (i < 20)
    {
        if (i == 22)
            j = 0;
        j = 8;
    }
    return i % 2 == 0;
}
int main(void) {
    
    return 0;
}




<|start_filename|>out/record2.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function mktoto (v1)
  local t = {foo=v1, bar=0, blah=0}
  return t
end

function result (t)
  t.blah = t.blah + 1
  return t.foo + t.blah * t.bar + t.bar * t.foo
end

local t = mktoto(4)
t.bar = readint()
stdinsep()
t.blah = readint()
io.write(result(t))


<|start_filename|>out/euler23.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int eratostene(int* t, int max0) {
    int i;
    int n = 0;
    for (i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            int j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
}

int fillPrimesFactors(int* t, int n, int* primes, int nprimes) {
    int i;
    for (i = 0; i < nprimes; i++)
    {
        int d = primes[i];
        while (n % d == 0)
        {
            t[d]++;
            n /= d;
        }
        if (n == 1)
            return primes[i];
    }
    return n;
}

int sumdivaux2(int* t, int n, int i) {
    while (i < n && t[i] == 0)
        i++;
    return i;
}

int sumdivaux(int* t, int n, int i) {
    int j;
    if (i > n)
        return 1;
    else if (t[i] == 0)
        return sumdivaux(t, n, sumdivaux2(t, n, i + 1));
    else
    {
        int o = sumdivaux(t, n, sumdivaux2(t, n, i + 1));
        int out0 = 0;
        int p = i;
        for (j = 1; j <= t[i]; j++)
        {
            out0 += p;
            p *= i;
        }
        return (out0 + 1) * o;
    }
}

int sumdiv(int nprimes, int* primes, int n) {
    int i;
    int *t = calloc(n + 1, sizeof(int));
    for (i = 0; i <= n; i++)
        t[i] = 0;
    int max0 = fillPrimesFactors(t, n, primes, nprimes);
    return sumdivaux(t, max0, 0);
}
int main(void) {
    int o, i, j, r, q, p, k, t, s;
    int maximumprimes = 30001;
    int *era = calloc(maximumprimes, sizeof(int));
    for (s = 0; s < maximumprimes; s++)
        era[s] = s;
    int nprimes = eratostene(era, maximumprimes);
    int *primes = calloc(nprimes, sizeof(int));
    for (t = 0; t < nprimes; t++)
        primes[t] = 0;
    int l = 0;
    for (k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    int n = 100;
    /* 28124 ça prend trop de temps mais on arrive a passer le test */
    int *abondant = calloc(n + 1, sizeof(int));
    for (p = 0; p <= n; p++)
        abondant[p] = 0;
    int *summable = calloc(n + 1, sizeof(int));
    for (q = 0; q <= n; q++)
        summable[q] = 0;
    int sum = 0;
    for (r = 2; r <= n; r++)
    {
        int other = sumdiv(nprimes, primes, r) - r;
        if (other > r)
            abondant[r] = 1;
    }
    for (i = 1; i <= n; i++)
        for (j = 1; j <= n; j++)
            if (abondant[i] && abondant[j] && i + j <= n)
                summable[i + j] = 1;
    for (o = 1; o <= n; o++)
        if (!summable[o])
            sum += o;
    printf("\n%d\n", sum);
    return 0;
}




<|start_filename|>out/test_returns.go<|end_filename|>
package main
func is_pair(i int) bool{
  j := 1
  _ = j
  if i < 10 {
      j = 2
      if i == 0 {
          j = 4
          return true
      }
      j = 3
      if i == 2 {
          j = 4
          return true
      }
      j = 5
  }
  j = 6
  if i < 20 {
      if i == 22 {
          j = 0
      }
      j = 8
  }
  return i % 2 == 0
}
func main() {
  
}



<|start_filename|>out/npi.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

boolean is_number(char c)
{
  return (0+c) <= (0+(char)'9') && (0+c) >= (0+(char)'0')
}
/*
Notation polonaise inversée, ce test permet d'évaluer une expression écrite en NPI
*/
int npi0(char[] str, int len)
{
  int[] stack = new int[len]
  for (int i = 0; i < len; i++)
      stack[i] = 0
  int ptrStack = 0
  int ptrStr = 0
  while (ptrStr < len)
      if (str[ptrStr] == (char)' ')
          ptrStr++
      else if (is_number(str[ptrStr]))
      {
          int num = 0
          while (str[ptrStr] != (char)' ')
          {
              num = num * 10 + (0+str[ptrStr]) - (0+(char)'0')
              ptrStr++
          }
          stack[ptrStack] = num
          ptrStack++
      }
      else if (str[ptrStr] == (char)'+')
      {
          stack[ptrStack - 2] += stack[ptrStack - 1]
          ptrStack--
          ptrStr++
      }
  return stack[0]
}
@Field Scanner scanner = new Scanner(System.in)
int len = 0
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  len = -scanner.nextInt()
}else{
  len = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
char[] tab = new char[len]
for (int i = 0; i < len; i++)
{
    char tmp = (char)0
    tmp = scanner.findWithinHorizon(".", 1).charAt(0)
    tab[i] = tmp
}
int result = npi0(tab, len)
print(result)



<|start_filename|>out/sqrttest.js<|end_filename|>
var util = require("util");

util.print(Math.floor(Math.sqrt(4)), " ", Math.floor(Math.sqrt(16)), " ", Math.floor(Math.sqrt(20)), " ", Math.floor(Math.sqrt(1000)), " ", Math.floor(Math.sqrt(500)), " ", Math.floor(Math.sqrt(10)), " ");



<|start_filename|>out/aaa_01hello.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: main
  S" Hello World" TYPE
  5 { a }
  4 6 + 2 * s>d 0 d.r
  S\"  \n" TYPE
  a s>d 0 d.r
  S" foo" TYPE
  1 2 2 * 3 8 + * 4 // + 2 - 12 = true AND
  IF
    S" True" TYPE
  ELSE
    S" False" TYPE
  THEN
  S\" \n" TYPE
  3 4 11 + * 2 * 45 = false =
  IF
    S" True" TYPE
  ELSE
    S" False" TYPE
  THEN
  S"  " TYPE
  2 1 = false =
  IF
    S" True" TYPE
  ELSE
    S" False" TYPE
  THEN
  S"  " TYPE
  5 3 // 3 // s>d 0 d.r
  4 1 * 3 // 2 1 * // s>d 0 d.r
  a 0 = INVERT a 4 = INVERT AND INVERT
  IF
    S" True" TYPE
  ELSE
    S" False" TYPE
  THEN
  true false INVERT AND true false AND INVERT AND
  IF
    S" True" TYPE
  ELSE
    S" False" TYPE
  THEN
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/euler28.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

/* 

43 44 45 46 47 48 49
42 21 22 23 24 25 26
41 20  7  8  9 10 27
40 19  6  1  2 11 28
39 18  5  4  3 12 29
38 17 16 15 14 13 30
37 36 35 34 33 32 31

1 3 5 7 9 13 17 21 25 31 37 43 49
  2 2 2 2 4  4  4  4  6   6  6  6


 */


int sumdiag(int n) {
    int i;
    int nterms = n * 2 - 1;
    int un = 1;
    int sum = 1;
    for (i = 0; i < nterms - 1; i++)
    {
        int d = 2 * (1 + i / 4);
        un += d;
        /* print int d print "=>" print un print " " */
        sum += un;
    }
    return sum;
}
int main(void) {
    printf("%d", sumdiag(1001));
    return 0;
}




<|start_filename|>out/abstest.js<|end_filename|>
var util = require("util");

util.print(Math.abs(5 + 2) * 3, 3 * Math.abs(5 + 2));



<|start_filename|>out/sumDiv.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0

main :: IO ()
foo () =
  {- test -}
  let b = 0 + 1
          in {- test 2 -}
             return ()

foo2 () =
  return ()

foo3 () =
  return (if 1 == 1
          then ()
          else ())

sumdiv n =
  {- On désire renvoyer la somme des diviseurs -}
  {- On déclare un entier qui contiendra la somme -}
  let c i d =
        if i <= n
        then {- La boucle : i est le diviseur potentiel-}
             if (n `rem` i) == 0
             then {- Si i divise -}
                  do let e = d + i
                     {- On incrémente -}
                     c (i + 1) e
             else {- nop -}
                  c (i + 1) d
        else return d in
        c 1 0

main =
  {- Programme principal -}
  do f <- read_int
     {- Lecture de l'entier -}
     printf "%d" =<< (sumdiv f :: IO Int)




<|start_filename|>out/prologin_template_intlist.java<|end_filename|>
import java.util.*;

public class prologin_template_intlist
{
  static Scanner scanner = new Scanner(System.in);
  static int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

  static int programme_candidat(int[] tableau, int taille)
  {
    int out0 = 0;
    for (int i = 0; i < taille; i++)
        out0 += tableau[i];
    return out0;
  }
  public static void main(String args[])
  {
    int taille = Integer.parseInt(scanner.nextLine());
    int[] tableau = read_int_line();
    System.out.printf("%d\n", programme_candidat(tableau, taille));
  }
  
}



<|start_filename|>out/longest_increasing_subsequence.lua<|end_filename|>

function readintline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), "-?%d+") do
    tab[index] = tonumber(a)
    index = index + 1
  end
  return tab
end

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function dichofind (len, tab, tofind, a, b)
  if a >= b - 1 then
      return a
  else 
      local c = trunc((a + b) / 2)
      if tab[c + 1] < tofind then
          return dichofind(len, tab, tofind, c, b)
      else 
          return dichofind(len, tab, tofind, a, c)
      end
  end
end

function process (len, tab)
  local size = {}
  for j = 0, len - 1 do
      if j == 0 then
          size[j + 1] = 0
      else 
          size[j + 1] = len * 2
      end
  end
  for i = 0, len - 1 do
      local k = dichofind(len, size, tab[i + 1], 0, len - 1)
      if size[k + 2] > tab[i + 1] then
          size[k + 2] = tab[i + 1]
      end
  end
  for l = 0, len - 1 do
      io.write(string.format("%d ", size[l + 1]))
  end
  for m = 0, len - 1 do
      local k = len - 1 - m
      if size[k + 1] ~= len * 2 then
          return k
      end
  end
  return 0
end

local n = tonumber(io.read('*l'))
for i = 1, n do
    local len = tonumber(io.read('*l'))
    io.write(string.format("%d\n", process(len, readintline())))
end


<|start_filename|>out/aaa_00hello.fs<|end_filename|>
: main
  S\" Hello World\n" TYPE
  ;
main
BYE



<|start_filename|>out/fibo.cpp<|end_filename|>
#include <iostream>
#include <vector>
/*
La suite de fibonaci
*/

int fibo0(int a, int b, int i) {
    int out0 = 0;
    int a2 = a;
    int b2 = b;
    for (int j = 0; j <= i + 1; j++)
    {
        out0 += a2;
        int tmp = b2;
        b2 += a2;
        a2 = tmp;
    }
    return out0;
}

int main() {
    int i, b, a;
    std::cin >> a >> b >> i >> std::noskipws;
    std::cout << fibo0(a, b, i);
}



<|start_filename|>out/min4.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure min4 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

function min2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a < b
  then
    return a;
  else
    return b;
  end if;
end;

begin
  PInt(min2_0(min2_0(min2_0(1, 2), 3), 4));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(1, 2), 4), 3));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(1, 3), 2), 4));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(1, 3), 4), 2));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(1, 4), 2), 3));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(1, 4), 3), 2));
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(min2_0(min2_0(min2_0(2, 1), 3), 4));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(2, 1), 4), 3));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(2, 3), 1), 4));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(2, 3), 4), 1));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(2, 4), 1), 3));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(2, 4), 3), 1));
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(min2_0(min2_0(min2_0(3, 1), 2), 4));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(3, 1), 4), 2));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(3, 2), 1), 4));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(3, 2), 4), 1));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(3, 4), 1), 2));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(3, 4), 2), 1));
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(min2_0(min2_0(min2_0(4, 1), 2), 3));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(4, 1), 3), 2));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(4, 2), 1), 3));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(4, 2), 3), 1));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(4, 3), 1), 2));
  PString(new char_array'( To_C(" ")));
  PInt(min2_0(min2_0(min2_0(4, 3), 2), 1));
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/triangles.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

/* Ce code a été généré par metalang
   Il gère les entrées sorties pour un programme dynamique classique
   dans les épreuves de prologin
on le retrouve ici : http://projecteuler.net/problem=18
*/
int find0(int len, int[][] tab, int[][] cache, int x, int y)
{
  /*
	Cette fonction est récursive
	*/
  if (y == len - 1)
      return tab[y][x]
  else if (x > y)
      return -10000
  else if (cache[y][x] != 0)
      return cache[y][x]
  int result = 0
  int out0 = find0(len, tab, cache, x, y + 1)
  int out1 = find0(len, tab, cache, x + 1, y + 1)
  if (out0 > out1)
      result = out0 + tab[y][x]
  else
      result = out1 + tab[y][x]
  cache[y][x] = result
  return result
}
int find(int len, int[][] tab)
{
  int[][] tab2 = new int[len][]
  for (int i = 0; i < len; i++)
  {
      int[] tab3 = new int[i + 1]
      for (int j = 0; j <= i; j++)
          tab3[j] = 0
      tab2[i] = tab3
  }
  return find0(len, tab, tab2, 0, 0)
}
@Field Scanner scanner = new Scanner(System.in)
int len
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  len = scanner.nextInt()
} else {
  len = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
int[][] tab = new int[len][]
for (int i = 0; i < len; i++)
{
    int[] tab2 = new int[i + 1]
    for (int j = 0; j <= i; j++)
    {
        int tmp
        if (scanner.hasNext("^-")) {
          scanner.next("^-")
          tmp = scanner.nextInt()
        } else {
          tmp = scanner.nextInt()
        }
        scanner.findWithinHorizon("[\n\r ]*", 1)
        tab2[j] = tmp
    }
    tab[i] = tab2
}
System.out.printf("%d\n", find(len, tab))
for (int k = 0; k < len; k++)
{
    for (int l = 0; l <= k; l++)
        System.out.printf("%d ", tab[k][l])
    print("\n")
}



<|start_filename|>out/euler39.lua<|end_filename|>

local t = {}
for i = 0, 1000 do
    t[i + 1] = 0
end
for a = 1, 1000 do
    for b = 1, 1000 do
        local c2 = a * a + b * b
        local c = math.floor(math.sqrt(c2))
        if c * c == c2 then
            local p = a + b + c
            if p < 1001 then
                t[p + 1] = t[p + 1] + 1
            end
        end
    end
end
local j = 0
for k = 1, 1000 do
    if t[k + 1] > t[j + 1] then
        j = k
    end
end
io.write(j)


<|start_filename|>out/loop_unroll.java<|end_filename|>
import java.util.*;

public class loop_unroll
{
  
  /*
Ce test permet de vérifier le comportement des macros
Il effectue du loop unrolling
*/
  public static void main(String args[])
  {
    int j = 0;
    j = 0;
    System.out.printf("%d\n", j);
    j = 1;
    System.out.printf("%d\n", j);
    j = 2;
    System.out.printf("%d\n", j);
    j = 3;
    System.out.printf("%d\n", j);
    j = 4;
    System.out.printf("%d\n", j);
  }
  
}



<|start_filename|>out/euler21.cs<|end_filename|>
using System;

public class euler21
{
  static int eratostene(int[] t, int max0)
  {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            int j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
  }
  
  static int fillPrimesFactors(int[] t, int n, int[] primes, int nprimes)
  {
    for (int i = 0; i < nprimes; i++)
    {
        int d = primes[i];
        while (n % d == 0)
        {
            t[d]++;
            n /= d;
        }
        if (n == 1)
            return primes[i];
    }
    return n;
  }
  
  static int sumdivaux2(int[] t, int n, int i)
  {
    while (i < n && t[i] == 0)
        i++;
    return i;
  }
  
  static int sumdivaux(int[] t, int n, int i)
  {
    if (i > n)
        return 1;
    else if (t[i] == 0)
        return sumdivaux(t, n, sumdivaux2(t, n, i + 1));
    else
    {
        int o = sumdivaux(t, n, sumdivaux2(t, n, i + 1));
        int out0 = 0;
        int p = i;
        for (int j = 1; j <= t[i]; j++)
        {
            out0 += p;
            p *= i;
        }
        return (out0 + 1) * o;
    }
  }
  
  static int sumdiv(int nprimes, int[] primes, int n)
  {
    int[] t = new int[n + 1];
    for (int i = 0; i <= n; i++)
        t[i] = 0;
    int max0 = fillPrimesFactors(t, n, primes, nprimes);
    return sumdivaux(t, max0, 0);
  }
  
  public static void Main(String[] args)
  {
    int maximumprimes = 1001;
    int[] era = new int[maximumprimes];
    for (int j = 0; j < maximumprimes; j++)
        era[j] = j;
    int nprimes = eratostene(era, maximumprimes);
    int[] primes = new int[nprimes];
    for (int o = 0; o < nprimes; o++)
        primes[o] = 0;
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    Console.Write(l + " == " + nprimes + "\n");
    int sum = 0;
    for (int n = 2; n < 1001; n++)
    {
        int other = sumdiv(nprimes, primes, n) - n;
        if (other > n)
        {
            int othersum = sumdiv(nprimes, primes, other) - other;
            if (othersum == n)
            {
                Console.Write(other + " & " + n + "\n");
                sum += other + n;
            }
        }
    }
    Console.Write("\n" + sum + "\n");
  }
  
}



<|start_filename|>out/euler27.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int eratostene(int* t, int max0) {
    int i;
    int n = 0;
    for (i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            int j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
}

int isPrime(int n, int* primes, int len) {
    int i = 0;
    if (n < 0)
        n = -n;
    while (primes[i] * primes[i] < n)
    {
        if (n % primes[i] == 0)
            return 0;
        i++;
    }
    return 1;
}

int test(int a, int b, int* primes, int len) {
    int n;
    for (n = 0; n < 201; n++)
    {
        int j = n * n + a * n + b;
        if (!isPrime(j, primes, len))
            return n;
    }
    return 200;
}
int main(void) {
    int b, a, k, o, j;
    int maximumprimes = 1000;
    int *era = calloc(maximumprimes, sizeof(int));
    for (j = 0; j < maximumprimes; j++)
        era[j] = j;
    int result = 0;
    int max0 = 0;
    int nprimes = eratostene(era, maximumprimes);
    int *primes = calloc(nprimes, sizeof(int));
    for (o = 0; o < nprimes; o++)
        primes[o] = 0;
    int l = 0;
    for (k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    printf("%d == %d\n", l, nprimes);
    int ma = 0;
    int mb = 0;
    for (b = 3; b < 1000; b++)
        if (era[b] == b)
            for (a = -999; a < 1000; a++)
            {
                int n1 = test(a, b, primes, nprimes);
                int n2 = test(a, -b, primes, nprimes);
                if (n1 > max0)
                {
                    max0 = n1;
                    result = a * b;
                    ma = a;
                    mb = b;
                }
                if (n2 > max0)
                {
                    max0 = n2;
                    result = -a * b;
                    ma = a;
                    mb = -b;
                }
            }
    printf("%d %d\n%d\n%d\n", ma, mb, max0, result);
    return 0;
}




<|start_filename|>out/small_inline.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}

func main() {
  reader = bufio.NewReader(os.Stdin)
  var t []int = make([]int, 2)
  for d := 0; d < 2; d++ {
      fmt.Fscanf(reader, "%d", &t[d])
      skip()
  }
  fmt.Printf("%d - %d\n", t[0], t[1])
}



<|start_filename|>out/euler15.go<|end_filename|>
package main
import "fmt"

func main() {
  n := 10
  /* normalement on doit mettre 20 mais là on se tape un overflow */
  n++
  var tab [][]int = make([][]int, n)
  for i := 0; i < n; i++ {
      var tab2 []int = make([]int, n)
      for j := 0; j < n; j++ {
          tab2[j] = 0
      }
      tab[i] = tab2
  }
  for l := 0; l < n; l++ {
      tab[n - 1][l] = 1
      tab[l][n - 1] = 1
  }
  for o := 2; o <= n; o++ {
      r := n - o
      for p := 2; p <= n; p++ {
          q := n - p
          tab[r][q] = tab[r + 1][q] + tab[r][q + 1]
      }
  }
  for m := 0; m < n; m++ {
      for k := 0; k < n; k++ {
          fmt.Printf("%d ", tab[m][k])
      }
      fmt.Printf("\n")
  }
  fmt.Printf("%d\n", tab[0][0])
}



<|start_filename|>out/aaa_04loop.cs<|end_filename|>
using System;

public class aaa_04loop
{
  static bool h(int i)
  {
    /*  for j = i - 2 to i + 2 do
    if i % j == 5 then return true end
  end */
    int j = i - 2;
    while (j <= i + 2)
    {
        if (i % j == 5)
            return true;
        j++;
    }
    return false;
  }
  
  public static void Main(String[] args)
  {
    int j = 0;
    for (int k = 0; k < 11; k++)
    {
        j += k;
        Console.Write(j + "\n");
    }
    int i = 4;
    while (i < 10)
    {
        Console.Write(i);
        i++;
        j += i;
    }
    Console.Write("" + j + i + "FIN TEST\n");
  }
  
}



<|start_filename|>out/abstest.groovy<|end_filename|>
import java.util.*

int abs_(int n)
{
  if (n > 0)
      return n
  else
      return -n
}

System.out.printf("%d%d", abs_(5 + 2) * 3, 3 * abs_(5 + 2))



<|start_filename|>out/summax_souslist.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int summax(int[] lst, int len)
{
  int current = 0
  int max0 = 0
  for (int i = 0; i < len; i++)
  {
      current += lst[i]
      if (current < 0)
          current = 0
      if (max0 < current)
          max0 = current
  }
  return max0
}
@Field Scanner scanner = new Scanner(System.in)
int len = 0
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  len = -scanner.nextInt()
}else{
  len = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
int[] tab = new int[len]
for (int i = 0; i < len; i++)
{
    int tmp = 0
    if (scanner.hasNext("^-")) {
      scanner.next("^-")
      tmp = -scanner.nextInt()
    }else{
      tmp = scanner.nextInt()
    }
    scanner.findWithinHorizon("[\n\r ]*", 1)
    tab[i] = tmp
}
int result = summax(tab, len)
print(result)



<|start_filename|>out/euler23.groovy<|end_filename|>
import java.util.*

int eratostene(int[] t, int max0)
{
  int n = 0
  for (int i = 2; i < max0; i++)
      if (t[i] == i)
      {
          n++
          int j = i * i
          while (j < max0 && j > 0)
          {
              t[j] = 0
              j += i
          }
      }
  return n
}
int fillPrimesFactors(int[] t, int n, int[] primes, int nprimes)
{
  for (int i = 0; i < nprimes; i++)
  {
      int d = primes[i]
      while (n % d == 0)
      {
          t[d]++
          n /= d
      }
      if (n == 1)
          return primes[i]
  }
  return n
}
int sumdivaux2(int[] t, int n, int i)
{
  while (i < n && t[i] == 0)
      i++
  return i
}
int sumdivaux(int[] t, int n, int i)
{
  if (i > n)
      return 1
  else if (t[i] == 0)
      return sumdivaux(t, n, sumdivaux2(t, n, i + 1))
  else
  {
      int o = sumdivaux(t, n, sumdivaux2(t, n, i + 1))
      int out0 = 0
      int p = i
      for (int j = 1; j <= t[i]; j++)
      {
          out0 += p
          p *= i
      }
      return (out0 + 1) * o
  }
}
int sumdiv(int nprimes, int[] primes, int n)
{
  int[] t = new int[n + 1]
  for (int i = 0; i <= n; i++)
      t[i] = 0
  int max0 = fillPrimesFactors(t, n, primes, nprimes)
  return sumdivaux(t, max0, 0)
}

int maximumprimes = 30001
int[] era = new int[maximumprimes]
for (int s = 0; s < maximumprimes; s++)
    era[s] = s
int nprimes = eratostene(era, maximumprimes)
int[] primes = new int[nprimes]
for (int t = 0; t < nprimes; t++)
    primes[t] = 0
int l = 0
for (int k = 2; k < maximumprimes; k++)
    if (era[k] == k)
    {
        primes[l] = k
        l++
    }
int n = 100
//  28124 ça prend trop de temps mais on arrive a passer le test 
boolean[] abondant = new boolean[n + 1]
for (int p = 0; p <= n; p++)
    abondant[p] = false
boolean[] summable = new boolean[n + 1]
for (int q = 0; q <= n; q++)
    summable[q] = false
int sum = 0
for (int r = 2; r <= n; r++)
{
    int other = sumdiv(nprimes, primes, r) - r
    if (other > r)
        abondant[r] = true
}
for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
        if (abondant[i] && abondant[j] && i + j <= n)
            summable[i + j] = true
for (int o = 1; o <= n; o++)
    if (!summable[o])
        sum += o
System.out.printf("\n%d\n", sum)



<|start_filename|>out/min3.lua<|end_filename|>

io.write(string.format("%d %d %d %d %d %d\n", math.min(2, 3, 4), math.min(2, 4, 3), math.min(3, 2, 4), math.min(3, 4, 2), math.min(4, 2, 3), math.min(4, 3, 2)))


<|start_filename|>out/euler06.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: main
  100 { lim }
  lim lim 1 + * 2 // { sum }
  sum sum * { carressum }
  lim lim 1 + * 2 lim * 1 + * 6 // { sumcarres }
  carressum sumcarres - s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/euler05.groovy<|end_filename|>
import java.util.*

int[] primesfactors(int n)
{
  int[] tab = new int[n + 1]
  for (int i = 0; i <= n; i++)
      tab[i] = 0
  int d = 2
  while (n != 1 && d * d <= n)
      if (n % d == 0)
      {
          tab[d]++
          n /= d
      }
      else
          d++
  tab[n]++
  return tab
}

int lim = 20
int[] o = new int[lim + 1]
for (int m = 0; m <= lim; m++)
    o[m] = 0
for (int i = 1; i <= lim; i++)
{
    int[] t = primesfactors(i)
    for (int j = 1; j <= i; j++)
        o[j] = Math.max(o[j], t[j])
}
int product = 1
for (int k = 1; k <= lim; k++)
    for (int l = 1; l <= o[k]; l++)
        product *= k
System.out.printf("%d\n", product)



<|start_filename|>out/str2.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
main =
  printf "ma petite chaine en or" :: IO ()




<|start_filename|>out/brainfuck_compiler.java<|end_filename|>
import java.util.*;

public class brainfuck_compiler
{
  
  /*
Ce test permet de tester les macros
C'est un compilateur brainfuck qui lit sur l'entrée standard pendant la compilation
et qui produit les macros metalang correspondante
*/
  public static void main(String args[])
  {
    char input = ' ';
    int current_pos = 500;
    int[] mem = new int[1000];
    for (int i = 0; i < 1000; i++)
        mem[i] = 0;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    current_pos++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    while (mem[current_pos] != 0)
    {
        mem[current_pos]--;
        current_pos--;
        mem[current_pos]++;
        System.out.print((char)(mem[current_pos]));
        current_pos++;
    }
  }
  
}



<|start_filename|>out/pathfinding0.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_char_(){
    if (current_char == null) current_char = read_char0();
    var out = current_char;
    current_char = read_char0();
    return out;
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function pathfind_aux(cache, tab, x, y, posX, posY){
    if (posX == x - 1 && posY == y - 1)
        return 0;
    else if (posX < 0 || posY < 0 || posX >= x || posY >= y)
        return x * y * 10;
    else if (tab[posY][posX] == '#')
        return x * y * 10;
    else if (cache[posY][posX] != -1)
        return cache[posY][posX];
    else
    {
        cache[posY][posX] = x * y * 10;
        var val1 = pathfind_aux(cache, tab, x, y, posX + 1, posY);
        var val2 = pathfind_aux(cache, tab, x, y, posX - 1, posY);
        var val3 = pathfind_aux(cache, tab, x, y, posX, posY - 1);
        var val4 = pathfind_aux(cache, tab, x, y, posX, posY + 1);
        var out0 = 1 + Math.min(val1, val2, val3, val4);
        cache[posY][posX] = out0;
        return out0;
    }
}
function pathfind(tab, x, y){
    var cache = new Array(y);
    for (var i = 0; i < y; i++)
    {
        var tmp = new Array(x);
        for (var j = 0; j < x; j++)
        {
            util.print(tab[i][j]);
            tmp[j] = -1;
        }
        util.print("\n");
        cache[i] = tmp;
    }
    return pathfind_aux(cache, tab, x, y, 0, 0);
}
var x = read_int_();
stdinsep();
var y = read_int_();
stdinsep();
util.print(x, " ", y, "\n");
var e = new Array(y);
for (var f = 0; f < y; f++)
{
    var g = new Array(x);
    for (var h = 0; h < x; h++)
    {
        g[h] = read_char_();
    }
    stdinsep();
    e[f] = g;
}
var tab = e;
var result = pathfind(tab, x, y);
util.print(result);



<|start_filename|>out/aaa_01hello.js<|end_filename|>
var util = require("util");

util.print("Hello World");
var a = 5;
util.print((4 + 6) * 2, " \n", a, "foo");
if (1 + ~~(2 * 2 * (3 + 8) / 4) - 2 == 12 && true)
    util.print("True");
else
    util.print("False");
util.print("\n");
if ((3 * (4 + 11) * 2 == 45) == false)
    util.print("True");
else
    util.print("False");
util.print(" ");
if ((2 == 1) == false)
    util.print("True");
else
    util.print("False");
util.print(" ", ~~(~~(5 / 3) / 3), ~~(~~(4 * 1 / 3) / 2 * 1));
if (!(!(a == 0) && !(a == 4)))
    util.print("True");
else
    util.print("False");
if (true && !false && !(true && false))
    util.print("True");
else
    util.print("False");
util.print("\n");



<|start_filename|>out/small_inline.java<|end_filename|>
import java.util.*;

public class small_inline
{
  static Scanner scanner = new Scanner(System.in);
  
  public static void main(String args[])
  {
    int[] t = new int[2];
    for (int d = 0; d < 2; d++)
    {
        if (scanner.hasNext("^-")) {
          scanner.next("^-");
          t[d] = -scanner.nextInt();
        }else{
          t[d] = scanner.nextInt();
        }
        scanner.findWithinHorizon("[\n\r ]*", 1);
    }
    System.out.printf("%d - %d\n", t[0], t[1]);
  }
  
}



<|start_filename|>out/aaa_021if.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
testA a b =
  if a
  then if b
       then printf "A" :: IO ()
       else printf "B" :: IO ()
  else if b
       then printf "C" :: IO ()
       else printf "D" :: IO ()

testB a b =
  if a
  then printf "A" :: IO ()
  else if b
       then printf "B" :: IO ()
       else printf "C" :: IO ()

testC a b =
  if a
  then if b
       then printf "A" :: IO ()
       else printf "B" :: IO ()
  else printf "C" :: IO ()

testD a b =
  if a
  then do if b
          then printf "A" :: IO ()
          else printf "B" :: IO ()
          printf "C" :: IO ()
  else printf "D" :: IO ()

testE a b =
  if a
  then if b
       then printf "A" :: IO ()
       else return ()
  else do if b
          then printf "C" :: IO ()
          else printf "D" :: IO ()
          printf "E" :: IO ()

test a b =
  do testD a b
     testE a b
     printf "\n" :: IO ()

main =
  do test True True
     test True False
     test False True
     test False False
     return ()




<|start_filename|>out/devine.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int devine0(int nombre, int* tab, int len) {
    int i;
    int min0 = tab[0];
    int max0 = tab[1];
    for (i = 2; i < len; i++)
    {
        if (tab[i] > max0 || tab[i] < min0)
            return 0;
        if (tab[i] < nombre)
            min0 = tab[i];
        if (tab[i] > nombre)
            max0 = tab[i];
        if (tab[i] == nombre && len != i + 1)
            return 0;
    }
    return 1;
}
int main(void) {
    int i, tmp, len, nombre;
    scanf("%d %d ", &nombre, &len);
    int *tab = calloc(len, sizeof(int));
    for (i = 0; i < len; i++)
    {
        scanf("%d ", &tmp);
        tab[i] = tmp;
    }
    if (devine0(nombre, tab, len))
        printf("True");
    else
        printf("False");
    return 0;
}




<|start_filename|>out/record2.cpp<|end_filename|>
#include <iostream>
#include <vector>
struct toto {
    int foo;
    int bar;
    int blah;
};


toto mktoto(int v1) {
    toto t;
        t.foo = v1;
        t.bar = 0;
        t.blah = 0;;
    return t;
}


int result(toto& t) {
    t.blah++;
    return t.foo + t.blah * t.bar + t.bar * t.foo;
}

int main() {
    toto t = mktoto(4);
    std::cin >> t.bar >> t.blah >> std::noskipws;
    std::cout << result(t);
}



<|start_filename|>out/euler06.cs<|end_filename|>
using System;

public class euler06
{
  
  public static void Main(String[] args)
  {
    int lim = 100;
    int sum = lim * (lim + 1) / 2;
    int carressum = sum * sum;
    int sumcarres = lim * (lim + 1) * (2 * lim + 1) / 6;
    Console.Write(carressum - sumcarres);
  }
  
}



<|start_filename|>out/test_enum.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
data Foo_t = Foo
  | Bar
  | Blah
  deriving Eq


main =
  return ()




<|start_filename|>out/euler33.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler33 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

function max2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a > b
  then
    return a;
  else
    return b;
  end if;
end;
function min2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a < b
  then
    return a;
  else
    return b;
  end if;
end;
function pgcd(a : in Integer; b : in Integer) return Integer is
  reste : Integer;
  d : Integer;
  c : Integer;
begin
  c := min2_0(a, b);
  d := max2_0(a, b);
  reste := d rem c;
  if reste = 0
  then
    return c;
  else
    return pgcd(c, reste);
  end if;
end;

  top : Integer;
  p : Integer;
  bottom : Integer;
  b : Integer;
  a : Integer;
begin
  top := 1;
  bottom := 1;
  for i in integer range 1..9 loop
    for j in integer range 1..9 loop
      for k in integer range 1..9 loop
        if i /= j and then j /= k
        then
          a := i * 10 + j;
          b := j * 10 + k;
          if a * k = i * b
          then
            PInt(a);
            PString(new char_array'( To_C("/")));
            PInt(b);
            PString(new char_array'( To_C("" & Character'Val(10))));
            top := top * a;
            bottom := bottom * b;
          end if;
        end if;
      end loop;
    end loop;
  end loop;
  PInt(top);
  PString(new char_array'( To_C("/")));
  PInt(bottom);
  PString(new char_array'( To_C("" & Character'Val(10))));
  p := pgcd(top, bottom);
  PString(new char_array'( To_C("pgcd=")));
  PInt(p);
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(bottom / p);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/aaa_10stringsarray.cs<|end_filename|>
using System;

public class aaa_10stringsarray
{
  public class toto {
    public String s;
    public int v;
  }
  static String idstring(String s)
  {
    return s;
  }
  
  static void printstring(String s)
  {
    Console.Write(idstring(s) + "\n");
  }
  
  static void print_toto(toto t)
  {
    Console.Write(t.s + " = " + t.v + "\n");
  }
  
  public static void Main(String[] args)
  {
    String[] tab = new String[2];
    for (int i = 0; i < 2; i++)
        tab[i] = idstring("chaine de test");
    for (int j = 0; j < 2; j++)
        printstring(idstring(tab[j]));
    toto a = new toto();
    a.s = "one";
    a.v = 1;
    print_toto(a);
  }
  
}



<|start_filename|>out/vigenere.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int position_alphabet(char c) {
    int i = (int)(c);
    if (i <= (int)('Z') && i >= (int)('A'))
        return i - (int)('A');
    else if (i <= (int)('z') && i >= (int)('a'))
        return i - (int)('a');
    else
        return -1;
}

char of_position_alphabet(int c) {
    return (char)(c + (int)('a'));
}

void crypte(int taille_cle, char* cle, int taille, char* message) {
    int i;
    for (i = 0; i < taille; i++)
    {
        int lettre = position_alphabet(message[i]);
        if (lettre != -1)
        {
            int addon = position_alphabet(cle[i % taille_cle]);
            int new0 = (addon + lettre) % 26;
            message[i] = of_position_alphabet(new0);
        }
    }
}
int main(void) {
    int i, index2, taille, index, taille_cle;
    char out2, out0;
    scanf("%d ", &taille_cle);
    char *cle = calloc(taille_cle, sizeof(char));
    for (index = 0; index < taille_cle; index++)
    {
        scanf("%c", &out0);
        cle[index] = out0;
    }
    scanf(" %d ", &taille);
    char *message = calloc(taille, sizeof(char));
    for (index2 = 0; index2 < taille; index2++)
    {
        scanf("%c", &out2);
        message[index2] = out2;
    }
    crypte(taille_cle, cle, taille, message);
    for (i = 0; i < taille; i++)
        printf("%c", message[i]);
    printf("\n");
    return 0;
}




<|start_filename|>out/euler08.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: read-char current-char next-char ;
: main
  1 { i }
  HERE 5 cells allot { last }
  4 0 BEGIN 2dup >= WHILE DUP { j }
    read-char { c }
    c [char] 0 - { d }
    i d * TO i
    d last  j cells +  !
   1 + REPEAT 2DROP
  i { max0 }
  0 { index }
  0 { nskipdiv }
  995 1 BEGIN 2dup >= WHILE DUP { k }
    read-char { e }
    e [char] 0 - { f }
    f 0 =
    IF
      1 TO i
      4 TO nskipdiv
    ELSE
      i f * TO i
      nskipdiv 0 <
      IF
        i last  index cells +  @ // TO i
      THEN
      nskipdiv 1 - TO nskipdiv
    THEN
    f last  index cells +  !
    index 1 + 5 % TO index
    max0 i max TO max0
   1 + REPEAT 2DROP
  max0 s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/longest_increasing_subsequence.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int dichofind(int len, int* tab, int tofind, int a, int b) {
    if (a >= b - 1)
        return a;
    else
    {
        int c = (a + b) / 2;
        if (tab[c] < tofind)
            return dichofind(len, tab, tofind, c, b);
        else
            return dichofind(len, tab, tofind, a, c);
    }
}

int process(int len, int* tab) {
    int m, l, i, j;
    int *size = calloc(len, sizeof(int));
    for (j = 0; j < len; j++)
        if (j == 0)
            size[j] = 0;
        else
            size[j] = len * 2;
    for (i = 0; i < len; i++)
    {
        int k = dichofind(len, size, tab[i], 0, len - 1);
        if (size[k + 1] > tab[i])
            size[k + 1] = tab[i];
    }
    for (l = 0; l < len; l++)
        printf("%d ", size[l]);
    for (m = 0; m < len; m++)
    {
        int k = len - 1 - m;
        if (size[k] != len * 2)
            return k;
    }
    return 0;
}
int main(void) {
    int i, e, len, n;
    scanf("%d ", &n);
    for (i = 1; i <= n; i++)
    {
        scanf("%d ", &len);
        int *d = calloc(len, sizeof(int));
        for (e = 0; e < len; e++)
            scanf("%d ", &d[e]);
        printf("%d\n", process(len, d));
    }
    return 0;
}




<|start_filename|>out/aaa_02if.lua<|end_filename|>
function f (i)
  if i == 0 then
      return true
  end
  return false
end

if f(4) then
    io.write("true <-\n ->\n")
else 
    io.write("false <-\n ->\n")
end
io.write("small test end\n")


<|start_filename|>out/aaa_readints.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_readints is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;

type e is Array (Integer range <>) of Integer;
type e_PTR is access e;
type f is Array (Integer range <>) of e_PTR;
type f_PTR is access f;

  tab2 : f_PTR;
  tab1 : e_PTR;
  len : Integer;
  c : e_PTR;
begin
  Get(len);
  SkipSpaces;
  PInt(len);
  PString(new char_array'( To_C("=len" & Character'Val(10))));
  tab1 := new e (0..len - 1);
  for a in integer range 0..len - 1 loop
    Get(tab1(a));
    SkipSpaces;
  end loop;
  for i in integer range 0..len - 1 loop
    PInt(i);
    PString(new char_array'( To_C("=>")));
    PInt(tab1(i));
    PString(new char_array'( To_C("" & Character'Val(10))));
  end loop;
  Get(len);
  SkipSpaces;
  tab2 := new f (0..len - 2);
  for b in integer range 0..len - 2 loop
    c := new e (0..len - 1);
    for d in integer range 0..len - 1 loop
      Get(c(d));
      SkipSpaces;
    end loop;
    tab2(b) := c;
  end loop;
  for i in integer range 0..len - 2 loop
    for j in integer range 0..len - 1 loop
      PInt(tab2(i)(j));
      PString(new char_array'( To_C(" ")));
    end loop;
    PString(new char_array'( To_C("" & Character'Val(10))));
  end loop;
end;


<|start_filename|>out/montagnes.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int montagnes0(int* tab, int len) {
    int max0 = 1;
    int j = 1;
    int i = len - 2;
    while (i >= 0)
    {
        int x = tab[i];
        while (j >= 0 && x > tab[len - j])
            j--;
        j++;
        tab[len - j] = x;
        if (j > max0)
            max0 = j;
        i--;
    }
    return max0;
}
int main(void) {
    int i;
    int len = 0;
    scanf("%d ", &len);
    int *tab = calloc(len, sizeof(int));
    for (i = 0; i < len; i++)
    {
        int x = 0;
        scanf("%d ", &x);
        tab[i] = x;
    }
    printf("%d", montagnes0(tab, len));
    return 0;
}




<|start_filename|>out/euler33.java<|end_filename|>
import java.util.*;

public class euler33
{
  
  static int pgcd(int a, int b)
  {
    int c = Math.min(a, b);
    int d = Math.max(a, b);
    int reste = d % c;
    if (reste == 0)
        return c;
    else
        return pgcd(c, reste);
  }
  public static void main(String args[])
  {
    int top = 1;
    int bottom = 1;
    for (int i = 1; i < 10; i++)
        for (int j = 1; j < 10; j++)
            for (int k = 1; k < 10; k++)
                if (i != j && j != k)
                {
                    int a = i * 10 + j;
                    int b = j * 10 + k;
                    if (a * k == i * b)
                    {
                        System.out.printf("%d/%d\n", a, b);
                        top *= a;
                        bottom *= b;
                    }
                }
    System.out.printf("%d/%d\n", top, bottom);
    int p = pgcd(top, bottom);
    System.out.printf("pgcd=%d\n%d\n", p, bottom / p);
  }
  
}



<|start_filename|>out/prologin_template_intmatrix.cpp<|end_filename|>
#include <iostream>
#include <vector>

template <typename T> std::vector<std::vector<T>> read_matrix(int l, int c) {
    std::vector<std::vector<T>> matrix(l, std::vector<T>(c));
    for (std::vector<T>& line : matrix)
        for (T& elem : line)
            std::cin >> elem;
    return matrix;
}

int programme_candidat(std::vector<std::vector<int>>& tableau, int x, int y) {
    int out0 = 0;
    for (int i = 0; i < y; i++)
        for (int j = 0; j < x; j++)
            out0 += tableau[i][j] * (i * 2 + j);
    return out0;
}

int main() {
    int taille_y, taille_x;
    std::cin >> taille_x >> taille_y;
    std::vector<std::vector<int>> tableau = read_matrix<int>(taille_y, taille_x);
    std::cout << programme_candidat(tableau, taille_x, taille_y) << "\n";
}



<|start_filename|>out/aaa_04loop.go<|end_filename|>
package main
import "fmt"
func h(i int) bool{
  /*  for j = i - 2 to i + 2 do
    if i % j == 5 then return true end
  end */
  j := i - 2
  for j <= i + 2 {
      if i % j == 5 {
          return true
      }
      j++
  }
  return false
}
func main() {
  j := 0
  for k := 0; k < 11; k++ {
      j += k
      fmt.Printf("%d\n", j)
  }
  i := 4
  for i < 10 {
      fmt.Printf("%d", i)
      i++
      j += i
  }
  fmt.Printf("%d%dFIN TEST\n", j, i)
}



<|start_filename|>out/rot13.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
/*
Ce test effectue un rot13 sur une chaine lue en entrée
*/
func main() {
  reader = bufio.NewReader(os.Stdin)
  var strlen int
  fmt.Fscanf(reader, "%d", &strlen)
  skip()
  var tab4 []byte = make([]byte, strlen)
  for toto := 0; toto < strlen; toto++ {
      var tmpc byte
      fmt.Fscanf(reader, "%c", &tmpc)
      c := (int)(tmpc)
      if tmpc != ' ' {
          c = (c - (int)('a') + 13) % 26 + (int)('a')
      }
      tab4[toto] = (byte)(c)
  }
  for j := 0; j < strlen; j++ {
      fmt.Printf("%c", tab4[j])
  }
}



<|start_filename|>out/carre.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

template <typename T> std::vector<std::vector<T>> read_matrix(int l, int c) {
    std::vector<std::vector<T>> matrix(l, std::vector<T>(c));
    for (std::vector<T>& line : matrix)
        for (T& elem : line)
            std::cin >> elem;
    return matrix;
}

int main() {
    int y, x;
    std::cin >> x >> y;
    std::vector<std::vector<int>> tab = read_matrix<int>(y, x);
    for (int ix = 1; ix < x; ix++)
        for (int iy = 1; iy < y; iy++)
            if (tab[iy][ix] == 1)
                tab[iy][ix] = std::min({tab[iy][ix - 1], tab[iy - 1][ix], tab[iy - 1][ix - 1]}) + 1;
    for (int jy = 0; jy < y; jy++)
    {
        for (int jx = 0; jx < x; jx++)
            std::cout << tab[jy][jx] << " ";
        std::cout << "\n";
    }
}



<|start_filename|>out/euler01.fs<|end_filename|>
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: main
  0 { sum }
  999 0 BEGIN 2dup >= WHILE DUP { i }
    i 3 % 0 = i 5 % 0 = OR
    IF
      sum i + TO sum
    THEN
   1 + REPEAT 2DROP
  sum s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/record2.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

typedef struct toto {
  int foo;
    int bar;
    int blah;
} toto;

struct toto * mktoto(int v1) {
    struct toto * t = malloc(sizeof(toto));
    t->foo = v1;
    t->bar = 0;
    t->blah = 0;
    return t;
}

int result(struct toto * t) {
    t->blah++;
    return t->foo + t->blah * t->bar + t->bar * t->foo;
}
int main(void) {
    struct toto * t = mktoto(4);
    scanf("%d %d", &t->bar, &t->blah);
    printf("%d", result(t));
    return 0;
}




<|start_filename|>out/record3.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
data Toto = Toto {
                    _foo :: IORef Int,
                    _bar :: IORef Int,
                    _blah :: IORef Int
                    }
  deriving Eq


mktoto v1 =
  (Toto <$> (newIORef v1) <*> (newIORef 0) <*> (newIORef 0))

result t len =
  let a j b =
        if j <= len - 1
        then do join $ writeIORef <$> (_blah <$> (readIOA t j)) <*> (((+) 1) <$> ((_blah <$> (readIOA t j)) >>= readIORef))
                c <- ((+) <$> ((+) <$> (((+) b) <$> ((_foo <$> (readIOA t j)) >>= readIORef)) <*> ((*) <$> ((_blah <$> (readIOA t j)) >>= readIORef) <*> ((_bar <$> (readIOA t j)) >>= readIORef))) <*> ((*) <$> ((_bar <$> (readIOA t j)) >>= readIORef) <*> ((_foo <$> (readIOA t j)) >>= readIORef)))
                a (j + 1) c
        else return b in
        a 0 0

main =
  do t <- array_init 4 (\ i ->
                          mktoto i)
     d <- read_int
     join $ writeIORef <$> (_bar <$> (readIOA t 0)) <*> return d
     skip_whitespaces
     e <- read_int
     join $ writeIORef <$> (_blah <$> (readIOA t 1)) <*> return e
     titi <- result t 4
     printf "%d%d" (titi::Int) =<< (((_blah <$> (readIOA t 2)) >>= readIORef)::IO Int)




<|start_filename|>out/abstest.go<|end_filename|>
package main
import "fmt"
func abs_(n int) int{
  if n > 0 {
      return n
  } else {
      return -n
  }
}
func main() {
  fmt.Printf("%d%d", abs_(5 + 2) * 3, 3 * abs_(5 + 2))
}



<|start_filename|>out/euler52.java<|end_filename|>
import java.util.*;

public class euler52
{
  
  static int chiffre_sort(int a)
  {
    if (a < 10)
        return a;
    else
    {
        int b = chiffre_sort(a / 10);
        int c = a % 10;
        int d = b % 10;
        int e = b / 10;
        if (c < d)
            return c + b * 10;
        else
            return d + chiffre_sort(c + e * 10) * 10;
    }
  }
  static boolean same_numbers(int a, int b, int c, int d, int e, int f)
  {
    int ca = chiffre_sort(a);
    return ca == chiffre_sort(b) && ca == chiffre_sort(c) && ca == chiffre_sort(d) && ca == chiffre_sort(e) && ca == chiffre_sort(f);
  }
  public static void main(String args[])
  {
    int num = 142857;
    if (same_numbers(num, num * 2, num * 3, num * 4, num * 6, num * 5))
        System.out.printf("%d %d %d %d %d %d\n", num, num * 2, num * 3, num * 4, num * 5, num * 6);
  }
  
}



<|start_filename|>out/test_instant.fs<|end_filename|>
: foo { a b }
  a b + exit
;

: main
  10 s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/rot13.cc<|end_filename|>
#include <iostream>
#include <vector>
/*
Ce test effectue un rot13 sur une chaine lue en entrée
*/
int main() {
    int strlen;
    char tmpc;
    std::cin >> strlen;
    std::vector<char> *tab4 = new std::vector<char>( strlen );
    for (int toto = 0; toto < strlen; toto++)
    {
        std::cin >> tmpc >> std::noskipws;
        int c = (int)(tmpc);
        if (tmpc != ' ')
            c = (c - (int)('a') + 13) % 26 + (int)('a');
        tab4->at(toto) = (char)(c);
    }
    for (int j = 0; j < strlen; j++)
        std::cout << tab4->at(j);
}



<|start_filename|>out/euler14.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: next0 { n }
  n 2 % 0 =
  IF
    n 2 // exit
  ELSE
    3 n * 1 + exit
  THEN
;


: find0 recursive { n m }
  n 1 =
  IF
    1 exit
  ELSE
    n 1000000 >=
    IF
      1 n next0 m find0 + exit
    ELSE
      m  n cells +  @ 0 <>
      IF
        m  n cells +  @ exit
      ELSE
        1 n next0 m find0 + m  n cells +  !
        m  n cells +  @ exit
      THEN
    THEN
  THEN
;

: main
  HERE 1000000 cells allot { m }
  999999 0 BEGIN 2dup >= WHILE DUP { j }
    0 m  j cells +  !
   1 + REPEAT 2DROP
  0 { max0 }
  0 { maxi }
  999 1 BEGIN 2dup >= WHILE DUP { i }
    \  normalement on met 999999 mais ça dépasse les int32... 
    
    i m find0 { n2 }
    n2 max0 >
    IF
      n2 TO max0
      i TO maxi
    THEN
   1 + REPEAT 2DROP
  max0 s>d 0 d.r
  S\" \n" TYPE
  maxi s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/aaa_04loop.java<|end_filename|>
import java.util.*;

public class aaa_04loop
{
  
  static boolean h(int i)
  {
    /*  for j = i - 2 to i + 2 do
    if i % j == 5 then return true end
  end */
    int j = i - 2;
    while (j <= i + 2)
    {
        if (i % j == 5)
            return true;
        j++;
    }
    return false;
  }
  public static void main(String args[])
  {
    int j = 0;
    for (int k = 0; k < 11; k++)
    {
        j += k;
        System.out.printf("%d\n", j);
    }
    int i = 4;
    while (i < 10)
    {
        System.out.print(i);
        i++;
        j += i;
    }
    System.out.printf("%d%dFIN TEST\n", j, i);
  }
  
}



<|start_filename|>out/tuple.java<|end_filename|>
import java.util.*;

public class tuple
{
  
  static class tuple_int_int {
    public int tuple_int_int_field_0;
    public int tuple_int_int_field_1;
  }
  static tuple_int_int f(tuple_int_int tuple0)
  {
    tuple_int_int c = tuple0;
    int a = c.tuple_int_int_field_0;
    int b = c.tuple_int_int_field_1;
    tuple_int_int d = new tuple_int_int();
    d.tuple_int_int_field_0 = a + 1;
    d.tuple_int_int_field_1 = b + 1;
    return d;
  }
  public static void main(String args[])
  {
    tuple_int_int e = new tuple_int_int();
    e.tuple_int_int_field_0 = 0;
    e.tuple_int_int_field_1 = 1;
    tuple_int_int t = f(e);
    tuple_int_int g = t;
    int a = g.tuple_int_int_field_0;
    int b = g.tuple_int_int_field_1;
    System.out.printf("%d -- %d--\n", a, b);
  }
  
}



<|start_filename|>out/euler42.java<|end_filename|>
import java.util.*;

public class euler42
{
  static Scanner scanner = new Scanner(System.in);
  static boolean is_triangular(int n)
  {
    /*
   n = k * (k + 1) / 2
	  n * 2 = k * (k + 1)
   */
    int a = (int)Math.sqrt(n * 2);
    return a * (a + 1) == n * 2;
  }
  static int score()
  {
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int len;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      len = scanner.nextInt();
    } else {
      len = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int sum = 0;
    for (int i = 1; i <= len; i++)
    {
        char c = scanner.findWithinHorizon(".", 1).charAt(0);
        sum += (int)(c) - (int)('A') + 1;
        // 		print c print " " print sum print " " 
    }
    if (is_triangular(sum))
        return 1;
    else
        return 0;
  }
  public static void main(String args[])
  {
    for (int i = 1; i < 56; i++)
        if (is_triangular(i))
            System.out.printf("%d ", i);
    System.out.print("\n");
    int sum = 0;
    int n;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      n = scanner.nextInt();
    } else {
      n = scanner.nextInt();
    }
    for (int i = 1; i <= n; i++)
        sum += score();
    System.out.printf("%d\n", sum);
  }
  
}



<|start_filename|>out/euler36.java<|end_filename|>
import java.util.*;

public class euler36
{
  
  static boolean palindrome2(int[] pow2, int n)
  {
    boolean[] t = new boolean[20];
    for (int i = 0; i < 20; i++)
        t[i] = n / pow2[i] % 2 == 1;
    int nnum = 0;
    for (int j = 1; j < 20; j++)
        if (t[j])
            nnum = j;
    for (int k = 0; k <= nnum / 2; k++)
        if (t[k] != t[nnum - k])
            return false;
    return true;
  }
  public static void main(String args[])
  {
    int p = 1;
    int[] pow2 = new int[20];
    for (int i = 0; i < 20; i++)
    {
        p *= 2;
        pow2[i] = p / 2;
    }
    int sum = 0;
    for (int d = 1; d < 10; d++)
    {
        if (palindrome2(pow2, d))
        {
            System.out.printf("%d\n", d);
            sum += d;
        }
        if (palindrome2(pow2, d * 10 + d))
        {
            System.out.printf("%d\n", d * 10 + d);
            sum += d * 10 + d;
        }
    }
    for (int a0 = 0; a0 < 5; a0++)
    {
        int a = a0 * 2 + 1;
        for (int b = 0; b < 10; b++)
        {
            for (int c = 0; c < 10; c++)
            {
                int num0 = a * 100000 + b * 10000 + c * 1000 + c * 100 + b * 10 + a;
                if (palindrome2(pow2, num0))
                {
                    System.out.printf("%d\n", num0);
                    sum += num0;
                }
                int num1 = a * 10000 + b * 1000 + c * 100 + b * 10 + a;
                if (palindrome2(pow2, num1))
                {
                    System.out.printf("%d\n", num1);
                    sum += num1;
                }
            }
            int num2 = a * 100 + b * 10 + a;
            if (palindrome2(pow2, num2))
            {
                System.out.printf("%d\n", num2);
                sum += num2;
            }
            int num3 = a * 1000 + b * 100 + b * 10 + a;
            if (palindrome2(pow2, num3))
            {
                System.out.printf("%d\n", num3);
                sum += num3;
            }
        }
    }
    System.out.printf("sum=%d\n", sum);
  }
  
}



<|start_filename|>out/affect.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
/*
Ce test permet de vérifier que l'implémentation de l'affectation fonctionne correctement
*/

type toto struct {
  foo int;
  bar int;
  blah int;
}
func mktoto(v1 int) * toto{
  var t * toto = new (toto)
      (*t).foo=v1
      (*t).bar=v1
      (*t).blah=v1
  return t
}
func mktoto2(v1 int) * toto{
  var t * toto = new (toto)
      (*t).foo=v1 + 3
      (*t).bar=v1 + 2
      (*t).blah=v1 + 1
  return t
}
func result(t_ * toto, t2_ * toto) int{
  var t * toto = t_
  var t2 * toto = t2_
  var t3 * toto = new (toto)
      (*t3).foo=0
      (*t3).bar=0
      (*t3).blah=0
  t3 = t2
  t = t2
  t2 = t3
  (*t).blah++
  len := 1
  var cache0 []int = make([]int, len)
  for i := 0; i < len; i++ {
      cache0[i] = -i
  }
  var cache1 []int = make([]int, len)
  for j := 0; j < len; j++ {
      cache1[j] = j
  }
  var cache2 []int = cache0
  _  = cache2
  cache0 = cache1
  cache2 = cache0
  return (*t).foo + (*t).blah * (*t).bar + (*t).bar * (*t).foo
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var t * toto = mktoto(4)
  var t2 * toto = mktoto(5)
  fmt.Fscanf(reader, "%d", &(*t).bar)
  skip()
  fmt.Fscanf(reader, "%d", &(*t).blah)
  skip()
  fmt.Fscanf(reader, "%d", &(*t2).bar)
  skip()
  fmt.Fscanf(reader, "%d", &(*t2).blah)
  fmt.Printf("%d%d", result(t, t2), (*t).blah)
}



<|start_filename|>out/aaa_07triplet.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int main(void) {
    int j, d, i, c, b, a;
    for (i = 1; i < 4; i++)
    {
        scanf("%d %d %d ", &a, &b, &c);
        printf("a = %d b = %dc =%d\n", a, b, c);
    }
    int *l = calloc(10, sizeof(int));
    for (d = 0; d < 10; d++)
        scanf("%d ", &l[d]);
    for (j = 0; j < 10; j++)
        printf("%d\n", l[j]);
    return 0;
}




<|start_filename|>out/prologin_template_charmatrix.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int programme_candidat(char[][] tableau, int taille_x, int taille_y)
{
  int out0 = 0
  for (int i = 0; i < taille_y; i++)
  {
      for (int j = 0; j < taille_x; j++)
      {
          out0 += (0+tableau[i][j]) * (i + j * 2)
          print(tableau[i][j])
      }
      print("--\n")
  }
  return out0
}
@Field Scanner scanner = new Scanner(System.in)
int taille_x = Integer.parseInt(scanner.nextLine())
int taille_y = Integer.parseInt(scanner.nextLine())
char[][] a = new char[taille_y][]
for (int b = 0; b < taille_y; b++)
    a[b] = scanner.nextLine().toCharArray()
char[][] tableau = a
System.out.printf("%d\n", programme_candidat(tableau, taille_x, taille_y))



<|start_filename|>out/euler07.go<|end_filename|>
package main
import "fmt"
func divisible(n int, t []int, size int) bool{
  for i := 0; i < size; i++ {
      if n % t[i] == 0 {
          return true
      }
  }
  return false
}
func find(n int, t []int, used int, nth int) int{
  for used != nth {
      if divisible(n, t, used) {
          n++
      } else {
          t[used] = n
          n++
          used++
      }
  }
  return t[used - 1]
}
func main() {
  n := 10001
  var t []int = make([]int, n)
  for i := 0; i < n; i++ {
      t[i] = 2
  }
  fmt.Printf("%d\n", find(3, t, 1, n))
}



<|start_filename|>out/cambriolage.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int max2_(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}

int nbPassePartout(int n, int** passepartout, int m, int** serrures) {
    int i;
    int max_ancient = 0;
    int max_recent = 0;
    for (i = 0; i < m; i++)
    {
        if (serrures[i][0] == -1 && serrures[i][1] > max_ancient)
            max_ancient = serrures[i][1];
        if (serrures[i][0] == 1 && serrures[i][1] > max_recent)
            max_recent = serrures[i][1];
    }
    int max_ancient_pp = 0;
    int max_recent_pp = 0;
    for (i = 0; i < n; i++)
    {
        int* pp = passepartout[i];
        if (pp[0] >= max_ancient && pp[1] >= max_recent)
            return 1;
        max_ancient_pp = max2_(max_ancient_pp, pp[0]);
        max_recent_pp = max2_(max_recent_pp, pp[1]);
    }
    if (max_ancient_pp >= max_ancient && max_recent_pp >= max_recent)
        return 2;
    else
        return 0;
}
int main(void) {
    int k, l, out_, m, i, j, out01, n;
    scanf("%d ", &n);
    int* *passepartout = calloc(n, sizeof(int*));
    for (i = 0; i < n; i++)
    {
        int *out0 = calloc(2, sizeof(int));
        for (j = 0; j < 2; j++)
        {
            scanf("%d ", &out01);
            out0[j] = out01;
        }
        passepartout[i] = out0;
    }
    scanf("%d ", &m);
    int* *serrures = calloc(m, sizeof(int*));
    for (k = 0; k < m; k++)
    {
        int *out1 = calloc(2, sizeof(int));
        for (l = 0; l < 2; l++)
        {
            scanf("%d ", &out_);
            out1[l] = out_;
        }
        serrures[k] = out1;
    }
    printf("%d", nbPassePartout(n, passepartout, m, serrures));
    return 0;
}




<|start_filename|>out/aaa_07triplet.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

  int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }


@Field Scanner scanner = new Scanner(System.in)
for (int i = 1; i < 4; i++)
{
    int[] d = read_int_line()
    int a = d[0]
    int b = d[1]
    int c = d[2]
    System.out.printf("a = %d b = %dc =%d\n", a, b, c)
}
int[] l = read_int_line()
for (int j = 0; j < 10; j++)
    System.out.printf("%d\n", l[j])



<|start_filename|>out/aaa_11arrayconst.cs<|end_filename|>
using System;

public class aaa_11arrayconst
{
  static void test(int[] tab, int len)
  {
    for (int i = 0; i < len; i++)
        Console.Write(tab[i] + " ");
    Console.Write("\n");
  }
  
  public static void Main(String[] args)
  {
    int[] t = new int[5];
    for (int i = 0; i < 5; i++)
        t[i] = 1;
    test(t, 5);
  }
  
}



<|start_filename|>out/carre.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
main =
  do x <- (fmap read getLine)
     y <- (fmap read getLine)
     tab <- array_init y (\ d ->
                            (join (newListArray . (,) 0 . subtract 1 <$> return x <*> fmap (map read . words) getLine)))
     let e ix =
           if ix <= x - 1
           then let h iy =
                      if iy <= y - 1
                      then ifM (((==) 1) <$> (join $ readIOA <$> (readIOA tab iy) <*> return ix))
                               (do join $ writeIOA <$> (readIOA tab iy) <*> return ix <*> (((+) 1) <$> ((min <$> (((min <$> (join $ readIOA <$> (readIOA tab iy) <*> return (ix - 1)) <*> (join $ readIOA <$> (readIOA tab (iy - 1)) <*> return ix)))) <*> (join $ readIOA <$> (readIOA tab (iy - 1)) <*> return (ix - 1)))))
                                   h (iy + 1))
                               (h (iy + 1))
                      else e (ix + 1) in
                      h 1
           else let f jy =
                      if jy <= y - 1
                      then let g jx =
                                 if jx <= x - 1
                                 then do printf "%d " =<< ((join $ readIOA <$> (readIOA tab jy) <*> return jx)::IO Int)
                                         g (jx + 1)
                                 else do printf "\n" :: IO ()
                                         f (jy + 1) in
                                 g 0
                      else return () in
                      f 0 in
           e 1




<|start_filename|>out/dichoexp.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0

main :: IO ()
exp0 a b =
  if b == 0
  then return 1
  else if (b `rem` 2) == 0
       then do o <- exp0 a (b `quot` 2)
               return (o * o)
       else (((*) a) <$> (exp0 a (b - 1)))

main =
  do c <- read_int
     skip_whitespaces
     d <- read_int
     printf "%d" =<< (exp0 c d :: IO Int)




<|start_filename|>out/affect.cs<|end_filename|>
using System;

public class affect
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static void stdin_sep(){
  do{
    if (eof) return;
    char c = readChar_();
    if (c == ' ' || c == '\n' || c == '\t' || c == '\r'){
      consommeChar();
    }else{
      return;
    }
  } while(true);
}
static int readInt(){
  int i = 0;
  char s = readChar_();
  int sign = 1;
  if (s == '-'){
    sign = -1;
    consommeChar();
  }
  do{
    char c = readChar_();
    if (c <= '9' && c >= '0'){
      i = i * 10 + c - '0';
      consommeChar();
    }else{
      return i * sign;
    }
  } while(true);
} 
  /*
Ce test permet de vérifier que l'implémentation de l'affectation fonctionne correctement
*/
  public class toto {
    public int foo;
    public int bar;
    public int blah;
  }
  static toto mktoto(int v1)
  {
    toto t = new toto();
    t.foo = v1;
    t.bar = v1;
    t.blah = v1;
    return t;
  }
  
  static toto mktoto2(int v1)
  {
    toto t = new toto();
    t.foo = v1 + 3;
    t.bar = v1 + 2;
    t.blah = v1 + 1;
    return t;
  }
  
  static int result(toto t_, toto t2_)
  {
    toto t = t_;
    toto t2 = t2_;
    toto t3 = new toto();
    t3.foo = 0;
    t3.bar = 0;
    t3.blah = 0;
    t3 = t2;
    t = t2;
    t2 = t3;
    t.blah++;
    int len = 1;
    int[] cache0 = new int[len];
    for (int i = 0; i < len; i++)
        cache0[i] = -i;
    int[] cache1 = new int[len];
    for (int j = 0; j < len; j++)
        cache1[j] = j;
    int[] cache2 = cache0;
    cache0 = cache1;
    cache2 = cache0;
    return t.foo + t.blah * t.bar + t.bar * t.foo;
  }
  
  public static void Main(String[] args)
  {
    toto t = mktoto(4);
    toto t2 = mktoto(5);
    t.bar = readInt();
    stdin_sep();
    t.blah = readInt();
    stdin_sep();
    t2.bar = readInt();
    stdin_sep();
    t2.blah = readInt();
    Console.Write("" + result(t, t2) + t.blah);
  }
  
}



<|start_filename|>out/summax_souslist.java<|end_filename|>
import java.util.*;

public class summax_souslist
{
  static Scanner scanner = new Scanner(System.in);
  static int summax(int[] lst, int len)
  {
    int current = 0;
    int max0 = 0;
    for (int i = 0; i < len; i++)
    {
        current += lst[i];
        if (current < 0)
            current = 0;
        if (max0 < current)
            max0 = current;
    }
    return max0;
  }
  public static void main(String args[])
  {
    int len = 0;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      len = -scanner.nextInt();
    }else{
      len = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int[] tab = new int[len];
    for (int i = 0; i < len; i++)
    {
        int tmp = 0;
        if (scanner.hasNext("^-")) {
          scanner.next("^-");
          tmp = -scanner.nextInt();
        }else{
          tmp = scanner.nextInt();
        }
        scanner.findWithinHorizon("[\n\r ]*", 1);
        tab[i] = tmp;
    }
    int result = summax(tab, len);
    System.out.print(result);
  }
  
}



<|start_filename|>out/sqrttest.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>


int main(void) {
    printf("%d %d %d %d %d %d ", (int)sqrt(4), (int)sqrt(16), (int)sqrt(20), (int)sqrt(1000), (int)sqrt(500), (int)sqrt(10));
    return 0;
}




<|start_filename|>out/aaa_read1.lua<|end_filename|>

function readcharline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), ".") do
    tab[index] = string.byte(a)
    index = index + 1
  end
  return tab
end

local str = readcharline()
for i = 0, 11 do
    io.write(string.format("%c", str[i + 1]))
end


<|start_filename|>out/euler08.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_char_(){
    if (current_char == null) current_char = read_char0();
    var out = current_char;
    current_char = read_char0();
    return out;
}
var i = 1;
var last = new Array(5);
for (var j = 0; j < 5; j++)
{
    var c = read_char_();
    var d = c.charCodeAt(0) - '0'.charCodeAt(0);
    i *= d;
    last[j] = d;
}
var max0 = i;
var index = 0;
var nskipdiv = 0;
for (var k = 1; k < 996; k++)
{
    var e = read_char_();
    var f = e.charCodeAt(0) - '0'.charCodeAt(0);
    if (f == 0)
    {
        i = 1;
        nskipdiv = 4;
    }
    else
    {
        i *= f;
        if (nskipdiv < 0)
            i = ~~(i / last[index]);
        nskipdiv--;
    }
    last[index] = f;
    index = ~~((index + 1) % 5);
    max0 = Math.max(max0, i);
}
util.print(max0, "\n");



<|start_filename|>out/dichoexp.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function exp0 (a, b)
  if b == 0 then
      return 1
  end
  if math.fmod(b, 2) == 0 then
      local o = exp0(a, trunc(b / 2))
      return o * o
  else 
      return a * exp0(a, b - 1)
  end
end

local a = 0
local b = 0
a = readint()
stdinsep()
b = readint()
io.write(exp0(a, b))


<|start_filename|>out/plus_petit.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function go0 (tab, a, b)
  local m = trunc((a + b) / 2)
  if a == m then
      if tab[a + 1] == m then
          return b
      else 
          return a
      end
  end
  local i = a
  local j = b
  while i < j do
      local e = tab[i + 1]
      if e < m then
          i = i + 1
      else 
          j = j - 1
          tab[i + 1] = tab[j + 1]
          tab[j + 1] = e
      end
  end
  if i < m then
      return go0(tab, a, m)
  else 
      return go0(tab, m, b)
  end
end

function plus_petit0 (tab, len)
  return go0(tab, 0, len)
end

local len = 0
len = readint()
stdinsep()
local tab = {}
for i = 0, len - 1 do
    local tmp = 0
    tmp = readint()
    stdinsep()
    tab[i + 1] = tmp
end
io.write(plus_petit0(tab, len))


<|start_filename|>out/carre.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class carre
{
  
  public static void Main(String[] args)
  {
    int x = int.Parse(Console.ReadLine());
    int y = int.Parse(Console.ReadLine());
    int[][] tab = new int[y][];
    for (int d = 0; d < y; d++)
        tab[d] = new List<string>(Console.ReadLine().Split(" ".ToCharArray())).ConvertAll(int.Parse).ToArray();
    for (int ix = 1; ix < x; ix++)
        for (int iy = 1; iy < y; iy++)
            if (tab[iy][ix] == 1)
                tab[iy][ix] = Math.Min(Math.Min(tab[iy][ix - 1], tab[iy - 1][ix]), tab[iy - 1][ix - 1]) + 1;
    for (int jy = 0; jy < y; jy++)
    {
        for (int jx = 0; jx < x; jx++)
            Console.Write(tab[jy][jx] + " ");
        Console.Write("\n");
    }
  }
  
}



<|start_filename|>out/aaa_read.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
/*
Ce test permet de vérifier si les différents backends pour les langages implémentent bien
read int, read char et skip
*/
func main() {
  reader = bufio.NewReader(os.Stdin)
  var len int
  fmt.Fscanf(reader, "%d", &len)
  skip()
  fmt.Printf("%d=len\n", len)
  len *= 2
  fmt.Printf("len*2=%d\n", len)
  len /= 2
  var tab []int = make([]int, len)
  for i := 0; i < len; i++ {
      var tmpi1 int
      fmt.Fscanf(reader, "%d", &tmpi1)
      skip()
      fmt.Printf("%d=>%d ", i, tmpi1)
      tab[i] = tmpi1
  }
  fmt.Printf("\n")
  var tab2 []int = make([]int, len)
  for i_ := 0; i_ < len; i_++ {
      var tmpi2 int
      fmt.Fscanf(reader, "%d", &tmpi2)
      skip()
      fmt.Printf("%d==>%d ", i_, tmpi2)
      tab2[i_] = tmpi2
  }
  var strlen int
  fmt.Fscanf(reader, "%d", &strlen)
  skip()
  fmt.Printf("%d=strlen\n", strlen)
  var tab4 []byte = make([]byte, strlen)
  for toto := 0; toto < strlen; toto++ {
      var tmpc byte
      fmt.Fscanf(reader, "%c", &tmpc)
      c := (int)(tmpc)
      fmt.Printf("%c:%d ", tmpc, c)
      if tmpc != ' ' {
          c = (c - (int)('a') + 13) % 26 + (int)('a')
      }
      tab4[toto] = (byte)(c)
  }
  for j := 0; j < strlen; j++ {
      fmt.Printf("%c", tab4[j])
  }
}



<|start_filename|>out/euler50.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: eratostene { t max0 }
  0 { n }
  max0 1 - 2 BEGIN 2dup >= WHILE DUP { i }
    t  i cells +  @ i =
    IF
      n 1 + TO n
      max0 i // i >
      IF
        i i * { j }
        BEGIN
          j max0 < j 0 > AND
        WHILE
          0 t  j cells +  !
          j i + TO j
        REPEAT
      THEN
    THEN
   1 + REPEAT 2DROP
  n exit
;

: main
  1000001 { maximumprimes }
  HERE maximumprimes cells allot { era }
  maximumprimes 1 - 0 BEGIN 2dup >= WHILE DUP { j }
    j era  j cells +  !
   1 + REPEAT 2DROP
  era maximumprimes eratostene { nprimes }
  HERE nprimes cells allot { primes }
  nprimes 1 - 0 BEGIN 2dup >= WHILE DUP { o }
    0 primes  o cells +  !
   1 + REPEAT 2DROP
  0 { l }
  maximumprimes 1 - 2 BEGIN 2dup >= WHILE DUP { k }
    era  k cells +  @ k =
    IF
      k primes  l cells +  !
      l 1 + TO l
    THEN
   1 + REPEAT 2DROP
  l s>d 0 d.r
  S"  == " TYPE
  nprimes s>d 0 d.r
  S\" \n" TYPE
  HERE nprimes cells allot { sum }
  nprimes 1 - 0 BEGIN 2dup >= WHILE DUP { i_ }
    primes  i_ cells +  @ sum  i_ cells +  !
   1 + REPEAT 2DROP
  0 { maxl }
  true { process }
  maximumprimes 1 - { stop }
  1 { len }
  1 { resp }
  BEGIN
    process
  WHILE
    false TO process
    stop 0 BEGIN 2dup >= WHILE DUP { i }
      i len + nprimes <
      IF
        sum  i cells +  @ primes  i len + cells +  @ + sum  i cells +  !
        maximumprimes sum  i cells +  @ >
        IF
          true TO process
          era  sum  i cells +  @ cells +  @ sum  i cells +  @ =
          IF
            len TO maxl
            sum  i cells +  @ TO resp
          THEN
        ELSE
          stop i min TO stop
        THEN
      THEN
     1 + REPEAT 2DROP
    len 1 + TO len
  REPEAT
  resp s>d 0 d.r
  S\" \n" TYPE
  maxl s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/euler33.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function pgcd (a, b)
  local c = math.min(a, b)
  local d = math.max(a, b)
  local reste = math.fmod(d, c)
  if reste == 0 then
      return c
  else 
      return pgcd(c, reste)
  end
end

local top = 1
local bottom = 1
for i = 1, 9 do
    for j = 1, 9 do
        for k = 1, 9 do
            if i ~= j and j ~= k then
                local a = i * 10 + j
                local b = j * 10 + k
                if a * k == i * b then
                    io.write(string.format("%d/%d\n", a, b))
                    top = top * a
                    bottom = bottom * b
                end
            end
        end
    end
end
io.write(string.format("%d/%d\n", top, bottom))
local p = pgcd(top, bottom)
io.write(string.format("pgcd=%d\n%d\n", p, trunc(bottom / p)))


<|start_filename|>out/dichoexp.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func exp0(a int, b int) int{
  if b == 0 {
      return 1
  }
  if b % 2 == 0 {
      o := exp0(a, b / 2)
      return o * o
  } else {
      return a * exp0(a, b - 1)
  }
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  a := 0
  b := 0
  fmt.Fscanf(reader, "%d", &a)
  skip()
  fmt.Fscanf(reader, "%d", &b)
  fmt.Printf("%d", exp0(a, b))
}



<|start_filename|>out/sort.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
copytab tab len =
  array_init len (\ i ->
                    readIOA tab i)

bubblesort tab len =
  let a i =
        if i <= len - 1
        then let b j =
                   if j <= len - 1
                   then ifM ((>) <$> (readIOA tab i) <*> (readIOA tab j))
                            (do tmp <- readIOA tab i
                                writeIOA tab i =<< (readIOA tab j)
                                writeIOA tab j tmp
                                b (j + 1))
                            (b (j + 1))
                   else a (i + 1) in
                   b (i + 1)
        else return () in
        a 0

qsort0 tab len i j =
  if i < j
  then {- pivot : tab[0] -}
       let c d e =
             if d /= e
             then ifM ((>) <$> (readIOA tab d) <*> (readIOA tab e))
                      (if d == e - 1
                       then {- on inverse simplement-}
                            do tmp <- readIOA tab d
                               writeIOA tab d =<< (readIOA tab e)
                               writeIOA tab e tmp
                               let h = d + 1
                               c h e
                       else {- on place tab[i+1] à la place de tab[j], tab[j] à la place de tab[i] et tab[i] à la place de tab[i+1] -}
                            do tmp <- readIOA tab d
                               writeIOA tab d =<< (readIOA tab e)
                               writeIOA tab e =<< (readIOA tab (d + 1))
                               writeIOA tab (d + 1) tmp
                               let g = d + 1
                               c g e)
                      (do let f = e - 1
                          c d f)
             else do qsort0 tab len i (d - 1)
                     qsort0 tab len (d + 1) j
                     return () in
             c i j
  else return ()

main =
  do k <- read_int
     skip_whitespaces
     tab <- array_init k (\ i_ ->
                            do p <- read_int
                               skip_whitespaces
                               return p)
     tab2 <- copytab tab k
     bubblesort tab2 k
     let l i =
           if i <= k - 1
           then do printf "%d " =<< ((readIOA tab2 i)::IO Int)
                   l (i + 1)
           else do printf "\n" :: IO ()
                   tab3 <- copytab tab k
                   qsort0 tab3 k 0 (k - 1)
                   let m n =
                         if n <= k - 1
                         then do printf "%d " =<< ((readIOA tab3 n)::IO Int)
                                 m (n + 1)
                         else printf "\n" :: IO () in
                         m 0 in
           l 0




<|start_filename|>out/prologin_template_2charline.cc<|end_filename|>
#include <iostream>
#include <vector>
std::vector<char> *getline() {
    if (std::cin.flags() & std::ios_base::skipws) {
        char c = std::cin.peek();
        if (c == '\n' || c == ' ') std::cin.ignore();
        std::cin.unsetf(std::ios::skipws);
    }
    std::string line;
    std::getline(std::cin, line);
    std::vector<char> *c = new std::vector<char>(line.begin(), line.end());
    std::cin >> std::skipws;
    return c;
}

int programme_candidat(std::vector<char> * tableau1, int taille1, std::vector<char> * tableau2, int taille2) {
    int out0 = 0;
    for (int i = 0; i < taille1; i++)
    {
        out0 += (int)(tableau1->at(i)) * i;
        std::cout << tableau1->at(i);
    }
    std::cout << "--\n";
    for (int j = 0; j < taille2; j++)
    {
        out0 += (int)(tableau2->at(j)) * j * 100;
        std::cout << tableau2->at(j);
    }
    std::cout << "--\n";
    return out0;
}

int main() {
    int taille2, taille1;
    std::cin >> taille1;
    std::vector<char> * tableau1 = getline();
    std::cin >> taille2;
    std::vector<char> * tableau2 = getline();
    std::cout << programme_candidat(tableau1, taille1, tableau2, taille2) << "\n";
}



<|start_filename|>out/sort.cs<|end_filename|>
using System;

public class sort
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static void stdin_sep(){
  do{
    if (eof) return;
    char c = readChar_();
    if (c == ' ' || c == '\n' || c == '\t' || c == '\r'){
      consommeChar();
    }else{
      return;
    }
  } while(true);
}
static int readInt(){
  int i = 0;
  char s = readChar_();
  int sign = 1;
  if (s == '-'){
    sign = -1;
    consommeChar();
  }
  do{
    char c = readChar_();
    if (c <= '9' && c >= '0'){
      i = i * 10 + c - '0';
      consommeChar();
    }else{
      return i * sign;
    }
  } while(true);
} 
  static int[] copytab(int[] tab, int len)
  {
    int[] o = new int[len];
    for (int i = 0; i < len; i++)
        o[i] = tab[i];
    return o;
  }
  
  static void bubblesort(int[] tab, int len)
  {
    for (int i = 0; i < len; i++)
        for (int j = i + 1; j < len; j++)
            if (tab[i] > tab[j])
            {
                int tmp = tab[i];
                tab[i] = tab[j];
                tab[j] = tmp;
            }
  }
  
  static void qsort0(int[] tab, int len, int i, int j)
  {
    if (i < j)
    {
        int i0 = i;
        int j0 = j;
        //  pivot : tab[0] 
        while (i != j)
            if (tab[i] > tab[j])
                if (i == j - 1)
                {
                    //  on inverse simplement
                    int tmp = tab[i];
                    tab[i] = tab[j];
                    tab[j] = tmp;
                    i++;
                }
                else
                {
                    //  on place tab[i+1] à la place de tab[j], tab[j] à la place de tab[i] et tab[i] à la place de tab[i+1] 
                    int tmp = tab[i];
                    tab[i] = tab[j];
                    tab[j] = tab[i + 1];
                    tab[i + 1] = tmp;
                    i++;
                }
            else
                j--;
        qsort0(tab, len, i0, i - 1);
        qsort0(tab, len, i + 1, j0);
    }
  }
  
  public static void Main(String[] args)
  {
    int len = 2;
    len = readInt();
    stdin_sep();
    int[] tab = new int[len];
    for (int i_ = 0; i_ < len; i_++)
    {
        int tmp = 0;
        tmp = readInt();
        stdin_sep();
        tab[i_] = tmp;
    }
    int[] tab2 = copytab(tab, len);
    bubblesort(tab2, len);
    for (int i = 0; i < len; i++)
        Console.Write(tab2[i] + " ");
    Console.Write("\n");
    int[] tab3 = copytab(tab, len);
    qsort0(tab3, len, 0, len - 1);
    for (int i = 0; i < len; i++)
        Console.Write(tab3[i] + " ");
    Console.Write("\n");
  }
  
}



<|start_filename|>out/euler02.groovy<|end_filename|>
import java.util.*



int a = 1
int b = 2
int sum = 0
while (a < 4000000)
{
    if (a % 2 == 0)
        sum += a
    int c = a
    a = b
    b += c
}
System.out.printf("%d\n", sum)



<|start_filename|>out/ocaml01.fs<|end_filename|>
: foo {  }
  10 0 BEGIN 2dup >= WHILE DUP { i }
    
   1 + REPEAT 2DROP
  0 exit
;


: bar {  }
  10 0 BEGIN 2dup >= WHILE DUP { i }
    0 { a }
   1 + REPEAT 2DROP
  0 exit
;

: main
  
  ;
main
BYE



<|start_filename|>out/prologin_template_2charline.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray

main :: IO ()
programme_candidat tableau1 taille1 tableau2 taille2 =
  let a i b =
        if i <= taille1 - 1
        then do f <- (((+) b) <$> (((*) i) <$> (fmap ord (readIOA tableau1 i))))
                printf "%c" =<< (readIOA tableau1 i :: IO Char)
                a (i + 1) f
        else do printf "--\n" :: IO ()
                let c j d =
                      if j <= taille2 - 1
                      then do e <- (((+) d) <$> (((*) (j * 100)) <$> (fmap ord (readIOA tableau2 j))))
                              printf "%c" =<< (readIOA tableau2 j :: IO Char)
                              c (j + 1) e
                      else do printf "--\n" :: IO ()
                              return d in
                      c 0 b in
        a 0 0

main =
  do taille1 <- (fmap read getLine)
     tableau1 <- (join (newListArray <$> (fmap (\x -> (0, x-1)) (return taille1)) <*> getLine))
     taille2 <- (fmap read getLine)
     tableau2 <- (join (newListArray <$> (fmap (\x -> (0, x-1)) (return taille2)) <*> getLine))
     printf "%d\n" =<< ((programme_candidat tableau1 taille1 tableau2 taille2)::IO Int)




<|start_filename|>out/aaa_read1.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*


@Field Scanner scanner = new Scanner(System.in)
char[] str = scanner.nextLine().toCharArray()
for (int i = 0; i < 12; i++)
    print(str[i])



<|start_filename|>out/euler31.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler31 is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
type b is Array (Integer range <>) of a_PTR;
type b_PTR is access b;
function result(sum : in Integer; t : in a_PTR; maxIndex : in Integer; cache : in b_PTR) return Integer is
  out0 : Integer;
  div : Integer;
begin
  if cache(sum)(maxIndex) /= 0
  then
    return cache(sum)(maxIndex);
  else
    if sum = 0 or else maxIndex = 0
    then
      return 1;
    else
      out0 := 0;
      div := sum / t(maxIndex);
      for i in integer range 0..div loop
        out0 := out0 + result(sum - i * t(maxIndex), t, maxIndex - 1, cache);
      end loop;
      cache(sum)(maxIndex) := out0;
      return out0;
    end if;
  end if;
end;

  t : a_PTR;
  o : a_PTR;
  cache : b_PTR;
begin
  t := new a (0..7);
  for i in integer range 0..7 loop
    t(i) := 0;
  end loop;
  t(0) := 1;
  t(1) := 2;
  t(2) := 5;
  t(3) := 10;
  t(4) := 20;
  t(5) := 50;
  t(6) := 100;
  t(7) := 200;
  cache := new b (0..200);
  for j in integer range 0..200 loop
    o := new a (0..7);
    for k in integer range 0..7 loop
      o(k) := 0;
    end loop;
    cache(j) := o;
  end loop;
  PInt(result(200, t, 7, cache));
end;


<|start_filename|>out/euler08.java<|end_filename|>
import java.util.*;

public class euler08
{
  static Scanner scanner = new Scanner(System.in);
  
  public static void main(String args[])
  {
    int i = 1;
    int[] last = new int[5];
    for (int j = 0; j < 5; j++)
    {
        char c = scanner.findWithinHorizon(".", 1).charAt(0);
        int d = (int)(c) - (int)('0');
        i *= d;
        last[j] = d;
    }
    int max0 = i;
    int index = 0;
    int nskipdiv = 0;
    for (int k = 1; k < 996; k++)
    {
        char e = scanner.findWithinHorizon(".", 1).charAt(0);
        int f = (int)(e) - (int)('0');
        if (f == 0)
        {
            i = 1;
            nskipdiv = 4;
        }
        else
        {
            i *= f;
            if (nskipdiv < 0)
                i /= last[index];
            nskipdiv--;
        }
        last[index] = f;
        index = (index + 1) % 5;
        max0 = Math.max(max0, i);
    }
    System.out.printf("%d\n", max0);
  }
  
}



<|start_filename|>out/prologin_template_charmatrix.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_char_(){
    if (current_char == null) current_char = read_char0();
    var out = current_char;
    current_char = read_char0();
    return out;
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function programme_candidat(tableau, taille_x, taille_y){
    var out0 = 0;
    for (var i = 0; i < taille_y; i++)
    {
        for (var j = 0; j < taille_x; j++)
        {
            out0 += tableau[i][j].charCodeAt(0) * (i + j * 2);
            util.print(tableau[i][j]);
        }
        util.print("--\n");
    }
    return out0;
}
var taille_x = read_int_();
stdinsep();
var taille_y = read_int_();
stdinsep();
var a = new Array(taille_y);
for (var b = 0; b < taille_y; b++)
{
    var c = new Array(taille_x);
    for (var d = 0; d < taille_x; d++)
    {
        c[d] = read_char_();
    }
    stdinsep();
    a[b] = c;
}
var tableau = a;
util.print(programme_candidat(tableau, taille_x, taille_y), "\n");



<|start_filename|>out/bigints.cs<|end_filename|>
using System;

public class bigints
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static char readChar(){
  char out_ = readChar_();
  consommeChar();
  return out_;
}
static void stdin_sep(){
  do{
    if (eof) return;
    char c = readChar_();
    if (c == ' ' || c == '\n' || c == '\t' || c == '\r'){
      consommeChar();
    }else{
      return;
    }
  } while(true);
}
  public class bigint {
    public bool bigint_sign;
    public int bigint_len;
    public int[] bigint_chiffres;
  }
  static bigint read_bigint(int len)
  {
    int[] chiffres = new int[len];
    for (int j = 0; j < len; j++)
    {
        char c = readChar();
        chiffres[j] = (int)(c);
    }
    for (int i = 0; i <= (len - 1) / 2; i++)
    {
        int tmp = chiffres[i];
        chiffres[i] = chiffres[len - 1 - i];
        chiffres[len - 1 - i] = tmp;
    }
    bigint e = new bigint();
    e.bigint_sign = true;
    e.bigint_len = len;
    e.bigint_chiffres = chiffres;
    return e;
  }
  
  static void print_bigint(bigint a)
  {
    if (!a.bigint_sign)
        Console.Write('-');
    for (int i = 0; i < a.bigint_len; i++)
        Console.Write(a.bigint_chiffres[a.bigint_len - 1 - i]);
  }
  
  static bool bigint_eq(bigint a, bigint b)
  {
    //  Renvoie vrai si a = b 
    if (a.bigint_sign != b.bigint_sign)
        return false;
    else if (a.bigint_len != b.bigint_len)
        return false;
    else
    {
        for (int i = 0; i < a.bigint_len; i++)
            if (a.bigint_chiffres[i] != b.bigint_chiffres[i])
                return false;
        return true;
    }
  }
  
  static bool bigint_gt(bigint a, bigint b)
  {
    //  Renvoie vrai si a > b 
    if (a.bigint_sign && !b.bigint_sign)
        return true;
    else if (!a.bigint_sign && b.bigint_sign)
        return false;
    else
    {
        if (a.bigint_len > b.bigint_len)
            return a.bigint_sign;
        else if (a.bigint_len < b.bigint_len)
            return !a.bigint_sign;
        else
            for (int i = 0; i < a.bigint_len; i++)
            {
                int j = a.bigint_len - 1 - i;
                if (a.bigint_chiffres[j] > b.bigint_chiffres[j])
                    return a.bigint_sign;
                else if (a.bigint_chiffres[j] < b.bigint_chiffres[j])
                    return !a.bigint_sign;
            }
        return true;
    }
  }
  
  static bool bigint_lt(bigint a, bigint b)
  {
    return !bigint_gt(a, b);
  }
  
  static bigint add_bigint_positif(bigint a, bigint b)
  {
    //  Une addition ou on en a rien a faire des signes 
    int len = Math.Max(a.bigint_len, b.bigint_len) + 1;
    int retenue = 0;
    int[] chiffres = new int[len];
    for (int i = 0; i < len; i++)
    {
        int tmp = retenue;
        if (i < a.bigint_len)
            tmp += a.bigint_chiffres[i];
        if (i < b.bigint_len)
            tmp += b.bigint_chiffres[i];
        retenue = tmp / 10;
        chiffres[i] = tmp % 10;
    }
    while (len > 0 && chiffres[len - 1] == 0)
        len--;
    bigint f = new bigint();
    f.bigint_sign = true;
    f.bigint_len = len;
    f.bigint_chiffres = chiffres;
    return f;
  }
  
  static bigint sub_bigint_positif(bigint a, bigint b)
  {
    /* Une soustraction ou on en a rien a faire des signes
Pré-requis : a > b
*/
    int len = a.bigint_len;
    int retenue = 0;
    int[] chiffres = new int[len];
    for (int i = 0; i < len; i++)
    {
        int tmp = retenue + a.bigint_chiffres[i];
        if (i < b.bigint_len)
            tmp -= b.bigint_chiffres[i];
        if (tmp < 0)
        {
            tmp += 10;
            retenue = -1;
        }
        else
            retenue = 0;
        chiffres[i] = tmp;
    }
    while (len > 0 && chiffres[len - 1] == 0)
        len--;
    bigint g = new bigint();
    g.bigint_sign = true;
    g.bigint_len = len;
    g.bigint_chiffres = chiffres;
    return g;
  }
  
  static bigint neg_bigint(bigint a)
  {
    bigint h = new bigint();
    h.bigint_sign = !a.bigint_sign;
    h.bigint_len = a.bigint_len;
    h.bigint_chiffres = a.bigint_chiffres;
    return h;
  }
  
  static bigint add_bigint(bigint a, bigint b)
  {
    if (a.bigint_sign == b.bigint_sign)
        if (a.bigint_sign)
            return add_bigint_positif(a, b);
        else
            return neg_bigint(add_bigint_positif(a, b));
    else if (a.bigint_sign)
    {
        //  a positif, b negatif 
        if (bigint_gt(a, neg_bigint(b)))
            return sub_bigint_positif(a, b);
        else
            return neg_bigint(sub_bigint_positif(b, a));
    }
    else
        //  a negatif, b positif 
        if (bigint_gt(neg_bigint(a), b))
            return neg_bigint(sub_bigint_positif(a, b));
        else
            return sub_bigint_positif(b, a);
  }
  
  static bigint sub_bigint(bigint a, bigint b)
  {
    return add_bigint(a, neg_bigint(b));
  }
  
  static bigint mul_bigint_cp(bigint a, bigint b)
  {
    /* Cet algorithm est quadratique.
C'est le même que celui qu'on enseigne aux enfants en CP.
D'ou le nom de la fonction. */
    int len = a.bigint_len + b.bigint_len + 1;
    int[] chiffres = new int[len];
    for (int k = 0; k < len; k++)
        chiffres[k] = 0;
    for (int i = 0; i < a.bigint_len; i++)
    {
        int retenue = 0;
        for (int j = 0; j < b.bigint_len; j++)
        {
            chiffres[i + j] += retenue + b.bigint_chiffres[j] * a.bigint_chiffres[i];
            retenue = chiffres[i + j] / 10;
            chiffres[i + j] = chiffres[i + j] % 10;
        }
        chiffres[i + b.bigint_len] += retenue;
    }
    chiffres[a.bigint_len + b.bigint_len] = chiffres[a.bigint_len + b.bigint_len - 1] / 10;
    chiffres[a.bigint_len + b.bigint_len - 1] = chiffres[a.bigint_len + b.bigint_len - 1] % 10;
    for (int l = 0; l < 3; l++)
        if (len != 0 && chiffres[len - 1] == 0)
            len--;
    bigint m = new bigint();
    m.bigint_sign = a.bigint_sign == b.bigint_sign;
    m.bigint_len = len;
    m.bigint_chiffres = chiffres;
    return m;
  }
  
  static bigint bigint_premiers_chiffres(bigint a, int i)
  {
    int len = Math.Min(i, a.bigint_len);
    while (len != 0 && a.bigint_chiffres[len - 1] == 0)
        len--;
    bigint o = new bigint();
    o.bigint_sign = a.bigint_sign;
    o.bigint_len = len;
    o.bigint_chiffres = a.bigint_chiffres;
    return o;
  }
  
  static bigint bigint_shift(bigint a, int i)
  {
    int[] chiffres = new int[a.bigint_len + i];
    for (int k = 0; k < a.bigint_len + i; k++)
        if (k >= i)
            chiffres[k] = a.bigint_chiffres[k - i];
        else
            chiffres[k] = 0;
    bigint p = new bigint();
    p.bigint_sign = a.bigint_sign;
    p.bigint_len = a.bigint_len + i;
    p.bigint_chiffres = chiffres;
    return p;
  }
  
  static bigint mul_bigint(bigint aa, bigint bb)
  {
    if (aa.bigint_len == 0)
        return aa;
    else if (bb.bigint_len == 0)
        return bb;
    else if (aa.bigint_len < 3 || bb.bigint_len < 3)
        return mul_bigint_cp(aa, bb);
    //  Algorithme de Karatsuba 
    int split = Math.Min(aa.bigint_len, bb.bigint_len) / 2;
    bigint a = bigint_shift(aa, -split);
    bigint b = bigint_premiers_chiffres(aa, split);
    bigint c = bigint_shift(bb, -split);
    bigint d = bigint_premiers_chiffres(bb, split);
    bigint amoinsb = sub_bigint(a, b);
    bigint cmoinsd = sub_bigint(c, d);
    bigint ac = mul_bigint(a, c);
    bigint bd = mul_bigint(b, d);
    bigint amoinsbcmoinsd = mul_bigint(amoinsb, cmoinsd);
    bigint acdec = bigint_shift(ac, 2 * split);
    return add_bigint(add_bigint(acdec, bd), bigint_shift(sub_bigint(add_bigint(ac, bd), amoinsbcmoinsd), split));
    //  ac × 102k + (ac + bd – (a – b)(c – d)) × 10k + bd 
  }
  
  /*
Division,
Modulo
*/
  static int log10(int a)
  {
    int out0 = 1;
    while (a >= 10)
    {
        a /= 10;
        out0++;
    }
    return out0;
  }
  
  static bigint bigint_of_int(int i)
  {
    int size = log10(i);
    if (i == 0)
        size = 0;
    int[] t = new int[size];
    for (int j = 0; j < size; j++)
        t[j] = 0;
    for (int k = 0; k < size; k++)
    {
        t[k] = i % 10;
        i /= 10;
    }
    bigint q = new bigint();
    q.bigint_sign = true;
    q.bigint_len = size;
    q.bigint_chiffres = t;
    return q;
  }
  
  static bigint fact_bigint(bigint a)
  {
    bigint one = bigint_of_int(1);
    bigint out0 = one;
    while (!bigint_eq(a, one))
    {
        out0 = mul_bigint(a, out0);
        a = sub_bigint(a, one);
    }
    return out0;
  }
  
  static int sum_chiffres_bigint(bigint a)
  {
    int out0 = 0;
    for (int i = 0; i < a.bigint_len; i++)
        out0 += a.bigint_chiffres[i];
    return out0;
  }
  
  //  http://projecteuler.net/problem=20 
  static int euler20()
  {
    bigint a = bigint_of_int(15);
    //  normalement c'est 100 
    a = fact_bigint(a);
    return sum_chiffres_bigint(a);
  }
  
  static bigint bigint_exp(bigint a, int b)
  {
    if (b == 1)
        return a;
    else if (b % 2 == 0)
        return bigint_exp(mul_bigint(a, a), b / 2);
    else
        return mul_bigint(a, bigint_exp(a, b - 1));
  }
  
  static bigint bigint_exp_10chiffres(bigint a, int b)
  {
    a = bigint_premiers_chiffres(a, 10);
    if (b == 1)
        return a;
    else if (b % 2 == 0)
        return bigint_exp_10chiffres(mul_bigint(a, a), b / 2);
    else
        return mul_bigint(a, bigint_exp_10chiffres(a, b - 1));
  }
  
  static void euler48()
  {
    bigint sum = bigint_of_int(0);
    for (int i = 1; i < 101; i++)
    {
        //  1000 normalement 
        bigint ib = bigint_of_int(i);
        bigint ibeib = bigint_exp_10chiffres(ib, i);
        sum = add_bigint(sum, ibeib);
        sum = bigint_premiers_chiffres(sum, 10);
    }
    Console.Write("euler 48 = ");
    print_bigint(sum);
    Console.Write("\n");
  }
  
  static int euler16()
  {
    bigint a = bigint_of_int(2);
    a = bigint_exp(a, 100);
    //  1000 normalement 
    return sum_chiffres_bigint(a);
  }
  
  static int euler25()
  {
    int i = 2;
    bigint a = bigint_of_int(1);
    bigint b = bigint_of_int(1);
    while (b.bigint_len < 100)
    {
        //  1000 normalement 
        bigint c = add_bigint(a, b);
        a = b;
        b = c;
        i++;
    }
    return i;
  }
  
  static int euler29()
  {
    int maxA = 5;
    int maxB = 5;
    bigint[] a_bigint = new bigint[maxA + 1];
    for (int j = 0; j <= maxA; j++)
        a_bigint[j] = bigint_of_int(j * j);
    bigint[] a0_bigint = new bigint[maxA + 1];
    for (int j2 = 0; j2 <= maxA; j2++)
        a0_bigint[j2] = bigint_of_int(j2);
    int[] b = new int[maxA + 1];
    for (int k = 0; k <= maxA; k++)
        b[k] = 2;
    int n = 0;
    bool found = true;
    while (found)
    {
        bigint min0 = a0_bigint[0];
        found = false;
        for (int i = 2; i <= maxA; i++)
            if (b[i] <= maxB)
                if (found)
                {
                    if (bigint_lt(a_bigint[i], min0))
                        min0 = a_bigint[i];
                }
                else
                {
                    min0 = a_bigint[i];
                    found = true;
                }
        if (found)
        {
            n++;
            for (int l = 2; l <= maxA; l++)
                if (bigint_eq(a_bigint[l], min0) && b[l] <= maxB)
                {
                    b[l]++;
                    a_bigint[l] = mul_bigint(a_bigint[l], a0_bigint[l]);
                }
        }
    }
    return n;
  }
  
  public static void Main(String[] args)
  {
    Console.Write(euler29() + "\n");
    bigint sum = read_bigint(50);
    for (int i = 2; i < 101; i++)
    {
        stdin_sep();
        bigint tmp = read_bigint(50);
        sum = add_bigint(sum, tmp);
    }
    Console.Write("euler13 = ");
    print_bigint(sum);
    Console.Write("\neuler25 = " + euler25() + "\neuler16 = " + euler16() + "\n");
    euler48();
    Console.Write("euler20 = " + euler20() + "\n");
    bigint a = bigint_of_int(999999);
    bigint b = bigint_of_int(9951263);
    print_bigint(a);
    Console.Write(">>1=");
    print_bigint(bigint_shift(a, -1));
    Console.Write("\n");
    print_bigint(a);
    Console.Write("*");
    print_bigint(b);
    Console.Write("=");
    print_bigint(mul_bigint(a, b));
    Console.Write("\n");
    print_bigint(a);
    Console.Write("*");
    print_bigint(b);
    Console.Write("=");
    print_bigint(mul_bigint_cp(a, b));
    Console.Write("\n");
    print_bigint(a);
    Console.Write("+");
    print_bigint(b);
    Console.Write("=");
    print_bigint(add_bigint(a, b));
    Console.Write("\n");
    print_bigint(b);
    Console.Write("-");
    print_bigint(a);
    Console.Write("=");
    print_bigint(sub_bigint(b, a));
    Console.Write("\n");
    print_bigint(a);
    Console.Write("-");
    print_bigint(b);
    Console.Write("=");
    print_bigint(sub_bigint(a, b));
    Console.Write("\n");
    print_bigint(a);
    Console.Write(">");
    print_bigint(b);
    Console.Write("=");
    if (bigint_gt(a, b))
        Console.Write("True");
    else
        Console.Write("False");
    Console.Write("\n");
  }
  
}



<|start_filename|>out/euler26.go<|end_filename|>
package main
import "fmt"
func periode(restes []int, len int, a int, b int) int{
  for a != 0 {
      chiffre := a / b
      _ = chiffre
      reste := a % b
      for i := 0; i < len; i++ {
          if restes[i] == reste {
              return len - i
          }
      }
      restes[len] = reste
      len++
      a = reste * 10
  }
  return 0
}
func main() {
  var t []int = make([]int, 1000)
  for j := 0; j < 1000; j++ {
      t[j] = 0
  }
  m := 0
  mi := 0
  for i := 1; i < 1001; i++ {
      p := periode(t, 0, 1, i)
      if p > m {
          mi = i
          m = p
      }
  }
  fmt.Printf("%d\n%d\n", mi, m)
}



<|start_filename|>out/aaa_06readcouple.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

  int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }


@Field Scanner scanner = new Scanner(System.in)
for (int i = 1; i < 4; i++)
{
    int[] c = read_int_line()
    int a = c[0]
    int b = c[1]
    System.out.printf("a = %d b = %d\n", a, b)
}
int[] l = read_int_line()
for (int j = 0; j < 10; j++)
    System.out.printf("%d\n", l[j])



<|start_filename|>out/euler27.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler27 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type c is Array (Integer range <>) of Integer;
type c_PTR is access c;
function eratostene(t : in c_PTR; max0 : in Integer) return Integer is
  n : Integer;
  j : Integer;
begin
  n := 0;
  for i in integer range 2..max0 - 1 loop
    if t(i) = i
    then
      n := n + 1;
      j := i * i;
      while j < max0 and then j > 0 loop
        t(j) := 0;
        j := j + i;
      end loop;
    end if;
  end loop;
  return n;
end;
function isPrime(d : in Integer; primes : in c_PTR; len : in Integer) return Boolean is
  n : Integer;
  i : Integer;
begin
  n := d;
  i := 0;
  if n < 0
  then
    n := (-n);
  end if;
  while primes(i) * primes(i) < n loop
    if n rem primes(i) = 0
    then
      return FALSE;
    end if;
    i := i + 1;
  end loop;
  return TRUE;
end;
function test(a : in Integer; b : in Integer; primes : in c_PTR; len : in Integer) return Integer is
  j : Integer;
begin
  for n in integer range 0..200 loop
    j := n * n + a * n + b;
    if not isPrime(j, primes, len)
    then
      return n;
    end if;
  end loop;
  return 200;
end;

  result : Integer;
  primes : c_PTR;
  nprimes : Integer;
  n2 : Integer;
  n1 : Integer;
  mb : Integer;
  maximumprimes : Integer;
  max0 : Integer;
  ma : Integer;
  l : Integer;
  era : c_PTR;
begin
  maximumprimes := 1000;
  era := new c (0..maximumprimes - 1);
  for j in integer range 0..maximumprimes - 1 loop
    era(j) := j;
  end loop;
  result := 0;
  max0 := 0;
  nprimes := eratostene(era, maximumprimes);
  primes := new c (0..nprimes - 1);
  for o in integer range 0..nprimes - 1 loop
    primes(o) := 0;
  end loop;
  l := 0;
  for k in integer range 2..maximumprimes - 1 loop
    if era(k) = k
    then
      primes(l) := k;
      l := l + 1;
    end if;
  end loop;
  PInt(l);
  PString(new char_array'( To_C(" == ")));
  PInt(nprimes);
  PString(new char_array'( To_C("" & Character'Val(10))));
  ma := 0;
  mb := 0;
  for b in integer range 3..999 loop
    if era(b) = b
    then
      for a in integer range (-999)..999 loop
        n1 := test(a, b, primes, nprimes);
        n2 := test(a, (-b), primes, nprimes);
        if n1 > max0
        then
          max0 := n1;
          result := a * b;
          ma := a;
          mb := b;
        end if;
        if n2 > max0
        then
          max0 := n2;
          result := (-a) * b;
          ma := a;
          mb := (-b);
        end if;
      end loop;
    end if;
  end loop;
  PInt(ma);
  PString(new char_array'( To_C(" ")));
  PInt(mb);
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(max0);
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(result);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler27.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
eratostene t max0 =
  let c i d =
        if i <= max0 - 1
        then ifM (((==) i) <$> (readIOA t i))
                 (do let e = d + 1
                     let j = i * i
                     let f g =
                           if g < max0 && g > 0
                           then do writeIOA t g 0
                                   let h = g + i
                                   f h
                           else c (i + 1) e in
                           f j)
                 (c (i + 1) d)
        else return d in
        c 2 0

isPrime n primes len =
  do let m = if n < 0
             then - n
             else n
     let p q =
           ifM (((>) m) <$> ((*) <$> (readIOA primes q) <*> (readIOA primes q)))
               (ifM (((==) 0) <$> ((rem m) <$> (readIOA primes q)))
                    (return False)
                    (do let r = q + 1
                        p r))
               (return True) in
           p 0

test a b primes len =
  let s n =
        if n <= 200
        then do let j = n * n + a * n + b
                ifM (fmap not (isPrime j primes len))
                    (return n)
                    (s (n + 1))
        else return 200 in
        s 0

main =
  do era <- array_init 1000 (\ j ->
                               return j)
     nprimes <- eratostene era 1000
     primes <- array_init nprimes (\ o ->
                                     return 0)
     let u k v =
           if k <= 1000 - 1
           then ifM (((==) k) <$> (readIOA era k))
                    (do writeIOA primes v k
                        let bn = v + 1
                        u (k + 1) bn)
                    (u (k + 1) v)
           else do printf "%d == %d\n" (v::Int) (nprimes::Int) :: IO()
                   let w b x y z ba =
                         if b <= 999
                         then ifM (((==) b) <$> (readIOA era b))
                                  (let bb a bc bd be bf =
                                          if a <= 999
                                          then do n1 <- test a b primes nprimes
                                                  n2 <- test a (- b) primes nprimes
                                                  (\ (bh, bi, bj, bk) ->
                                                    if n2 > bi
                                                    then do let bl = - a * b
                                                            let bm = - b
                                                            bb (a + 1) a n2 bm bl
                                                    else bb (a + 1) bh bi bj bk) (if n1 > bd
                                                                                  then let bg = a * b
                                                                                                in (a, n1, b, bg)
                                                                                  else (bc, bd, be, bf))
                                          else w (b + 1) bc bd be bf in
                                          bb (- 999) x y z ba)
                                  (w (b + 1) x y z ba)
                         else printf "%d %d\n%d\n%d\n" (x::Int) (z::Int) (y::Int) (ba::Int) :: IO() in
                         w 3 0 0 0 0 in
           u 2 0




<|start_filename|>out/summax_souslist.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function summax (lst, len)
  local current = 0
  local max0 = 0
  for i = 0, len - 1 do
      current = current + lst[i + 1]
      if current < 0 then
          current = 0
      end
      if max0 < current then
          max0 = current
      end
  end
  return max0
end

local len = 0
len = readint()
stdinsep()
local tab = {}
for i = 0, len - 1 do
    local tmp = 0
    tmp = readint()
    stdinsep()
    tab[i + 1] = tmp
end
local result = summax(tab, len)
io.write(result)


<|start_filename|>out/test_enum.cs<|end_filename|>
using System;

public class test_enum
{
  enum foo_t { 
    Foo,
     Bar,
     Blah}
  
  public static void Main(String[] args)
  {
    foo_t foo_val = foo_t.Foo;
  }
  
}



<|start_filename|>out/aaa_read1.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-char current-char next-char ;
: main
  HERE 12 cells allot { str }
  11 0 BEGIN 2dup >= WHILE DUP { a }
    read-char str  a cells +  !
   1 + REPEAT 2DROP
  skipspaces
  11 0 BEGIN 2dup >= WHILE DUP { i }
    str  i cells +  @ EMIT
   1 + REPEAT 2DROP
  ;
main
BYE



<|start_filename|>out/tictactoe.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

/* 
Tictactoe : un tictactoe avec une IA
 */

/*  La structure de donnée  */

typedef struct gamestate {
  int** cases;
    int firstToPlay;
    int note;
    int ended;
} gamestate;
/*  Un Mouvement  */

typedef struct move {
  int x;
    int y;
} move;
/*  On affiche l'état  */


void print_state(struct gamestate * g) {
    int y, x;
    printf("\n|");
    for (y = 0; y < 3; y++)
    {
        for (x = 0; x < 3; x++)
        {
            if (g->cases[x][y] == 0)
                printf(" ");
            else if (g->cases[x][y] == 1)
                printf("O");
            else
                printf("X");
            printf("|");
        }
        if (y != 2)
            printf("\n|-|-|-|\n|");
    }
    printf("\n");
}
/*  On dit qui gagne (info stoquées dans g.ended et g.note )  */


void eval0(struct gamestate * g) {
    int y, x;
    int win = 0;
    int freecase = 0;
    for (y = 0; y < 3; y++)
    {
        int col = -1;
        int lin = -1;
        for (x = 0; x < 3; x++)
        {
            if (g->cases[x][y] == 0)
                freecase++;
            int colv = g->cases[x][y];
            int linv = g->cases[y][x];
            if (col == -1 && colv != 0)
                col = colv;
            else if (colv != col)
                col = -2;
            if (lin == -1 && linv != 0)
                lin = linv;
            else if (linv != lin)
                lin = -2;
        }
        if (col >= 0)
            win = col;
        else if (lin >= 0)
            win = lin;
    }
    for (x = 1; x < 3; x++)
    {
        if (g->cases[0][0] == x && g->cases[1][1] == x && g->cases[2][2] == x)
            win = x;
        if (g->cases[0][2] == x && g->cases[1][1] == x && g->cases[2][0] == x)
            win = x;
    }
    g->ended = win != 0 || freecase == 0;
    if (win == 1)
        g->note = 1000;
    else if (win == 2)
        g->note = -1000;
    else
        g->note = 0;
}
/*  On applique un mouvement  */


void apply_move_xy(int x, int y, struct gamestate * g) {
    int player = 2;
    if (g->firstToPlay)
        player = 1;
    g->cases[x][y] = player;
    g->firstToPlay = !g->firstToPlay;
}

void apply_move(struct move * m, struct gamestate * g) {
    apply_move_xy(m->x, m->y, g);
}

void cancel_move_xy(int x, int y, struct gamestate * g) {
    g->cases[x][y] = 0;
    g->firstToPlay = !g->firstToPlay;
    g->ended = 0;
}

void cancel_move(struct move * m, struct gamestate * g) {
    cancel_move_xy(m->x, m->y, g);
}

int can_move_xy(int x, int y, struct gamestate * g) {
    return g->cases[x][y] == 0;
}

int can_move(struct move * m, struct gamestate * g) {
    return can_move_xy(m->x, m->y, g);
}
/* 
Un minimax classique, renvoie la note du plateau
 */


int minmax(struct gamestate * g) {
    int x, y;
    eval0(g);
    if (g->ended)
        return g->note;
    int maxNote = -10000;
    if (!g->firstToPlay)
        maxNote = 10000;
    for (x = 0; x < 3; x++)
        for (y = 0; y < 3; y++)
            if (can_move_xy(x, y, g))
            {
                apply_move_xy(x, y, g);
                int currentNote = minmax(g);
                cancel_move_xy(x, y, g);
                /* Minimum ou Maximum selon le coté ou l'on joue*/
                if (currentNote > maxNote == g->firstToPlay)
                    maxNote = currentNote;
            }
    return maxNote;
}
/* 
Renvoie le coup de l'IA
 */


struct move * play(struct gamestate * g) {
    int x, y;
    struct move * minMove = malloc(sizeof(move));
    minMove->x = 0;
    minMove->y = 0;
    int minNote = 10000;
    for (x = 0; x < 3; x++)
        for (y = 0; y < 3; y++)
            if (can_move_xy(x, y, g))
            {
                apply_move_xy(x, y, g);
                int currentNote = minmax(g);
                printf("%d, %d, %d\n", x, y, currentNote);
                cancel_move_xy(x, y, g);
                if (currentNote < minNote)
                {
                    minNote = currentNote;
                    minMove->x = x;
                    minMove->y = y;
                }
            }
    printf("%d%d\n", minMove->x, minMove->y);
    return minMove;
}

struct gamestate * init0() {
    int i, j;
    int* *cases = calloc(3, sizeof(int*));
    for (i = 0; i < 3; i++)
    {
        int *tab = calloc(3, sizeof(int));
        for (j = 0; j < 3; j++)
            tab[j] = 0;
        cases[i] = tab;
    }
    struct gamestate * a = malloc(sizeof(gamestate));
    a->cases = cases;
    a->firstToPlay = 1;
    a->note = 0;
    a->ended = 0;
    return a;
}

struct move * read_move() {
    int y, x;
    scanf("%d %d ", &x, &y);
    struct move * b = malloc(sizeof(move));
    b->x = x;
    b->y = y;
    return b;
}
int main(void) {
    int i;
    for (i = 0; i < 2; i++)
    {
        struct gamestate * state = init0();
        struct move * c = malloc(sizeof(move));
        c->x = 1;
        c->y = 1;
        apply_move(c, state);
        struct move * d = malloc(sizeof(move));
        d->x = 0;
        d->y = 0;
        apply_move(d, state);
        while (!state->ended)
        {
            print_state(state);
            apply_move(play(state), state);
            eval0(state);
            print_state(state);
            if (!state->ended)
            {
                apply_move(play(state), state);
                eval0(state);
            }
        }
        print_state(state);
        printf("%d\n", state->note);
    }
    return 0;
}




<|start_filename|>out/testing_count.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure testing_count is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

type a is Array (Integer range <>) of Integer;
type a_PTR is access a;

  tab : a_PTR;
begin
  tab := new a (0..39);
  for i in integer range 0..39 loop
    tab(i) := i * i;
  end loop;
  PInt(tab'Length);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/affect_param.lua<|end_filename|>
function foo (a)
  a = 4
end

local a = 0
foo(a)
io.write(string.format("%d\n", a))


<|start_filename|>out/loop_unroll.cpp<|end_filename|>
#include <iostream>
#include <vector>
/*
Ce test permet de vérifier le comportement des macros
Il effectue du loop unrolling
*/
int main() {
    int j = 0;
    j = 0;
    std::cout << j << "\n";
    j = 1;
    std::cout << j << "\n";
    j = 2;
    std::cout << j << "\n";
    j = 3;
    std::cout << j << "\n";
    j = 4;
    std::cout << j << "\n";
}



<|start_filename|>out/carre.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func min2_(a int, b int) int{
  if a < b {
      return a
  } else {
      return b
  }
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var y int
  var x int
  fmt.Fscanf(reader, "%d", &x)
  skip()
  fmt.Fscanf(reader, "%d", &y)
  skip()
  var tab [][]int = make([][]int, y)
  for d := 0; d < y; d++ {
      var e []int = make([]int, x)
      for f := 0; f < x; f++ {
          fmt.Fscanf(reader, "%d", &e[f])
          skip()
      }
      tab[d] = e
  }
  for ix := 1; ix < x; ix++ {
      for iy := 1; iy < y; iy++ {
          if tab[iy][ix] == 1 {
              tab[iy][ix] = min2_(min2_(tab[iy][ix - 1], tab[iy - 1][ix]), tab[iy - 1][ix - 1]) + 1
          }
      }
  }
  for jy := 0; jy < y; jy++ {
      for jx := 0; jx < x; jx++ {
          fmt.Printf("%d ", tab[jy][jx])
      }
      fmt.Printf("\n")
  }
}



<|start_filename|>out/euler12.java<|end_filename|>
import java.util.*;

public class euler12
{
  
  static int eratostene(int[] t, int max0)
  {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            int j = i * i;
            n++;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
  }
  static int fillPrimesFactors(int[] t, int n, int[] primes, int nprimes)
  {
    for (int i = 0; i < nprimes; i++)
    {
        int d = primes[i];
        while (n % d == 0)
        {
            t[d]++;
            n /= d;
        }
        if (n == 1)
            return primes[i];
    }
    return n;
  }
  static int find(int ndiv2)
  {
    int maximumprimes = 110;
    int[] era = new int[maximumprimes];
    for (int j = 0; j < maximumprimes; j++)
        era[j] = j;
    int nprimes = eratostene(era, maximumprimes);
    int[] primes = new int[nprimes];
    for (int o = 0; o < nprimes; o++)
        primes[o] = 0;
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    for (int n = 1; n < 10001; n++)
    {
        int[] primesFactors = new int[n + 2];
        for (int m = 0; m <= n + 1; m++)
            primesFactors[m] = 0;
        int max0 = Math.max(fillPrimesFactors(primesFactors, n, primes, nprimes), fillPrimesFactors(primesFactors, n + 1, primes, nprimes));
        primesFactors[2]--;
        int ndivs = 1;
        for (int i = 0; i <= max0; i++)
            if (primesFactors[i] != 0)
                ndivs *= 1 + primesFactors[i];
        if (ndivs > ndiv2)
            return n * (n + 1) / 2;
        //  print "n=" print n print "\t" print (n * (n + 1) / 2 ) print " " print ndivs print "\n" 
    }
    return 0;
  }
  public static void main(String args[])
  {
    System.out.printf("%d\n", find(500));
  }
  
}



<|start_filename|>out/countchar.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end
function readchar()
    if buffer == "" then buffer = io.read("*line") end
    local c = string.byte(buffer)
    buffer = string.sub(buffer, 2, -1)
    return c
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function nth (tab, tofind, len)
  local out0 = 0
  for i = 0, len - 1 do
      if tab[i + 1] == tofind then
          out0 = out0 + 1
      end
  end
  return out0
end

local len = 0
len = readint()
stdinsep()
local tofind = 0
tofind = readchar()
stdinsep()
local tab = {}
for i = 0, len - 1 do
    local tmp = 0
    tmp = readchar()
    tab[i + 1] = tmp
end
local result = nth(tab, tofind, len)
io.write(result)


<|start_filename|>out/euler30.js<|end_filename|>
var util = require("util");

/*
a + b * 10 + c * 100 + d * 1000 + e * 10 000 =
  a ^ 5 +
  b ^ 5 +
  c ^ 5 +
  d ^ 5 +
  e ^ 5
*/
var p = new Array(10);
for (var i = 0; i < 10; i++)
    p[i] = i * i * i * i * i;
var sum = 0;
for (var a = 0; a < 10; a++)
    for (var b = 0; b < 10; b++)
        for (var c = 0; c < 10; c++)
            for (var d = 0; d < 10; d++)
                for (var e = 0; e < 10; e++)
                    for (var f = 0; f < 10; f++)
                    {
                        var s = p[a] + p[b] + p[c] + p[d] + p[e] + p[f];
                        var r = a + b * 10 + c * 100 + d * 1000 + e * 10000 + f * 100000;
                        if (s == r && r != 1)
                        {
                            util.print(f, e, d, c, b, a, " ", r, "\n");
                            sum += r;
                        }
                    }
util.print(sum);



<|start_filename|>out/record2.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

class Toto {
  int foo
  int bar
  int blah
}
Toto mktoto(int v1)
{
  Toto t = new Toto()
  t.foo = v1
  t.bar = 0
  t.blah = 0
  return t
}
int result(Toto t)
{
  t.blah++
  return t.foo + t.blah * t.bar + t.bar * t.foo
}
@Field Scanner scanner = new Scanner(System.in)
Toto t = mktoto(4)
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  t.bar = -scanner.nextInt()
}else{
  t.bar = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  t.blah = -scanner.nextInt()
}else{
  t.blah = scanner.nextInt()
}
print(result(t))



<|start_filename|>out/rot13.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

/* 
Ce test effectue un rot13 sur une chaine lue en entrée
 */

int main(void) {
    int j, toto, strlen;
    char tmpc;
    scanf("%d ", &strlen);
    char *tab4 = calloc(strlen, sizeof(char));
    for (toto = 0; toto < strlen; toto++)
    {
        scanf("%c", &tmpc);
        int c = (int)(tmpc);
        if (tmpc != ' ')
            c = (c - (int)('a') + 13) % 26 + (int)('a');
        tab4[toto] = (char)(c);
    }
    for (j = 0; j < strlen; j++)
        printf("%c", tab4[j]);
    return 0;
}




<|start_filename|>out/euler07.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int divisible(int n, int* t, int size) {
    int i;
    for (i = 0; i < size; i++)
        if (n % t[i] == 0)
            return 1;
    return 0;
}

int find(int n, int* t, int used, int nth) {
    while (used != nth)
        if (divisible(n, t, used))
            n++;
        else
        {
            t[used] = n;
            n++;
            used++;
        }
    return t[used - 1];
}
int main(void) {
    int i;
    int n = 10001;
    int *t = calloc(n, sizeof(int));
    for (i = 0; i < n; i++)
        t[i] = 2;
    printf("%d\n", find(3, t, 1, n));
    return 0;
}




<|start_filename|>out/euler07.groovy<|end_filename|>
import java.util.*

boolean divisible(int n, int[] t, int size)
{
  for (int i = 0; i < size; i++)
      if (n % t[i] == 0)
          return true
  return false
}
int find(int n, int[] t, int used, int nth)
{
  while (used != nth)
      if (divisible(n, t, used))
          n++
      else
      {
          t[used] = n
          n++
          used++
      }
  return t[used - 1]
}

int n = 10001
int[] t = new int[n]
for (int i = 0; i < n; i++)
    t[i] = 2
System.out.printf("%d\n", find(3, t, 1, n))



<|start_filename|>out/devine.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

boolean devine0(int nombre, int[] tab, int len)
{
  int min0 = tab[0]
  int max0 = tab[1]
  for (int i = 2; i < len; i++)
  {
      if (tab[i] > max0 || tab[i] < min0)
          return false
      if (tab[i] < nombre)
          min0 = tab[i]
      if (tab[i] > nombre)
          max0 = tab[i]
      if (tab[i] == nombre && len != i + 1)
          return false
  }
  return true
}
@Field Scanner scanner = new Scanner(System.in)
int nombre
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  nombre = scanner.nextInt()
} else {
  nombre = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
int len
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  len = scanner.nextInt()
} else {
  len = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
int[] tab = new int[len]
for (int i = 0; i < len; i++)
{
    int tmp
    if (scanner.hasNext("^-")) {
      scanner.next("^-")
      tmp = scanner.nextInt()
    } else {
      tmp = scanner.nextInt()
    }
    scanner.findWithinHorizon("[\n\r ]*", 1)
    tab[i] = tmp
}
if (devine0(nombre, tab, len))
    print("True")
else
    print("False")



<|start_filename|>out/bigints.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func max2_(a int, b int) int{
  if a > b {
      return a
  } else {
      return b
  }
}
func min2_(a int, b int) int{
  if a < b {
      return a
  } else {
      return b
  }
}

type bigint struct {
  bigint_sign bool;
  bigint_len int;
  bigint_chiffres []int;
}
func read_bigint(len int) * bigint{
  var chiffres []int = make([]int, len)
  for j := 0; j < len; j++ {
      var c byte
      fmt.Fscanf(reader, "%c", &c)
      chiffres[j] = (int)(c)
  }
  for i := 0; i <= (len - 1) / 2; i++ {
      tmp := chiffres[i]
      chiffres[i] = chiffres[len - 1 - i]
      chiffres[len - 1 - i] = tmp
  }
  var e * bigint = new (bigint)
      (*e).bigint_sign=true
      (*e).bigint_len=len
      (*e).bigint_chiffres=chiffres
  return e
}
func print_bigint(a * bigint) {
  if !(*a).bigint_sign {
      fmt.Printf("%c", '-')
  }
  for i := 0; i < (*a).bigint_len; i++ {
      fmt.Printf("%d", (*a).bigint_chiffres[(*a).bigint_len - 1 - i])
  }
}
func bigint_eq(a * bigint, b * bigint) bool{
  /* Renvoie vrai si a = b */
  if (*a).bigint_sign != (*b).bigint_sign {
      return false
  } else if (*a).bigint_len != (*b).bigint_len {
      return false
  } else {
      for i := 0; i < (*a).bigint_len; i++ {
          if (*a).bigint_chiffres[i] != (*b).bigint_chiffres[i] {
              return false
          }
      }
      return true
  }
}
func bigint_gt(a * bigint, b * bigint) bool{
  /* Renvoie vrai si a > b */
  if (*a).bigint_sign && !(*b).bigint_sign {
      return true
  } else if !(*a).bigint_sign && (*b).bigint_sign {
      return false
  } else {
      if (*a).bigint_len > (*b).bigint_len {
          return (*a).bigint_sign
      } else if (*a).bigint_len < (*b).bigint_len {
          return !(*a).bigint_sign
      } else {
          for i := 0; i < (*a).bigint_len; i++ {
              j := (*a).bigint_len - 1 - i
              if (*a).bigint_chiffres[j] > (*b).bigint_chiffres[j] {
                  return (*a).bigint_sign
              } else if (*a).bigint_chiffres[j] < (*b).bigint_chiffres[j] {
                  return !(*a).bigint_sign
              }
          }
      }
      return true
  }
}
func bigint_lt(a * bigint, b * bigint) bool{
  return !bigint_gt(a, b)
}
func add_bigint_positif(a * bigint, b * bigint) * bigint{
  /* Une addition ou on en a rien a faire des signes */
  len := max2_((*a).bigint_len, (*b).bigint_len) + 1
  retenue := 0
  var chiffres []int = make([]int, len)
  for i := 0; i < len; i++ {
      tmp := retenue
      if i < (*a).bigint_len {
          tmp += (*a).bigint_chiffres[i]
      }
      if i < (*b).bigint_len {
          tmp += (*b).bigint_chiffres[i]
      }
      retenue = tmp / 10
      chiffres[i] = tmp % 10
  }
  for len > 0 && chiffres[len - 1] == 0 {
      len--
  }
  var f * bigint = new (bigint)
      (*f).bigint_sign=true
      (*f).bigint_len=len
      (*f).bigint_chiffres=chiffres
  return f
}
func sub_bigint_positif(a * bigint, b * bigint) * bigint{
  /* Une soustraction ou on en a rien a faire des signes
Pré-requis : a > b
*/
  len := (*a).bigint_len
  retenue := 0
  var chiffres []int = make([]int, len)
  for i := 0; i < len; i++ {
      tmp := retenue + (*a).bigint_chiffres[i]
      if i < (*b).bigint_len {
          tmp -= (*b).bigint_chiffres[i]
      }
      if tmp < 0 {
          tmp += 10
          retenue = -1
      } else {
          retenue = 0
      }
      chiffres[i] = tmp
  }
  for len > 0 && chiffres[len - 1] == 0 {
      len--
  }
  var g * bigint = new (bigint)
      (*g).bigint_sign=true
      (*g).bigint_len=len
      (*g).bigint_chiffres=chiffres
  return g
}
func neg_bigint(a * bigint) * bigint{
  var h * bigint = new (bigint)
      (*h).bigint_sign=!(*a).bigint_sign
      (*h).bigint_len=(*a).bigint_len
      (*h).bigint_chiffres=(*a).bigint_chiffres
  return h
}
func add_bigint(a * bigint, b * bigint) * bigint{
  if (*a).bigint_sign == (*b).bigint_sign {
      if (*a).bigint_sign {
          return add_bigint_positif(a, b)
      } else {
          return neg_bigint(add_bigint_positif(a, b))
      }
  } else if (*a).bigint_sign {
      /* a positif, b negatif */
      if bigint_gt(a, neg_bigint(b)) {
          return sub_bigint_positif(a, b)
      } else {
          return neg_bigint(sub_bigint_positif(b, a))
      }
  } else {
      /* a negatif, b positif */
      if bigint_gt(neg_bigint(a), b) {
          return neg_bigint(sub_bigint_positif(a, b))
      } else {
          return sub_bigint_positif(b, a)
      }
  }
}
func sub_bigint(a * bigint, b * bigint) * bigint{
  return add_bigint(a, neg_bigint(b))
}
func mul_bigint_cp(a * bigint, b * bigint) * bigint{
  /* Cet algorithm est quadratique.
C'est le même que celui qu'on enseigne aux enfants en CP.
D'ou le nom de la fonction. */
  len := (*a).bigint_len + (*b).bigint_len + 1
  var chiffres []int = make([]int, len)
  for k := 0; k < len; k++ {
      chiffres[k] = 0
  }
  for i := 0; i < (*a).bigint_len; i++ {
      retenue := 0
      for j := 0; j < (*b).bigint_len; j++ {
          chiffres[i + j] += retenue + (*b).bigint_chiffres[j] * (*a).bigint_chiffres[i]
          retenue = chiffres[i + j] / 10
          chiffres[i + j] = chiffres[i + j] % 10
      }
      chiffres[i + (*b).bigint_len] += retenue
  }
  chiffres[(*a).bigint_len + (*b).bigint_len] = chiffres[(*a).bigint_len + (*b).bigint_len - 1] / 10
  chiffres[(*a).bigint_len + (*b).bigint_len - 1] = chiffres[(*a).bigint_len + (*b).bigint_len - 1] % 10
  for l := 0; l < 3; l++ {
      if len != 0 && chiffres[len - 1] == 0 {
          len--
      }
  }
  var m * bigint = new (bigint)
      (*m).bigint_sign=(*a).bigint_sign == (*b).bigint_sign
      (*m).bigint_len=len
      (*m).bigint_chiffres=chiffres
  return m
}
func bigint_premiers_chiffres(a * bigint, i int) * bigint{
  len := min2_(i, (*a).bigint_len)
  for len != 0 && (*a).bigint_chiffres[len - 1] == 0 {
      len--
  }
  var o * bigint = new (bigint)
      (*o).bigint_sign=(*a).bigint_sign
      (*o).bigint_len=len
      (*o).bigint_chiffres=(*a).bigint_chiffres
  return o
}
func bigint_shift(a * bigint, i int) * bigint{
  var chiffres []int = make([]int, (*a).bigint_len + i)
  for k := 0; k < (*a).bigint_len + i; k++ {
      if k >= i {
          chiffres[k] = (*a).bigint_chiffres[k - i]
      } else {
          chiffres[k] = 0
      }
  }
  var p * bigint = new (bigint)
      (*p).bigint_sign=(*a).bigint_sign
      (*p).bigint_len=(*a).bigint_len + i
      (*p).bigint_chiffres=chiffres
  return p
}
func mul_bigint(aa * bigint, bb * bigint) * bigint{
  if (*aa).bigint_len == 0 {
      return aa
  } else if (*bb).bigint_len == 0 {
      return bb
  } else if (*aa).bigint_len < 3 || (*bb).bigint_len < 3 {
      return mul_bigint_cp(aa, bb)
  }
  /* Algorithme de Karatsuba */
  split := min2_((*aa).bigint_len, (*bb).bigint_len) / 2
  var a * bigint = bigint_shift(aa, -split)
  var b * bigint = bigint_premiers_chiffres(aa, split)
  var c * bigint = bigint_shift(bb, -split)
  var d * bigint = bigint_premiers_chiffres(bb, split)
  var amoinsb * bigint = sub_bigint(a, b)
  var cmoinsd * bigint = sub_bigint(c, d)
  var ac * bigint = mul_bigint(a, c)
  var bd * bigint = mul_bigint(b, d)
  var amoinsbcmoinsd * bigint = mul_bigint(amoinsb, cmoinsd)
  var acdec * bigint = bigint_shift(ac, 2 * split)
  return add_bigint(add_bigint(acdec, bd), bigint_shift(sub_bigint(add_bigint(ac, bd), amoinsbcmoinsd), split))
  /* ac × 102k + (ac + bd – (a – b)(c – d)) × 10k + bd */
}
/*
Division,
Modulo
*/
func log10(a int) int{
  out0 := 1
  for a >= 10 {
      a /= 10
      out0++
  }
  return out0
}
func bigint_of_int(i int) * bigint{
  size := log10(i)
  if i == 0 {
      size = 0
  }
  var t []int = make([]int, size)
  for j := 0; j < size; j++ {
      t[j] = 0
  }
  for k := 0; k < size; k++ {
      t[k] = i % 10
      i /= 10
  }
  var q * bigint = new (bigint)
      (*q).bigint_sign=true
      (*q).bigint_len=size
      (*q).bigint_chiffres=t
  return q
}
func fact_bigint(a * bigint) * bigint{
  var one * bigint = bigint_of_int(1)
  var out0 * bigint = one
  for !bigint_eq(a, one) {
      out0 = mul_bigint(a, out0)
      a = sub_bigint(a, one)
  }
  return out0
}
func sum_chiffres_bigint(a * bigint) int{
  out0 := 0
  for i := 0; i < (*a).bigint_len; i++ {
      out0 += (*a).bigint_chiffres[i]
  }
  return out0
}
//  http://projecteuler.net/problem=20 
func euler20() int{
  var a * bigint = bigint_of_int(15)
  /* normalement c'est 100 */
  a = fact_bigint(a)
  return sum_chiffres_bigint(a)
}
func bigint_exp(a * bigint, b int) * bigint{
  if b == 1 {
      return a
  } else if b % 2 == 0 {
      return bigint_exp(mul_bigint(a, a), b / 2)
  } else {
      return mul_bigint(a, bigint_exp(a, b - 1))
  }
}
func bigint_exp_10chiffres(a * bigint, b int) * bigint{
  a = bigint_premiers_chiffres(a, 10)
  if b == 1 {
      return a
  } else if b % 2 == 0 {
      return bigint_exp_10chiffres(mul_bigint(a, a), b / 2)
  } else {
      return mul_bigint(a, bigint_exp_10chiffres(a, b - 1))
  }
}
func euler48() {
  var sum * bigint = bigint_of_int(0)
  for i := 1; i < 101; i++ {
      /* 1000 normalement */
      var ib * bigint = bigint_of_int(i)
      var ibeib * bigint = bigint_exp_10chiffres(ib, i)
      sum = add_bigint(sum, ibeib)
      sum = bigint_premiers_chiffres(sum, 10)
  }
  fmt.Printf("euler 48 = ")
  print_bigint(sum)
  fmt.Printf("\n")
}
func euler16() int{
  var a * bigint = bigint_of_int(2)
  a = bigint_exp(a, 100)
  /* 1000 normalement */
  return sum_chiffres_bigint(a)
}
func euler25() int{
  i := 2
  var a * bigint = bigint_of_int(1)
  var b * bigint = bigint_of_int(1)
  for (*b).bigint_len < 100 {
      /* 1000 normalement */
      var c * bigint = add_bigint(a, b)
      a = b
      b = c
      i++
  }
  return i
}
func euler29() int{
  maxA := 5
  maxB := 5
  var a_bigint []* bigint = make([]* bigint, maxA + 1)
  for j := 0; j <= maxA; j++ {
      a_bigint[j] = bigint_of_int(j * j)
  }
  var a0_bigint []* bigint = make([]* bigint, maxA + 1)
  for j2 := 0; j2 <= maxA; j2++ {
      a0_bigint[j2] = bigint_of_int(j2)
  }
  var b []int = make([]int, maxA + 1)
  for k := 0; k <= maxA; k++ {
      b[k] = 2
  }
  n := 0
  var found bool = true
  for found {
      var min0 * bigint = a0_bigint[0]
      found = false
      for i := 2; i <= maxA; i++ {
          if b[i] <= maxB {
              if found {
                  if bigint_lt(a_bigint[i], min0) {
                      min0 = a_bigint[i]
                  }
              } else {
                  min0 = a_bigint[i]
                  found = true
              }
          }
      }
      if found {
          n++
          for l := 2; l <= maxA; l++ {
              if bigint_eq(a_bigint[l], min0) && b[l] <= maxB {
                  b[l]++
                  a_bigint[l] = mul_bigint(a_bigint[l], a0_bigint[l])
              }
          }
      }
  }
  return n
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  fmt.Printf("%d\n", euler29())
  var sum * bigint = read_bigint(50)
  for i := 2; i < 101; i++ {
      skip()
      var tmp * bigint = read_bigint(50)
      sum = add_bigint(sum, tmp)
  }
  fmt.Printf("euler13 = ")
  print_bigint(sum)
  fmt.Printf("\neuler25 = %d\neuler16 = %d\n", euler25(), euler16())
  euler48()
  fmt.Printf("euler20 = %d\n", euler20())
  var a * bigint = bigint_of_int(999999)
  var b * bigint = bigint_of_int(9951263)
  print_bigint(a)
  fmt.Printf(">>1=")
  print_bigint(bigint_shift(a, -1))
  fmt.Printf("\n")
  print_bigint(a)
  fmt.Printf("*")
  print_bigint(b)
  fmt.Printf("=")
  print_bigint(mul_bigint(a, b))
  fmt.Printf("\n")
  print_bigint(a)
  fmt.Printf("*")
  print_bigint(b)
  fmt.Printf("=")
  print_bigint(mul_bigint_cp(a, b))
  fmt.Printf("\n")
  print_bigint(a)
  fmt.Printf("+")
  print_bigint(b)
  fmt.Printf("=")
  print_bigint(add_bigint(a, b))
  fmt.Printf("\n")
  print_bigint(b)
  fmt.Printf("-")
  print_bigint(a)
  fmt.Printf("=")
  print_bigint(sub_bigint(b, a))
  fmt.Printf("\n")
  print_bigint(a)
  fmt.Printf("-")
  print_bigint(b)
  fmt.Printf("=")
  print_bigint(sub_bigint(a, b))
  fmt.Printf("\n")
  print_bigint(a)
  fmt.Printf(">")
  print_bigint(b)
  fmt.Printf("=")
  if bigint_gt(a, b) {
      fmt.Printf("True")
  } else {
      fmt.Printf("False")
  }
  fmt.Printf("\n")
}



<|start_filename|>out/summax_souslist.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func summax(lst []int, len int) int{
  current := 0
  max0 := 0
  for i := 0; i < len; i++ {
      current += lst[i]
      if current < 0 {
          current = 0
      }
      if max0 < current {
          max0 = current
      }
  }
  return max0
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  len := 0
  fmt.Fscanf(reader, "%d", &len)
  skip()
  var tab []int = make([]int, len)
  for i := 0; i < len; i++ {
      tmp := 0
      fmt.Fscanf(reader, "%d", &tmp)
      skip()
      tab[i] = tmp
  }
  result := summax(tab, len)
  fmt.Printf("%d", result)
}



<|start_filename|>out/affect_param.java<|end_filename|>
import java.util.*;

public class affect_param
{
  
  static void foo(int a)
  {
    a = 4;
  }
  public static void main(String args[])
  {
    int a = 0;
    foo(a);
    System.out.printf("%d\n", a);
  }
  
}



<|start_filename|>out/euler45.java<|end_filename|>
import java.util.*;

public class euler45
{
  
  static int triangle(int n)
  {
    if (n % 2 == 0)
        return (n / 2) * (n + 1);
    else
        return n * ((n + 1) / 2);
  }
  static int penta(int n)
  {
    if (n % 2 == 0)
        return (n / 2) * (3 * n - 1);
    else
        return ((3 * n - 1) / 2) * n;
  }
  static int hexa(int n)
  {
    return n * (2 * n - 1);
  }
  static boolean findPenta2(int n, int a, int b)
  {
    if (b == a + 1)
        return penta(a) == n || penta(b) == n;
    int c = (a + b) / 2;
    int p = penta(c);
    if (p == n)
        return true;
    else if (p < n)
        return findPenta2(n, c, b);
    else
        return findPenta2(n, a, c);
  }
  static boolean findHexa2(int n, int a, int b)
  {
    if (b == a + 1)
        return hexa(a) == n || hexa(b) == n;
    int c = (a + b) / 2;
    int p = hexa(c);
    if (p == n)
        return true;
    else if (p < n)
        return findHexa2(n, c, b);
    else
        return findHexa2(n, a, c);
  }
  public static void main(String args[])
  {
    for (int n = 285; n < 55386; n++)
    {
        int t = triangle(n);
        if (findPenta2(t, n / 5, n) && findHexa2(t, n / 5, n / 2 + 10))
            System.out.printf("%d\n%d\n", n, t);
    }
  }
  
}



<|start_filename|>out/carre.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

var x = read_int_();
stdinsep();
var y = read_int_();
stdinsep();
var tab = new Array(y);
for (var d = 0; d < y; d++)
{
    var e = new Array(x);
    for (var f = 0; f < x; f++)
    {
        e[f] = read_int_();
        stdinsep();
    }
    tab[d] = e;
}
for (var ix = 1; ix < x; ix++)
    for (var iy = 1; iy < y; iy++)
        if (tab[iy][ix] == 1)
            tab[iy][ix] = Math.min(tab[iy][ix - 1], tab[iy - 1][ix], tab[iy - 1][ix - 1]) + 1;
for (var jy = 0; jy < y; jy++)
{
    for (var jx = 0; jx < x; jx++)
        util.print(tab[jy][jx], " ");
    util.print("\n");
}



<|start_filename|>out/dichoexp.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int exp0(int a, int b) {
    if (b == 0)
        return 1;
    if (b % 2 == 0)
    {
        int o = exp0(a, b / 2);
        return o * o;
    }
    else
        return a * exp0(a, b - 1);
}
int main(void) {
    int a = 0;
    int b = 0;
    scanf("%d %d", &a, &b);
    printf("%d", exp0(a, b));
    return 0;
}




<|start_filename|>out/euler46.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
eratostene t max0 =
  let a i b =
        if i <= max0 - 1
        then ifM (((==) i) <$> (readIOA t i))
                 (do let c = b + 1
                     if (max0 `quot` i) > i
                     then do let j = i * i
                             let d e =
                                   if e < max0 && e > 0
                                   then do writeIOA t e 0
                                           let f = e + i
                                           d f
                                   else a (i + 1) c in
                                   d j
                     else a (i + 1) c)
                 (a (i + 1) b)
        else return b in
        a 2 0

main =
  do era <- array_init 6000 (\ j_ ->
                               return j_)
     nprimes <- eratostene era 6000
     primes <- array_init nprimes (\ o ->
                                     return 0)
     let g k h =
           if k <= 6000 - 1
           then ifM (((==) k) <$> (readIOA era k))
                    (do writeIOA primes h k
                        let s = h + 1
                        g (k + 1) s)
                    (g (k + 1) h)
           else do printf "%d == %d\n" (h::Int) (nprimes::Int) :: IO()
                   canbe <- array_init 6000 (\ i_ ->
                                               return False)
                   let p i =
                         if i <= nprimes - 1
                         then let r j =
                                    if j <= 6000 - 1
                                    then do n <- (((+) (2 * j * j)) <$> (readIOA primes i))
                                            if n < 6000
                                            then do writeIOA canbe n True
                                                    r (j + 1)
                                            else r (j + 1)
                                    else p (i + 1) in
                                    r 0
                         else let q m =
                                    if m <= 6000
                                    then do let m2 = m * 2 + 1
                                            ifM ((return (m2 < 6000)) <&&> (fmap not (readIOA canbe m2)))
                                                (do printf "%d\n" (m2::Int) :: IO()
                                                    q (m + 1))
                                                (q (m + 1))
                                    else return () in
                                    q 1 in
                         p 0 in
           g 2 0




<|start_filename|>out/aaa_08tuple.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class aaa_08tuple
{
  public class tuple_int_int {
    public int tuple_int_int_field_0;
    public int tuple_int_int_field_1;
  }
  public class toto {
    public tuple_int_int foo;
    public int bar;
  }
  public static void Main(String[] args)
  {
    int bar_ = int.Parse(Console.ReadLine());
    int[] c = new List<string>(Console.ReadLine().Split(" ".ToCharArray())).ConvertAll(int.Parse).ToArray();
    tuple_int_int d = new tuple_int_int();
    d.tuple_int_int_field_0 = c[0];
    d.tuple_int_int_field_1 = c[1];
    toto t = new toto();
    t.foo = d;
    t.bar = bar_;
    tuple_int_int e = t.foo;
    int a = e.tuple_int_int_field_0;
    int b = e.tuple_int_int_field_1;
    Console.Write(a + " " + b + " " + t.bar + "\n");
  }
  
}



<|start_filename|>out/aaa_02if.fs<|end_filename|>
: f { i }
  i 0 =
  IF
    true exit
  THEN
  false exit
;

: main
  4 f
  IF
    S\" true <-\n ->\n" TYPE
  ELSE
    S\" false <-\n ->\n" TYPE
  THEN
  S\" small test end\n" TYPE
  ;
main
BYE



<|start_filename|>out/pathfinding0.java<|end_filename|>
import java.util.*;

public class pathfinding0
{
  static Scanner scanner = new Scanner(System.in);
  static int pathfind_aux(int[][] cache, char[][] tab, int x, int y, int posX, int posY)
  {
    if (posX == x - 1 && posY == y - 1)
        return 0;
    else if (posX < 0 || posY < 0 || posX >= x || posY >= y)
        return x * y * 10;
    else if (tab[posY][posX] == '#')
        return x * y * 10;
    else if (cache[posY][posX] != -1)
        return cache[posY][posX];
    else
    {
        cache[posY][posX] = x * y * 10;
        int val1 = pathfind_aux(cache, tab, x, y, posX + 1, posY);
        int val2 = pathfind_aux(cache, tab, x, y, posX - 1, posY);
        int val3 = pathfind_aux(cache, tab, x, y, posX, posY - 1);
        int val4 = pathfind_aux(cache, tab, x, y, posX, posY + 1);
        int out0 = 1 + Math.min(Math.min(Math.min(val1, val2), val3), val4);
        cache[posY][posX] = out0;
        return out0;
    }
  }
  static int pathfind(char[][] tab, int x, int y)
  {
    int[][] cache = new int[y][];
    for (int i = 0; i < y; i++)
    {
        int[] tmp = new int[x];
        for (int j = 0; j < x; j++)
        {
            System.out.print(tab[i][j]);
            tmp[j] = -1;
        }
        System.out.print("\n");
        cache[i] = tmp;
    }
    return pathfind_aux(cache, tab, x, y, 0, 0);
  }
  public static void main(String args[])
  {
    int x = Integer.parseInt(scanner.nextLine());
    int y = Integer.parseInt(scanner.nextLine());
    System.out.printf("%d %d\n", x, y);
    char[][] e = new char[y][];
    for (int f = 0; f < y; f++)
        e[f] = scanner.nextLine().toCharArray();
    char[][] tab = e;
    int result = pathfind(tab, x, y);
    System.out.print(result);
  }
  
}



<|start_filename|>out/carre.lua<|end_filename|>

function readintline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), "-?%d+") do
    tab[index] = tonumber(a)
    index = index + 1
  end
  return tab
end

local x = tonumber(io.read('*l'))
local y = tonumber(io.read('*l'))
local tab = {}
for d = 0, y - 1 do
    tab[d + 1] = readintline()
end
for ix = 1, x - 1 do
    for iy = 1, y - 1 do
        if tab[iy + 1][ix + 1] == 1 then
            tab[iy + 1][ix + 1] = math.min(tab[iy + 1][ix], tab[iy][ix + 1], tab[iy][ix]) + 1
        end
    end
end
for jy = 0, y - 1 do
    for jx = 0, x - 1 do
        io.write(string.format("%d ", tab[jy + 1][jx + 1]))
    end
    io.write("\n")
end


<|start_filename|>out/euler33.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
pgcd a b =
  do let c = (min a b)
     let d = (max a b)
     let reste = d `rem` c
     if reste == 0
     then return c
     else pgcd c reste

main =
  let e i f g =
        if i <= 9
        then let h j l m =
                   if j <= 9
                   then let n k o q =
                              if k <= 9
                              then if i /= j && j /= k
                                   then do let a = i * 10 + j
                                           let b = j * 10 + k
                                           if a * k == i * b
                                           then do printf "%d/%d\n" (a::Int) (b::Int) :: IO()
                                                   let r = q * a
                                                   let s = o * b
                                                   n (k + 1) s r
                                           else n (k + 1) o q
                                   else n (k + 1) o q
                              else h (j + 1) o q in
                              n 1 l m
                   else e (i + 1) l m in
                   h 1 f g
        else do printf "%d/%d\n" (g::Int) (f::Int) :: IO()
                p <- pgcd g f
                printf "pgcd=%d\n%d\n" (p::Int) ((f `quot` p)::Int) :: IO() in
        e 1 1 1




<|start_filename|>out/euler11.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

template <typename T> std::vector<std::vector<T>> read_matrix(int l, int c) {
    std::vector<std::vector<T>> matrix(l, std::vector<T>(c));
    for (std::vector<T>& line : matrix)
        for (T& elem : line)
            std::cin >> elem;
    return matrix;
}

int find(int n, std::vector<std::vector<int>>& m, int x, int y, int dx, int dy) {
    if (x < 0 || x == 20 || y < 0 || y == 20)
        return -1;
    else if (n == 0)
        return 1;
    else
        return m[y][x] * find(n - 1, m, x + dx, y + dy, dx, dy);
}

struct tuple_int_int {
    int tuple_int_int_field_0;
    int tuple_int_int_field_1;
};

int main() {
    std::vector<tuple_int_int> directions( 8 );
    for (int i = 0; i < 8; i++)
        if (i == 0)
        {
            tuple_int_int c;
                c.tuple_int_int_field_0 = 0;
                c.tuple_int_int_field_1 = 1;;
            directions[i] = c;
        }
        else if (i == 1)
        {
            tuple_int_int d;
                d.tuple_int_int_field_0 = 1;
                d.tuple_int_int_field_1 = 0;;
            directions[i] = d;
        }
        else if (i == 2)
        {
            tuple_int_int e;
                e.tuple_int_int_field_0 = 0;
                e.tuple_int_int_field_1 = -1;;
            directions[i] = e;
        }
        else if (i == 3)
        {
            tuple_int_int f;
                f.tuple_int_int_field_0 = -1;
                f.tuple_int_int_field_1 = 0;;
            directions[i] = f;
        }
        else if (i == 4)
        {
            tuple_int_int g;
                g.tuple_int_int_field_0 = 1;
                g.tuple_int_int_field_1 = 1;;
            directions[i] = g;
        }
        else if (i == 5)
        {
            tuple_int_int h;
                h.tuple_int_int_field_0 = 1;
                h.tuple_int_int_field_1 = -1;;
            directions[i] = h;
        }
        else if (i == 6)
        {
            tuple_int_int k;
                k.tuple_int_int_field_0 = -1;
                k.tuple_int_int_field_1 = 1;;
            directions[i] = k;
        }
        else
        {
            tuple_int_int l;
                l.tuple_int_int_field_0 = -1;
                l.tuple_int_int_field_1 = -1;;
            directions[i] = l;
        }
    int max0 = 0;
    std::vector<std::vector<int>> m = read_matrix<int>(20, 20);
    for (int j = 0; j < 8; j++)
    {
        tuple_int_int o = directions[j];
        int dx = o.tuple_int_int_field_0;
        int dy = o.tuple_int_int_field_1;
        for (int x = 0; x < 20; x++)
            for (int y = 0; y < 20; y++)
                max0 = std::max(max0, find(4, m, x, y, dx, dy));
    }
    std::cout << max0 << "\n";
}



<|start_filename|>out/aaa_10stringsarray.cc<|end_filename|>
#include <iostream>
#include <vector>
struct toto {
    std::string s;
    int v;
};


std::string idstring(std::string s) {
    return s;
}


void printstring(std::string s) {
    std::cout << idstring(s) << "\n";
}


void print_toto(toto * t) {
    std::cout << t->s << " = " << t->v << "\n";
}

int main() {
    std::vector<std::string> *tab = new std::vector<std::string>( 2 );
    for (int i = 0; i < 2; i++)
        tab->at(i) = idstring("chaine de test");
    for (int j = 0; j < 2; j++)
        printstring(idstring(tab->at(j)));
    toto * a = new toto();
        a->s = "one";
        a->v = 1;;
    print_toto(a);
}



<|start_filename|>out/brainfuck_compiler.cpp<|end_filename|>
#include <iostream>
#include <vector>
/*
Ce test permet de tester les macros
C'est un compilateur brainfuck qui lit sur l'entrée standard pendant la compilation
et qui produit les macros metalang correspondante
*/
int main() {
    char input = ' ';
    int current_pos = 500;
    std::vector<int> mem( 1000, 0 );
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    current_pos++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    mem[current_pos]++;
    while (mem[current_pos] != 0)
    {
        mem[current_pos]--;
        current_pos--;
        mem[current_pos]++;
        std::cout << (char)(mem[current_pos]);
        current_pos++;
    }
}



<|start_filename|>out/euler12.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler12 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

function max2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a > b
  then
    return a;
  else
    return b;
  end if;
end;
type c is Array (Integer range <>) of Integer;
type c_PTR is access c;
function eratostene(t : in c_PTR; max0 : in Integer) return Integer is
  n : Integer;
  j : Integer;
begin
  n := 0;
  for i in integer range 2..max0 - 1 loop
    if t(i) = i
    then
      j := i * i;
      n := n + 1;
      while j < max0 and then j > 0 loop
        t(j) := 0;
        j := j + i;
      end loop;
    end if;
  end loop;
  return n;
end;
function fillPrimesFactors(t : in c_PTR; e : in Integer; primes : in c_PTR; nprimes : in Integer) return Integer is
  n : Integer;
  d : Integer;
begin
  n := e;
  for i in integer range 0..nprimes - 1 loop
    d := primes(i);
    while n rem d = 0 loop
      t(d) := t(d) + 1;
      n := n / d;
    end loop;
    if n = 1
    then
      return primes(i);
    end if;
  end loop;
  return n;
end;
function find(ndiv2 : in Integer) return Integer is
  primesFactors : c_PTR;
  primes : c_PTR;
  nprimes : Integer;
  ndivs : Integer;
  maximumprimes : Integer;
  max0 : Integer;
  l : Integer;
  era : c_PTR;
begin
  maximumprimes := 110;
  era := new c (0..maximumprimes - 1);
  for j in integer range 0..maximumprimes - 1 loop
    era(j) := j;
  end loop;
  nprimes := eratostene(era, maximumprimes);
  primes := new c (0..nprimes - 1);
  for o in integer range 0..nprimes - 1 loop
    primes(o) := 0;
  end loop;
  l := 0;
  for k in integer range 2..maximumprimes - 1 loop
    if era(k) = k
    then
      primes(l) := k;
      l := l + 1;
    end if;
  end loop;
  for n in integer range 1..10000 loop
    primesFactors := new c (0..n + 1);
    for m in integer range 0..n + 1 loop
      primesFactors(m) := 0;
    end loop;
    max0 := max2_0(fillPrimesFactors(primesFactors, n, primes, nprimes), fillPrimesFactors(primesFactors, n + 1, primes, nprimes));
    primesFactors(2) := primesFactors(2) - 1;
    ndivs := 1;
    for i in integer range 0..max0 loop
      if primesFactors(i) /= 0
      then
        ndivs := ndivs * (1 + primesFactors(i));
      end if;
    end loop;
    if ndivs > ndiv2
    then
      return n * (n + 1) / 2;
    end if;
    -- print "n=" print n print "\t" print (n * (n + 1) / 2 ) print " " print ndivs print "\n" 
    
  end loop;
  return 0;
end;

begin
  PInt(find(500));
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/tuple.fs<|end_filename|>
struct
  cell% field ->tuple_int_int_field_0
  cell% field ->tuple_int_int_field_1
end-struct tuple_int_int%


: f { tuple0 }
  tuple0 { c }
  c ->tuple_int_int_field_0 @ { a }
  c ->tuple_int_int_field_1 @ { b }
  tuple_int_int% %allot { d }
  a 1 + d ->tuple_int_int_field_0 !
  b 1 + d ->tuple_int_int_field_1 !
  d exit
;

: main
  tuple_int_int% %allot { e }
  0 e ->tuple_int_int_field_0 !
  1 e ->tuple_int_int_field_1 !
  e f { t }
  t { g }
  g ->tuple_int_int_field_0 @ { a }
  g ->tuple_int_int_field_1 @ { b }
  a s>d 0 d.r
  S"  -- " TYPE
  b s>d 0 d.r
  S\" --\n" TYPE
  ;
main
BYE



<|start_filename|>out/record3.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}

type toto struct {
  foo int;
  bar int;
  blah int;
}
func mktoto(v1 int) * toto{
  var t * toto = new (toto)
      (*t).foo=v1
      (*t).bar=0
      (*t).blah=0
  return t
}
func result(t []* toto, len int) int{
  out0 := 0
  for j := 0; j < len; j++ {
      (*t[j]).blah++
      out0 = out0 + (*t[j]).foo + (*t[j]).blah * (*t[j]).bar + (*t[j]).bar * (*t[j]).foo
  }
  return out0
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var t []* toto = make([]* toto, 4)
  for i := 0; i < 4; i++ {
      t[i] = mktoto(i)
  }
  fmt.Fscanf(reader, "%d", &(*t[0]).bar)
  skip()
  fmt.Fscanf(reader, "%d", &(*t[1]).blah)
  titi := result(t, 4)
  fmt.Printf("%d%d", titi, (*t[2]).blah)
}



<|start_filename|>out/euler21.java<|end_filename|>
import java.util.*;

public class euler21
{
  
  static int eratostene(int[] t, int max0)
  {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            int j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
  }
  static int fillPrimesFactors(int[] t, int n, int[] primes, int nprimes)
  {
    for (int i = 0; i < nprimes; i++)
    {
        int d = primes[i];
        while (n % d == 0)
        {
            t[d]++;
            n /= d;
        }
        if (n == 1)
            return primes[i];
    }
    return n;
  }
  static int sumdivaux2(int[] t, int n, int i)
  {
    while (i < n && t[i] == 0)
        i++;
    return i;
  }
  static int sumdivaux(int[] t, int n, int i)
  {
    if (i > n)
        return 1;
    else if (t[i] == 0)
        return sumdivaux(t, n, sumdivaux2(t, n, i + 1));
    else
    {
        int o = sumdivaux(t, n, sumdivaux2(t, n, i + 1));
        int out0 = 0;
        int p = i;
        for (int j = 1; j <= t[i]; j++)
        {
            out0 += p;
            p *= i;
        }
        return (out0 + 1) * o;
    }
  }
  static int sumdiv(int nprimes, int[] primes, int n)
  {
    int[] t = new int[n + 1];
    for (int i = 0; i <= n; i++)
        t[i] = 0;
    int max0 = fillPrimesFactors(t, n, primes, nprimes);
    return sumdivaux(t, max0, 0);
  }
  public static void main(String args[])
  {
    int maximumprimes = 1001;
    int[] era = new int[maximumprimes];
    for (int j = 0; j < maximumprimes; j++)
        era[j] = j;
    int nprimes = eratostene(era, maximumprimes);
    int[] primes = new int[nprimes];
    for (int o = 0; o < nprimes; o++)
        primes[o] = 0;
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    System.out.printf("%d == %d\n", l, nprimes);
    int sum = 0;
    for (int n = 2; n < 1001; n++)
    {
        int other = sumdiv(nprimes, primes, n) - n;
        if (other > n)
        {
            int othersum = sumdiv(nprimes, primes, other) - other;
            if (othersum == n)
            {
                System.out.printf("%d & %d\n", other, n);
                sum += other + n;
            }
        }
    }
    System.out.printf("\n%d\n", sum);
  }
  
}



<|start_filename|>out/countchar.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func nth(tab []byte, tofind byte, len int) int{
  out0 := 0
  for i := 0; i < len; i++ {
      if tab[i] == tofind {
          out0++
      }
  }
  return out0
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  len := 0
  fmt.Fscanf(reader, "%d", &len)
  skip()
  var tofind byte = '\x00'
  fmt.Fscanf(reader, "%c", &tofind)
  skip()
  var tab []byte = make([]byte, len)
  for i := 0; i < len; i++ {
      var tmp byte = '\x00'
      fmt.Fscanf(reader, "%c", &tmp)
      tab[i] = tmp
  }
  result := nth(tab, tofind, len)
  fmt.Printf("%d", result)
}



<|start_filename|>out/vigenere.cs<|end_filename|>
using System;

public class vigenere
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static char readChar(){
  char out_ = readChar_();
  consommeChar();
  return out_;
}
static void stdin_sep(){
  do{
    if (eof) return;
    char c = readChar_();
    if (c == ' ' || c == '\n' || c == '\t' || c == '\r'){
      consommeChar();
    }else{
      return;
    }
  } while(true);
}
static int readInt(){
  int i = 0;
  char s = readChar_();
  int sign = 1;
  if (s == '-'){
    sign = -1;
    consommeChar();
  }
  do{
    char c = readChar_();
    if (c <= '9' && c >= '0'){
      i = i * 10 + c - '0';
      consommeChar();
    }else{
      return i * sign;
    }
  } while(true);
} 
  static int position_alphabet(char c)
  {
    int i = (int)(c);
    if (i <= (int)('Z') && i >= (int)('A'))
        return i - (int)('A');
    else if (i <= (int)('z') && i >= (int)('a'))
        return i - (int)('a');
    else
        return -1;
  }
  
  static char of_position_alphabet(int c)
  {
    return (char)(c + (int)('a'));
  }
  
  static void crypte(int taille_cle, char[] cle, int taille, char[] message)
  {
    for (int i = 0; i < taille; i++)
    {
        int lettre = position_alphabet(message[i]);
        if (lettre != -1)
        {
            int addon = position_alphabet(cle[i % taille_cle]);
            int new0 = (addon + lettre) % 26;
            message[i] = of_position_alphabet(new0);
        }
    }
  }
  
  public static void Main(String[] args)
  {
    int taille_cle = readInt();
    stdin_sep();
    char[] cle = new char[taille_cle];
    for (int index = 0; index < taille_cle; index++)
    {
        char out0 = readChar();
        cle[index] = out0;
    }
    stdin_sep();
    int taille = readInt();
    stdin_sep();
    char[] message = new char[taille];
    for (int index2 = 0; index2 < taille; index2++)
    {
        char out2 = readChar();
        message[index2] = out2;
    }
    crypte(taille_cle, cle, taille, message);
    for (int i = 0; i < taille; i++)
        Console.Write(message[i]);
    Console.Write("\n");
  }
  
}



<|start_filename|>out/test_instant.js<|end_filename|>
var util = require("util");
function foo(a, b){
    return a + b;
}
util.print(10);



<|start_filename|>out/euler31.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function result (sum, t, maxIndex, cache)
  if cache[sum + 1][maxIndex + 1] ~= 0 then
      return cache[sum + 1][maxIndex + 1]
  elseif sum == 0 or maxIndex == 0 then
      return 1
  else 
      local out0 = 0
      local div = trunc(sum / t[maxIndex + 1])
      for i = 0, div do
          out0 = out0 + result(sum - i * t[maxIndex + 1], t, maxIndex - 1, cache)
      end
      cache[sum + 1][maxIndex + 1] = out0
      return out0
  end
end

local t = {}
for i = 0, 7 do
    t[i + 1] = 0
end
t[1] = 1
t[2] = 2
t[3] = 5
t[4] = 10
t[5] = 20
t[6] = 50
t[7] = 100
t[8] = 200
local cache = {}
for j = 0, 200 do
    local o = {}
    for k = 0, 7 do
        o[k + 1] = 0
    end
    cache[j + 1] = o
end
io.write(result(200, t, 7, cache))


<|start_filename|>out/aaa_11arrayconst.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


void test(int* tab, int len) {
    int i;
    for (i = 0; i < len; i++)
        printf("%d ", tab[i]);
    printf("\n");
}
int main(void) {
    int i;
    int *t = calloc(5, sizeof(int));
    for (i = 0; i < 5; i++)
        t[i] = 1;
    test(t, 5);
    return 0;
}




<|start_filename|>out/aaa_041comment.groovy<|end_filename|>
import java.util.*



int i = 4
// while i < 10 do 
print(i)
i++
//   end 
print(i)



<|start_filename|>out/plus_petit.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int go0(int* tab, int a, int b) {
    int m = (a + b) / 2;
    if (a == m)
        if (tab[a] == m)
            return b;
        else
            return a;
    int i = a;
    int j = b;
    while (i < j)
    {
        int e = tab[i];
        if (e < m)
            i++;
        else
        {
            j--;
            tab[i] = tab[j];
            tab[j] = e;
        }
    }
    if (i < m)
        return go0(tab, a, m);
    else
        return go0(tab, m, b);
}

int plus_petit0(int* tab, int len) {
    return go0(tab, 0, len);
}
int main(void) {
    int i;
    int len = 0;
    scanf("%d ", &len);
    int *tab = calloc(len, sizeof(int));
    for (i = 0; i < len; i++)
    {
        int tmp = 0;
        scanf("%d ", &tmp);
        tab[i] = tmp;
    }
    printf("%d", plus_petit0(tab, len));
    return 0;
}




<|start_filename|>out/test_instant.cs<|end_filename|>
using System;

public class test_instant
{
  static int foo(int a, int b)
  {
    return a + b;
  }
  
  public static void Main(String[] args)
  {
    Console.Write(10);
  }
  
}



<|start_filename|>out/fibo.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
\ 
\ La suite de fibonaci
\ 

: fibo0 { a b i }
  0 { out0 }
  a { a2 }
  b { b2 }
  i 1 + 0 BEGIN 2dup >= WHILE DUP { j }
    out0 a2 + TO out0
    b2 { tmp }
    b2 a2 + TO b2
    tmp TO a2
   1 + REPEAT 2DROP
  out0 exit
;

: main
  read-int { a }
  skipspaces
  read-int { b }
  skipspaces
  read-int { i }
  a b i fibo0 s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/montagnes.java<|end_filename|>
import java.util.*;

public class montagnes
{
  static Scanner scanner = new Scanner(System.in);
  static int montagnes0(int[] tab, int len)
  {
    int max0 = 1;
    int j = 1;
    int i = len - 2;
    while (i >= 0)
    {
        int x = tab[i];
        while (j >= 0 && x > tab[len - j])
            j--;
        j++;
        tab[len - j] = x;
        if (j > max0)
            max0 = j;
        i--;
    }
    return max0;
  }
  public static void main(String args[])
  {
    int len = 0;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      len = -scanner.nextInt();
    }else{
      len = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int[] tab = new int[len];
    for (int i = 0; i < len; i++)
    {
        int x = 0;
        if (scanner.hasNext("^-")) {
          scanner.next("^-");
          x = -scanner.nextInt();
        }else{
          x = scanner.nextInt();
        }
        scanner.findWithinHorizon("[\n\r ]*", 1);
        tab[i] = x;
    }
    System.out.print(montagnes0(tab, len));
  }
  
}



<|start_filename|>out/recordtest.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure recordtest is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type toto;
type toto_PTR is access toto;
type toto is record
  foo : Integer;
  bar : Integer;
end record;

  param : toto_PTR;
begin
  param := new toto;
  param.foo := 0;
  param.bar := 0;
  Get(param.bar);
  SkipSpaces;
  Get(param.foo);
  PInt(param.bar + param.foo * param.bar);
end;


<|start_filename|>out/test_returns.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
is_pair i =
  do let a b = let c = if i < 20
                       then let d = if i == 22
                                    then 0
                                    else 6
                                    in 8
                       else 6
                       in return ((i `rem` 2) == 0)
     if i < 10
     then if i == 0
          then return True
          else if i == 2
               then return True
               else a 5
     else a 1

main =
  return ()




<|start_filename|>out/aaa_02if.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int f(int i) {
    if (i == 0)
        return 1;
    return 0;
}
int main(void) {
    if (f(4))
        printf("true <-\n ->\n");
    else
        printf("false <-\n ->\n");
    printf("small test end\n");
    return 0;
}




<|start_filename|>out/small_inline.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end

local t = {}
for d = 0, 1 do
    t[d + 1] = readint()
    stdinsep()
end
io.write(string.format("%d - %d\n", t[1], t[2]))


<|start_filename|>out/aaa_021if.go<|end_filename|>
package main
import "fmt"
func testA(a bool, b bool) {
  if a {
      if b {
          fmt.Printf("A")
      } else {
          fmt.Printf("B")
      }
  } else if b {
      fmt.Printf("C")
  } else {
      fmt.Printf("D")
  }
}
func testB(a bool, b bool) {
  if a {
      fmt.Printf("A")
  } else if b {
      fmt.Printf("B")
  } else {
      fmt.Printf("C")
  }
}
func testC(a bool, b bool) {
  if a {
      if b {
          fmt.Printf("A")
      } else {
          fmt.Printf("B")
      }
  } else {
      fmt.Printf("C")
  }
}
func testD(a bool, b bool) {
  if a {
      if b {
          fmt.Printf("A")
      } else {
          fmt.Printf("B")
      }
      fmt.Printf("C")
  } else {
      fmt.Printf("D")
  }
}
func testE(a bool, b bool) {
  if a {
      if b {
          fmt.Printf("A")
      }
  } else {
      if b {
          fmt.Printf("C")
      } else {
          fmt.Printf("D")
      }
      fmt.Printf("E")
  }
}
func test(a bool, b bool) {
  testD(a, b)
  testE(a, b)
  fmt.Printf("\n")
}
func main() {
  test(true, true)
  test(true, false)
  test(false, true)
  test(false, false)
}



<|start_filename|>out/aaa_read1.java<|end_filename|>
import java.util.*;

public class aaa_read1
{
  static Scanner scanner = new Scanner(System.in);
  
  public static void main(String args[])
  {
    char[] str = scanner.nextLine().toCharArray();
    for (int i = 0; i < 12; i++)
        System.out.print(str[i]);
  }
  
}



<|start_filename|>out/euler32.cc<|end_filename|>
#include <iostream>
#include <vector>
/*
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once;
for example, the 5-digit number, 15234, is 1 through 5 pandigital.

The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier,
and product is 1 through 9 pandigital.

Find the sum of all products whose multiplicand/multiplier/product identity can be written as a
1 through 9 pandigital.

HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.


(a * 10 + b) ( c * 100 + d * 10 + e) =
  a * c * 1000 +
  a * d * 100 +
  a * e * 10 +
  b * c * 100 +
  b * d * 10 +
  b * e
  => b != e != b * e % 10 ET
  a != d != (b * e / 10 + b * d + a * e ) % 10
*/

bool okdigits(std::vector<bool> * ok, int n) {
    if (n == 0)
        return true;
    else
    {
        int digit = n % 10;
        if (ok->at(digit))
        {
            ok->at(digit) = false;
            bool o = okdigits(ok, n / 10);
            ok->at(digit) = true;
            return o;
        }
        else
            return false;
    }
}

int main() {
    int count = 0;
    std::vector<bool> *allowed = new std::vector<bool>( 10 );
    for (int i = 0; i < 10; i++)
        allowed->at(i) = i != 0;
    std::vector<bool> *counted = new std::vector<bool>( 100000 );
    std::fill(counted->begin(), counted->end(), false);
    for (int e = 1; e < 10; e++)
    {
        allowed->at(e) = false;
        for (int b = 1; b < 10; b++)
            if (allowed->at(b))
            {
                allowed->at(b) = false;
                int be = b * e % 10;
                if (allowed->at(be))
                {
                    allowed->at(be) = false;
                    for (int a = 1; a < 10; a++)
                        if (allowed->at(a))
                        {
                            allowed->at(a) = false;
                            for (int c = 1; c < 10; c++)
                                if (allowed->at(c))
                                {
                                    allowed->at(c) = false;
                                    for (int d = 1; d < 10; d++)
                                        if (allowed->at(d))
                                        {
                                            allowed->at(d) = false;
                                            //  2 * 3 digits 
                                            int product = (a * 10 + b) * (c * 100 + d * 10 + e);
                                            if (!counted->at(product) && okdigits(allowed, product / 10))
                                            {
                                                counted->at(product) = true;
                                                count += product;
                                                std::cout << product << " ";
                                            }
                                            //  1  * 4 digits 
                                            int product2 = b * (a * 1000 + c * 100 + d * 10 + e);
                                            if (!counted->at(product2) && okdigits(allowed, product2 / 10))
                                            {
                                                counted->at(product2) = true;
                                                count += product2;
                                                std::cout << product2 << " ";
                                            }
                                            allowed->at(d) = true;
                                        }
                                    allowed->at(c) = true;
                                }
                            allowed->at(a) = true;
                        }
                    allowed->at(be) = true;
                }
                allowed->at(b) = true;
            }
        allowed->at(e) = true;
    }
    std::cout << count << "\n";
}



<|start_filename|>out/pathfindList.cc<|end_filename|>
#include <iostream>
#include <vector>

int pathfind_aux(std::vector<int> * cache, std::vector<int> * tab, int len, int pos) {
    if (pos >= len - 1)
        return 0;
    else if (cache->at(pos) != -1)
        return cache->at(pos);
    else
    {
        cache->at(pos) = len * 2;
        int posval = pathfind_aux(cache, tab, len, tab->at(pos));
        int oneval = pathfind_aux(cache, tab, len, pos + 1);
        int out0 = 0;
        if (posval < oneval)
            out0 = 1 + posval;
        else
            out0 = 1 + oneval;
        cache->at(pos) = out0;
        return out0;
    }
}


int pathfind(std::vector<int> * tab, int len) {
    std::vector<int> *cache = new std::vector<int>( len );
    for (int i = 0; i < len; i++)
        cache->at(i) = -1;
    return pathfind_aux(cache, tab, len, 0);
}

int main() {
    int len = 0;
    std::cin >> len;
    std::vector<int> *tab = new std::vector<int>( len );
    for (int i = 0; i < len; i++)
    {
        int tmp = 0;
        std::cin >> tmp;
        tab->at(i) = tmp;
    }
    int result = pathfind(tab, len);
    std::cout << result;
}



<|start_filename|>out/triangles.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
/* Ce code a été généré par metalang
   Il gère les entrées sorties pour un programme dynamique classique
   dans les épreuves de prologin
on le retrouve ici : http://projecteuler.net/problem=18
*/
func find0(len int, tab [][]int, cache [][]int, x int, y int) int{
  /*
	Cette fonction est récursive
	*/
  if y == len - 1 {
      return tab[y][x]
  } else if x > y {
      return -10000
  } else if cache[y][x] != 0 {
      return cache[y][x]
  }
  result := 0
  out0 := find0(len, tab, cache, x, y + 1)
  out1 := find0(len, tab, cache, x + 1, y + 1)
  if out0 > out1 {
      result = out0 + tab[y][x]
  } else {
      result = out1 + tab[y][x]
  }
  cache[y][x] = result
  return result
}
func find(len int, tab [][]int) int{
  var tab2 [][]int = make([][]int, len)
  for i := 0; i < len; i++ {
      var tab3 []int = make([]int, i + 1)
      for j := 0; j <= i; j++ {
          tab3[j] = 0
      }
      tab2[i] = tab3
  }
  return find0(len, tab, tab2, 0, 0)
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var len int
  fmt.Fscanf(reader, "%d", &len)
  skip()
  var tab [][]int = make([][]int, len)
  for i := 0; i < len; i++ {
      var tab2 []int = make([]int, i + 1)
      for j := 0; j <= i; j++ {
          var tmp int
          fmt.Fscanf(reader, "%d", &tmp)
          skip()
          tab2[j] = tmp
      }
      tab[i] = tab2
  }
  fmt.Printf("%d\n", find(len, tab))
  for k := 0; k < len; k++ {
      for l := 0; l <= k; l++ {
          fmt.Printf("%d ", tab[k][l])
      }
      fmt.Printf("\n")
  }
}



<|start_filename|>out/euler46.js<|end_filename|>
var util = require("util");
function eratostene(t, max0){
    var n = 0;
    for (var i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            if (~~(max0 / i) > i)
            {
                var j = i * i;
                while (j < max0 && j > 0)
                {
                    t[j] = 0;
                    j += i;
                }
            }
        }
    return n;
}
var maximumprimes = 6000;
var era = new Array(maximumprimes);
for (var j_ = 0; j_ < maximumprimes; j_++)
    era[j_] = j_;
var nprimes = eratostene(era, maximumprimes);
var primes = new Array(nprimes);
for (var o = 0; o < nprimes; o++)
    primes[o] = 0;
var l = 0;
for (var k = 2; k < maximumprimes; k++)
    if (era[k] == k)
    {
        primes[l] = k;
        l++;
    }
util.print(l, " == ", nprimes, "\n");
var canbe = new Array(maximumprimes);
for (var i_ = 0; i_ < maximumprimes; i_++)
    canbe[i_] = false;
for (var i = 0; i < nprimes; i++)
    for (var j = 0; j < maximumprimes; j++)
    {
        var n = primes[i] + 2 * j * j;
        if (n < maximumprimes)
            canbe[n] = true;
    }
for (var m = 1; m <= maximumprimes; m++)
{
    var m2 = m * 2 + 1;
    if (m2 < maximumprimes && !canbe[m2])
        util.print(m2, "\n");
}



<|start_filename|>out/euler30.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler30 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

type g is Array (Integer range <>) of Integer;
type g_PTR is access g;

  sum : Integer;
  s : Integer;
  r : Integer;
  p : g_PTR;
begin
  --
  --a + b * 10 + c * 100 + d * 1000 + e * 10 000 =
  --  a ^ 5 +
  --  b ^ 5 +
  --  c ^ 5 +
  --  d ^ 5 +
  --  e ^ 5
  --
  
  p := new g (0..9);
  for i in integer range 0..9 loop
    p(i) := i * i * i * i * i;
  end loop;
  sum := 0;
  for a in integer range 0..9 loop
    for b in integer range 0..9 loop
      for c in integer range 0..9 loop
        for d in integer range 0..9 loop
          for e in integer range 0..9 loop
            for f in integer range 0..9 loop
              s := p(a) + p(b) + p(c) + p(d) + p(e) + p(f);
              r := a + b * 10 + c * 100 + d * 1000 + e * 10000 + f * 100000;
              if s = r and then r /= 1
              then
                PInt(f);
                PInt(e);
                PInt(d);
                PInt(c);
                PInt(b);
                PInt(a);
                PString(new char_array'( To_C(" ")));
                PInt(r);
                PString(new char_array'( To_C("" & Character'Val(10))));
                sum := sum + r;
              end if;
            end loop;
          end loop;
        end loop;
      end loop;
    end loop;
  end loop;
  PInt(sum);
end;


<|start_filename|>out/euler04.groovy<|end_filename|>
import java.util.*

/*

(a + b * 10 + c * 100) * (d + e * 10 + f * 100) =
a * d + a * e * 10 + a * f * 100 +
10 * (b * d + b * e * 10 + b * f * 100)+
100 * (c * d + c * e * 10 + c * f * 100) =

a * d       + a * e * 10   + a * f * 100 +
b * d * 10  + b * e * 100  + b * f * 1000 +
c * d * 100 + c * e * 1000 + c * f * 10000 =

a * d +
10 * ( a * e + b * d) +
100 * (a * f + b * e + c * d) +
(c * e + b * f) * 1000 +
c * f * 10000

*/
int chiffre(int c, int m)
{
  if (c == 0)
      return m % 10
  else
      return chiffre(c - 1, m.intdiv(10))
}

int m = 1
for (int a = 0; a < 10; a++)
    for (int f = 1; f < 10; f++)
        for (int d = 0; d < 10; d++)
            for (int c = 1; c < 10; c++)
                for (int b = 0; b < 10; b++)
                    for (int e = 0; e < 10; e++)
                    {
                        int mul = a * d + 10 * (a * e + b * d) + 100 * (a * f + b * e + c * d) + 1000 * (c * e + b * f) + 10000 * c * f
                        if (chiffre(0, mul) == chiffre(5, mul) && chiffre(1, mul) == chiffre(4, mul) && chiffre(2, mul) == chiffre(3, mul))
                            m = Math.max(mul, m)
                    }
System.out.printf("%d\n", m)



<|start_filename|>out/euler32.cs<|end_filename|>
using System;

public class euler32
{
  /*
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once;
for example, the 5-digit number, 15234, is 1 through 5 pandigital.

The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier,
and product is 1 through 9 pandigital.

Find the sum of all products whose multiplicand/multiplier/product identity can be written as a
1 through 9 pandigital.

HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.


(a * 10 + b) ( c * 100 + d * 10 + e) =
  a * c * 1000 +
  a * d * 100 +
  a * e * 10 +
  b * c * 100 +
  b * d * 10 +
  b * e
  => b != e != b * e % 10 ET
  a != d != (b * e / 10 + b * d + a * e ) % 10
*/
  static bool okdigits(bool[] ok, int n)
  {
    if (n == 0)
        return true;
    else
    {
        int digit = n % 10;
        if (ok[digit])
        {
            ok[digit] = false;
            bool o = okdigits(ok, n / 10);
            ok[digit] = true;
            return o;
        }
        else
            return false;
    }
  }
  
  public static void Main(String[] args)
  {
    int count = 0;
    bool[] allowed = new bool[10];
    for (int i = 0; i < 10; i++)
        allowed[i] = i != 0;
    bool[] counted = new bool[100000];
    for (int j = 0; j < 100000; j++)
        counted[j] = false;
    for (int e = 1; e < 10; e++)
    {
        allowed[e] = false;
        for (int b = 1; b < 10; b++)
            if (allowed[b])
            {
                allowed[b] = false;
                int be = b * e % 10;
                if (allowed[be])
                {
                    allowed[be] = false;
                    for (int a = 1; a < 10; a++)
                        if (allowed[a])
                        {
                            allowed[a] = false;
                            for (int c = 1; c < 10; c++)
                                if (allowed[c])
                                {
                                    allowed[c] = false;
                                    for (int d = 1; d < 10; d++)
                                        if (allowed[d])
                                        {
                                            allowed[d] = false;
                                            //  2 * 3 digits 
                                            int product = (a * 10 + b) * (c * 100 + d * 10 + e);
                                            if (!counted[product] && okdigits(allowed, product / 10))
                                            {
                                                counted[product] = true;
                                                count += product;
                                                Console.Write(product + " ");
                                            }
                                            //  1  * 4 digits 
                                            int product2 = b * (a * 1000 + c * 100 + d * 10 + e);
                                            if (!counted[product2] && okdigits(allowed, product2 / 10))
                                            {
                                                counted[product2] = true;
                                                count += product2;
                                                Console.Write(product2 + " ");
                                            }
                                            allowed[d] = true;
                                        }
                                    allowed[c] = true;
                                }
                            allowed[a] = true;
                        }
                    allowed[be] = true;
                }
                allowed[b] = true;
            }
        allowed[e] = true;
    }
    Console.Write(count + "\n");
  }
  
}



<|start_filename|>out/prologin_template_intmatrix.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func programme_candidat(tableau [][]int, x int, y int) int{
  out0 := 0
  for i := 0; i < y; i++ {
      for j := 0; j < x; j++ {
          out0 += tableau[i][j] * (i * 2 + j)
      }
  }
  return out0
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var taille_y int
  var taille_x int
  fmt.Fscanf(reader, "%d", &taille_x)
  skip()
  fmt.Fscanf(reader, "%d", &taille_y)
  skip()
  var tableau [][]int = make([][]int, taille_y)
  for a := 0; a < taille_y; a++ {
      var b []int = make([]int, taille_x)
      for c := 0; c < taille_x; c++ {
          fmt.Fscanf(reader, "%d", &b[c])
          skip()
      }
      tableau[a] = b
  }
  fmt.Printf("%d\n", programme_candidat(tableau, taille_x, taille_y))
}



<|start_filename|>out/euler50.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function eratostene (t, max0)
  local n = 0
  for i = 2, max0 - 1 do
      if t[i + 1] == i then
          n = n + 1
          if trunc(max0 / i) > i then
              local j = i * i
              while j < max0 and j > 0 do
                  t[j + 1] = 0
                  j = j + i
              end
          end
      end
  end
  return n
end

local maximumprimes = 1000001
local era = {}
for j = 0, maximumprimes - 1 do
    era[j + 1] = j
end
local nprimes = eratostene(era, maximumprimes)
local primes = {}
for o = 0, nprimes - 1 do
    primes[o + 1] = 0
end
local l = 0
for k = 2, maximumprimes - 1 do
    if era[k + 1] == k then
        primes[l + 1] = k
        l = l + 1
    end
end
io.write(string.format("%d == %d\n", l, nprimes))
local sum = {}
for i_ = 0, nprimes - 1 do
    sum[i_ + 1] = primes[i_ + 1]
end
local maxl = 0
local process = true
local stop = maximumprimes - 1
local len = 1
local resp = 1
while process do
    process = false
    for i = 0, stop do
        if i + len < nprimes then
            sum[i + 1] = sum[i + 1] + primes[i + len + 1]
            if maximumprimes > sum[i + 1] then
                process = true
                if era[sum[i + 1] + 1] == sum[i + 1] then
                    maxl = len
                    resp = sum[i + 1]
                end
            else 
                stop = math.min(stop, i)
            end
        end
    end
    len = len + 1
end
io.write(string.format("%d\n%d\n", resp, maxl))


<|start_filename|>out/prologin_template_intlist.lua<|end_filename|>

function readintline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), "-?%d+") do
    tab[index] = tonumber(a)
    index = index + 1
  end
  return tab
end
function programme_candidat (tableau, taille)
  local out0 = 0
  for i = 0, taille - 1 do
      out0 = out0 + tableau[i + 1]
  end
  return out0
end

local taille = tonumber(io.read('*l'))
local tableau = readintline()
io.write(string.format("%d\n", programme_candidat(tableau, taille)))


<|start_filename|>out/countchar.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int nth(char* tab, char tofind, int len) {
    int i;
    int out0 = 0;
    for (i = 0; i < len; i++)
        if (tab[i] == tofind)
            out0++;
    return out0;
}
int main(void) {
    int i;
    int len = 0;
    scanf("%d ", &len);
    char tofind = '\x00';
    scanf("%c ", &tofind);
    char *tab = calloc(len, sizeof(char));
    for (i = 0; i < len; i++)
    {
        char tmp = '\x00';
        scanf("%c", &tmp);
        tab[i] = tmp;
    }
    int result = nth(tab, tofind, len);
    printf("%d", result);
    return 0;
}




<|start_filename|>out/plus_petit.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
: go0 recursive { tab a b }
  a b + 2 // { m }
  a m =
  IF
    tab  a cells +  @ m =
    IF
      b exit
    ELSE
      a exit
    THEN
  THEN
  a { i }
  b { j }
  BEGIN
    i j <
  WHILE
    tab  i cells +  @ { e }
    e m <
    IF
      i 1 + TO i
    ELSE
      j 1 - TO j
      tab  j cells +  @ tab  i cells +  !
      e tab  j cells +  !
    THEN
  REPEAT
  i m <
  IF
    tab a m go0 exit
  ELSE
    tab m b go0 exit
  THEN
;


: plus_petit0 { tab len }
  tab 0 len go0 exit
;

: main
  0 { len }
  read-int TO len
  skipspaces
  HERE len cells allot { tab }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    0 { tmp }
    read-int TO tmp
    skipspaces
    tmp tab  i cells +  !
   1 + REPEAT 2DROP
  tab len plus_petit0 s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/euler14.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
next0 n =
  return (if (n `rem` 2) == 0
          then n `quot` 2
          else 3 * n + 1)

find n m =
  if n == 1
  then return 1
  else if n >= 1000000
       then (((+) 1) <$> (join $ find <$> (next0 n) <*> return m))
       else ifM (((/=) 0) <$> (readIOA m n))
                (readIOA m n)
                (do writeIOA m n =<< (((+) 1) <$> (join $ find <$> (next0 n) <*> return m))
                    readIOA m n)

main =
  do m <- array_init 1000000 (\ j ->
                                return 0)
     let a i b c =
           if i <= 999
           then {- normalement on met 999999 mais ça dépasse les int32... -}
                do n2 <- find i m
                   if n2 > b
                   then a (i + 1) n2 i
                   else a (i + 1) b c
           else printf "%d\n%d\n" (b::Int) (c::Int) :: IO() in
           a 1 0 0




<|start_filename|>out/triangles.java<|end_filename|>
import java.util.*;

public class triangles
{
  static Scanner scanner = new Scanner(System.in);
  /* Ce code a été généré par metalang
   Il gère les entrées sorties pour un programme dynamique classique
   dans les épreuves de prologin
on le retrouve ici : http://projecteuler.net/problem=18
*/
  static int find0(int len, int[][] tab, int[][] cache, int x, int y)
  {
    /*
	Cette fonction est récursive
	*/
    if (y == len - 1)
        return tab[y][x];
    else if (x > y)
        return -10000;
    else if (cache[y][x] != 0)
        return cache[y][x];
    int result = 0;
    int out0 = find0(len, tab, cache, x, y + 1);
    int out1 = find0(len, tab, cache, x + 1, y + 1);
    if (out0 > out1)
        result = out0 + tab[y][x];
    else
        result = out1 + tab[y][x];
    cache[y][x] = result;
    return result;
  }
  static int find(int len, int[][] tab)
  {
    int[][] tab2 = new int[len][];
    for (int i = 0; i < len; i++)
    {
        int[] tab3 = new int[i + 1];
        for (int j = 0; j <= i; j++)
            tab3[j] = 0;
        tab2[i] = tab3;
    }
    return find0(len, tab, tab2, 0, 0);
  }
  public static void main(String args[])
  {
    int len;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      len = scanner.nextInt();
    } else {
      len = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int[][] tab = new int[len][];
    for (int i = 0; i < len; i++)
    {
        int[] tab2 = new int[i + 1];
        for (int j = 0; j <= i; j++)
        {
            int tmp;
            if (scanner.hasNext("^-")) {
              scanner.next("^-");
              tmp = scanner.nextInt();
            } else {
              tmp = scanner.nextInt();
            }
            scanner.findWithinHorizon("[\n\r ]*", 1);
            tab2[j] = tmp;
        }
        tab[i] = tab2;
    }
    System.out.printf("%d\n", find(len, tab));
    for (int k = 0; k < len; k++)
    {
        for (int l = 0; l <= k; l++)
            System.out.printf("%d ", tab[k][l]);
        System.out.print("\n");
    }
  }
  
}



<|start_filename|>out/prologin_template_2charline.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
: read-char current-char next-char ;
: programme_candidat { tableau1 taille1 tableau2 taille2 }
  0 { out0 }
  taille1 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    out0 tableau1  i cells +  @ i * + TO out0
    tableau1  i cells +  @ EMIT
   1 + REPEAT 2DROP
  S\" --\n" TYPE
  taille2 1 - 0 BEGIN 2dup >= WHILE DUP { j }
    out0 tableau2  j cells +  @ j 100 * * + TO out0
    tableau2  j cells +  @ EMIT
   1 + REPEAT 2DROP
  S\" --\n" TYPE
  out0 exit
;

: main
  read-int { taille1 }
  skipspaces
  HERE taille1 cells allot { tableau1 }
  taille1 1 - 0 BEGIN 2dup >= WHILE DUP { a }
    read-char tableau1  a cells +  !
   1 + REPEAT 2DROP
  skipspaces
  read-int { taille2 }
  skipspaces
  HERE taille2 cells allot { tableau2 }
  taille2 1 - 0 BEGIN 2dup >= WHILE DUP { b }
    read-char tableau2  b cells +  !
   1 + REPEAT 2DROP
  skipspaces
  tableau1 taille1 tableau2 taille2 programme_candidat s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/prologin_template_charmatrix.lua<|end_filename|>

function readcharline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), ".") do
    tab[index] = string.byte(a)
    index = index + 1
  end
  return tab
end
function programme_candidat (tableau, taille_x, taille_y)
  local out0 = 0
  for i = 0, taille_y - 1 do
      for j = 0, taille_x - 1 do
          out0 = out0 + tableau[i + 1][j + 1] * (i + j * 2)
          io.write(string.format("%c", tableau[i + 1][j + 1]))
      end
      io.write("--\n")
  end
  return out0
end

local taille_x = tonumber(io.read('*l'))
local taille_y = tonumber(io.read('*l'))
local a = {}
for b = 0, taille_y - 1 do
    a[b + 1] = readcharline()
end
local tableau = a
io.write(string.format("%d\n", programme_candidat(tableau, taille_x, taille_y)))


<|start_filename|>out/euler15.js<|end_filename|>
var util = require("util");

var n = 10;
//  normalement on doit mettre 20 mais là on se tape un overflow 
n++;
var tab = new Array(n);
for (var i = 0; i < n; i++)
{
    var tab2 = new Array(n);
    for (var j = 0; j < n; j++)
        tab2[j] = 0;
    tab[i] = tab2;
}
for (var l = 0; l < n; l++)
{
    tab[n - 1][l] = 1;
    tab[l][n - 1] = 1;
}
for (var o = 2; o <= n; o++)
{
    var r = n - o;
    for (var p = 2; p <= n; p++)
    {
        var q = n - p;
        tab[r][q] = tab[r + 1][q] + tab[r][q + 1];
    }
}
for (var m = 0; m < n; m++)
{
    for (var k = 0; k < n; k++)
        util.print(tab[m][k], " ");
    util.print("\n");
}
util.print(tab[0][0], "\n");



<|start_filename|>out/aaa_021if.js<|end_filename|>
var util = require("util");
function testA(a, b){
    if (a)
        if (b)
            util.print("A");
        else
            util.print("B");
    else if (b)
        util.print("C");
    else
        util.print("D");
}
function testB(a, b){
    if (a)
        util.print("A");
    else if (b)
        util.print("B");
    else
        util.print("C");
}
function testC(a, b){
    if (a)
        if (b)
            util.print("A");
        else
            util.print("B");
    else
        util.print("C");
}
function testD(a, b){
    if (a)
    {
        if (b)
            util.print("A");
        else
            util.print("B");
        util.print("C");
    }
    else
        util.print("D");
}
function testE(a, b){
    if (a)
    {
        if (b)
            util.print("A");
    }
    else
    {
        if (b)
            util.print("C");
        else
            util.print("D");
        util.print("E");
    }
}
function test(a, b){
    testD(a, b);
    testE(a, b);
    util.print("\n");
}
test(true, true);
test(true, false);
test(false, true);
test(false, false);



<|start_filename|>out/aaa_read0.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int main(void) {
    int len;
    scanf("%d ", &len);
    printf("%d\n", len);
    return 0;
}




<|start_filename|>out/aaa_013option.js<|end_filename|>
var util = require("util");
function default0(a, b, c, d, e, f){
    return 0;
}
function aa(b){
    
}
var a = null;
util.print("___\n");



<|start_filename|>out/aaa_03binding.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int g(int i) {
    int j = i * 4;
    if (j % 2 == 1)
        return 0;
    return j;
}

void h(int i) {
    printf("%d\n", i);
}
int main(void) {
    h(14);
    int a = 4;
    int b = 5;
    printf("%d", a + b);
    /* main */
    h(15);
    a = 2;
    b = 1;
    printf("%d", a + b);
    return 0;
}




<|start_filename|>out/euler10.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler10 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function eratostene(t : in a_PTR; max0 : in Integer) return Integer is
  sum : Integer;
  j : Integer;
begin
  sum := 0;
  for i in integer range 2..max0 - 1 loop
    if t(i) = i
    then
      sum := sum + i;
      if max0 / i > i
      then
        j := i * i;
        while j < max0 and then j > 0 loop
          t(j) := 0;
          j := j + i;
        end loop;
      end if;
    end if;
  end loop;
  return sum;
end;

  t : a_PTR;
  n : Integer;
begin
  n := 100000;
  -- normalement on met 2000 000 mais là on se tape des int overflow dans plein de langages 
  
  t := new a (0..n - 1);
  for i in integer range 0..n - 1 loop
    t(i) := i;
  end loop;
  t(1) := 0;
  PInt(eratostene(t, n));
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/aaa_read2.lua<|end_filename|>

function readintline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), "-?%d+") do
    tab[index] = tonumber(a)
    index = index + 1
  end
  return tab
end

function readcharline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), ".") do
    tab[index] = string.byte(a)
    index = index + 1
  end
  return tab
end
--[[
Ce test permet de vérifier si les différents backends pour les langages implémentent bien
read int, read char et skip
--]]

local len = tonumber(io.read('*l'))
io.write(string.format("%d=len\n", len))
local tab = readintline()
for i = 0, len - 1 do
    io.write(string.format("%d=>%d ", i, tab[i + 1]))
end
io.write("\n")
local tab2 = readintline()
for i_ = 0, len - 1 do
    io.write(string.format("%d==>%d ", i_, tab2[i_ + 1]))
end
local strlen = tonumber(io.read('*l'))
io.write(string.format("%d=strlen\n", strlen))
local tab4 = readcharline()
for i3 = 0, strlen - 1 do
    local tmpc = tab4[i3 + 1]
    local c = tmpc
    io.write(string.format("%c:%d ", tmpc, c))
    if tmpc ~= 32 then
        c = math.fmod(c - 97 + 13, 26) + 97
    end
    tab4[i3 + 1] = c
end
for j = 0, strlen - 1 do
    io.write(string.format("%c", tab4[j + 1]))
end


<|start_filename|>out/rot13.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_char_(){
    if (current_char == null) current_char = read_char0();
    var out = current_char;
    current_char = read_char0();
    return out;
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}
/*
Ce test effectue un rot13 sur une chaine lue en entrée
*/
var strlen = read_int_();
stdinsep();
var tab4 = new Array(strlen);
for (var toto = 0; toto < strlen; toto++)
{
    var tmpc = read_char_();
    var c = tmpc.charCodeAt(0);
    if (tmpc != ' ')
        c = ~~((c - 'a'.charCodeAt(0) + 13) % 26) + 'a'.charCodeAt(0);
    tab4[toto] = String.fromCharCode(c);
}
for (var j = 0; j < strlen; j++)
    util.print(tab4[j]);



<|start_filename|>out/euler06.java<|end_filename|>
import java.util.*;

public class euler06
{
  
  
  public static void main(String args[])
  {
    int lim = 100;
    int sum = lim * (lim + 1) / 2;
    int carressum = sum * sum;
    int sumcarres = lim * (lim + 1) * (2 * lim + 1) / 6;
    System.out.print(carressum - sumcarres);
  }
  
}



<|start_filename|>out/euler39.fs<|end_filename|>
: main
  HERE 1001 cells allot { t }
  1000 0 BEGIN 2dup >= WHILE DUP { i }
    0 t  i cells +  !
   1 + REPEAT 2DROP
  1000 1 BEGIN 2dup >= WHILE DUP { a }
    1000 1 BEGIN 2dup >= WHILE DUP { b }
      a a * b b * + { c2 }
      c2 s>f fsqrt f>s { c }
      c c * c2 =
      IF
        a b + c + { p }
        p 1001 <
        IF
          t  p cells +  @ 1 + t  p cells +  !
        THEN
      THEN
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  0 { j }
  1000 1 BEGIN 2dup >= WHILE DUP { k }
    t  k cells +  @ t  j cells +  @ >
    IF
      k TO j
    THEN
   1 + REPEAT 2DROP
  j s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/npi.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int is_number(char c) {
    return (int)(c) <= (int)('9') && (int)(c) >= (int)('0');
}
/* 
Notation polonaise inversée, ce test permet d'évaluer une expression écrite en NPI
 */


int npi0(char* str, int len) {
    int i;
    int *stack = calloc(len, sizeof(int));
    for (i = 0; i < len; i++)
        stack[i] = 0;
    int ptrStack = 0;
    int ptrStr = 0;
    while (ptrStr < len)
        if (str[ptrStr] == ' ')
            ptrStr++;
        else if (is_number(str[ptrStr]))
        {
            int num = 0;
            while (str[ptrStr] != ' ')
            {
                num = num * 10 + (int)(str[ptrStr]) - (int)('0');
                ptrStr++;
            }
            stack[ptrStack] = num;
            ptrStack++;
        }
        else if (str[ptrStr] == '+')
        {
            stack[ptrStack - 2] += stack[ptrStack - 1];
            ptrStack--;
            ptrStr++;
        }
    return stack[0];
}
int main(void) {
    int i;
    int len = 0;
    scanf("%d ", &len);
    char *tab = calloc(len, sizeof(char));
    for (i = 0; i < len; i++)
    {
        char tmp = '\x00';
        scanf("%c", &tmp);
        tab[i] = tmp;
    }
    int result = npi0(tab, len);
    printf("%d", result);
    return 0;
}




<|start_filename|>out/aaa_05array.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init_withenv :: Int -> ( Int -> env -> IO(env, tabcontent)) -> env -> IO(env, IOArray Int tabcontent)
array_init_withenv len f env =
  do (env, li) <- g 0 env
     (,) env <$> newListArray (0, len - 1) li
  where g i env =
           if i == len
           then return (env, [])
           else do (env', item) <- f i env
                   (env'', li) <- g (i+1) env'
                   return (env'', item:li)

main :: IO ()
id0 b =
  return b

g t index =
  writeIOA t index False

main =
  (array_init_withenv 5 (\ i c ->
                           do printf "%d" (i :: Int) :: IO ()
                              let d = c + i
                              let e = (i `rem` 2) == 0
                              return (d, e)) 0) >>= (\ (f, a) ->
                                                      do printf "%d " (f::Int) :: IO()
                                                         ifM (readIOA a 0)
                                                             (printf "True" :: IO ())
                                                             (printf "False" :: IO ())
                                                         printf "\n" :: IO ()
                                                         join $ g <$> (id0 a) <*> return 0
                                                         ifM (readIOA a 0)
                                                             (printf "True" :: IO ())
                                                             (printf "False" :: IO ())
                                                         printf "\n" :: IO ())




<|start_filename|>out/aaa_00hello.lua<|end_filename|>

io.write("Hello World\n")


<|start_filename|>out/euler52.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
chiffre_sort a =
  if a < 10
  then return a
  else do b <- chiffre_sort (a `quot` 10)
          let c = a `rem` 10
          let d = b `rem` 10
          let e = b `quot` 10
          if c < d
          then return (c + b * 10)
          else (((+) d) <$> (((*) 10) <$> (chiffre_sort (c + e * 10))))

same_numbers a b c d e f =
  do ca <- chiffre_sort a
     (((((((==) ca) <$> (chiffre_sort b)) <&&> (((==) ca) <$> (chiffre_sort c))) <&&> (((==) ca) <$> (chiffre_sort d))) <&&> (((==) ca) <$> (chiffre_sort e))) <&&> (((==) ca) <$> (chiffre_sort f)))

main =
  ifM (same_numbers 142857 (142857 * 2) (142857 * 3) (142857 * 4) (142857 * 6) (142857 * 5))
      ((printf "%d %d %d %d %d %d\n" (142857::Int) ((142857 * 2)::Int) ((142857 * 3)::Int) ((142857 * 4)::Int) ((142857 * 5)::Int) ((142857 * 6)::Int)) :: IO())
      (return ())




<|start_filename|>out/tictactoe.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
\ 
\ Tictactoe : un tictactoe avec une IA
\ 

\  La structure de donnée 

struct
  cell% field ->cases
  cell% field ->firstToPlay
  cell% field ->note
  cell% field ->ended
end-struct gamestate%


\  Un Mouvement 

struct
  cell% field ->x
  cell% field ->y
end-struct move%


\  On affiche l'état 

: print_state { g }
  S\" \n|" TYPE
  2 0 BEGIN 2dup >= WHILE DUP { y }
    2 0 BEGIN 2dup >= WHILE DUP { x }
      g ->cases @  x cells +  @  y cells +  @ 0 =
      IF
        S"  " TYPE
      ELSE
        g ->cases @  x cells +  @  y cells +  @ 1 =
        IF
          S" O" TYPE
        ELSE
          S" X" TYPE
        THEN
      THEN
      S" |" TYPE
     1 + REPEAT 2DROP
    y 2 <>
    IF
      S\" \n|-|-|-|\n|" TYPE
    THEN
   1 + REPEAT 2DROP
  S\" \n" TYPE
;


\  On dit qui gagne (info stoquées dans g.ended et g.note ) 

: eval0 { g }
  0 { win }
  0 { freecase }
  2 0 BEGIN 2dup >= WHILE DUP { y }
    1 NEGATE { col }
    1 NEGATE { lin }
    2 0 BEGIN 2dup >= WHILE DUP { x }
      g ->cases @  x cells +  @  y cells +  @ 0 =
      IF
        freecase 1 + TO freecase
      THEN
      g ->cases @  x cells +  @  y cells +  @ { colv }
      g ->cases @  y cells +  @  x cells +  @ { linv }
      col 1 NEGATE = colv 0 <> AND
      IF
        colv TO col
      ELSE
        colv col <>
        IF
          2 NEGATE TO col
        THEN
      THEN
      lin 1 NEGATE = linv 0 <> AND
      IF
        linv TO lin
      ELSE
        linv lin <>
        IF
          2 NEGATE TO lin
        THEN
      THEN
     1 + REPEAT 2DROP
    col 0 >=
    IF
      col TO win
    ELSE
      lin 0 >=
      IF
        lin TO win
      THEN
    THEN
   1 + REPEAT 2DROP
  2 1 BEGIN 2dup >= WHILE DUP { x }
    g ->cases @  0 cells +  @  0 cells +  @ x = g ->cases @  1 cells +  @  1 cells +  @ x = AND g ->cases @  2 cells +  @  2 cells +  @ x = AND
    IF
      x TO win
    THEN
    g ->cases @  0 cells +  @  2 cells +  @ x = g ->cases @  1 cells +  @  1 cells +  @ x = AND g ->cases @  2 cells +  @  0 cells +  @ x = AND
    IF
      x TO win
    THEN
   1 + REPEAT 2DROP
  win 0 <> freecase 0 = OR g ->ended !
  win 1 =
  IF
    1000 g ->note !
  ELSE
    win 2 =
    IF
      1000 NEGATE g ->note !
    ELSE
      0 g ->note !
    THEN
  THEN
;


\  On applique un mouvement 

: apply_move_xy { x y g }
  2 { player }
  g ->firstToPlay @
  IF
    1 TO player
  THEN
  player g ->cases @  x cells +  @  y cells +  !
  g ->firstToPlay @ INVERT g ->firstToPlay !
;


: apply_move { m g }
  m ->x @ m ->y @ g apply_move_xy
;


: cancel_move_xy { x y g }
  0 g ->cases @  x cells +  @  y cells +  !
  g ->firstToPlay @ INVERT g ->firstToPlay !
  false g ->ended !
;


: cancel_move { m g }
  m ->x @ m ->y @ g cancel_move_xy
;


: can_move_xy { x y g }
  g ->cases @  x cells +  @  y cells +  @ 0 = exit
;


: can_move { m g }
  m ->x @ m ->y @ g can_move_xy exit
;


\ 
\ Un minimax classique, renvoie la note du plateau
\ 

: minmax recursive { g }
  g eval0
  g ->ended @
  IF
    g ->note @ exit
  THEN
  10000 NEGATE { maxNote }
  g ->firstToPlay @ INVERT
  IF
    10000 TO maxNote
  THEN
  2 0 BEGIN 2dup >= WHILE DUP { x }
    2 0 BEGIN 2dup >= WHILE DUP { y }
      x y g can_move_xy
      IF
        x y g apply_move_xy
        g minmax { currentNote }
        x y g cancel_move_xy
        \  Minimum ou Maximum selon le coté ou l'on joue
        
        currentNote maxNote > g ->firstToPlay @ =
        IF
          currentNote TO maxNote
        THEN
      THEN
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  maxNote exit
;


\ 
\ Renvoie le coup de l'IA
\ 

: play { g }
  move% %allot { minMove }
  0 minMove ->x !
  0 minMove ->y !
  10000 { minNote }
  2 0 BEGIN 2dup >= WHILE DUP { x }
    2 0 BEGIN 2dup >= WHILE DUP { y }
      x y g can_move_xy
      IF
        x y g apply_move_xy
        g minmax { currentNote }
        x s>d 0 d.r
        S" , " TYPE
        y s>d 0 d.r
        S" , " TYPE
        currentNote s>d 0 d.r
        S\" \n" TYPE
        x y g cancel_move_xy
        currentNote minNote <
        IF
          currentNote TO minNote
          x minMove ->x !
          y minMove ->y !
        THEN
      THEN
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  minMove ->x @ s>d 0 d.r
  minMove ->y @ s>d 0 d.r
  S\" \n" TYPE
  minMove exit
;


: init0 {  }
  HERE 3 cells allot { cases }
  2 0 BEGIN 2dup >= WHILE DUP { i }
    HERE 3 cells allot { tab }
    2 0 BEGIN 2dup >= WHILE DUP { j }
      0 tab  j cells +  !
     1 + REPEAT 2DROP
    tab cases  i cells +  !
   1 + REPEAT 2DROP
  gamestate% %allot { a }
  cases a ->cases !
  true a ->firstToPlay !
  0 a ->note !
  false a ->ended !
  a exit
;


: read_move {  }
  read-int { x }
  skipspaces
  read-int { y }
  skipspaces
  move% %allot { b }
  x b ->x !
  y b ->y !
  b exit
;

: main
  1 0 BEGIN 2dup >= WHILE DUP { i }
     init0 { state }
    move% %allot { c }
    1 c ->x !
    1 c ->y !
    c state apply_move
    move% %allot { d }
    0 d ->x !
    0 d ->y !
    d state apply_move
    BEGIN
      state ->ended @ INVERT
    WHILE
      state print_state
      state play state apply_move
      state eval0
      state print_state
      state ->ended @ INVERT
      IF
        state play state apply_move
        state eval0
      THEN
    REPEAT
    state print_state
    state ->note @ s>d 0 d.r
    S\" \n" TYPE
   1 + REPEAT 2DROP
  ;
main
BYE



<|start_filename|>out/euler07.java<|end_filename|>
import java.util.*;

public class euler07
{
  
  static boolean divisible(int n, int[] t, int size)
  {
    for (int i = 0; i < size; i++)
        if (n % t[i] == 0)
            return true;
    return false;
  }
  static int find(int n, int[] t, int used, int nth)
  {
    while (used != nth)
        if (divisible(n, t, used))
            n++;
        else
        {
            t[used] = n;
            n++;
            used++;
        }
    return t[used - 1];
  }
  public static void main(String args[])
  {
    int n = 10001;
    int[] t = new int[n];
    for (int i = 0; i < n; i++)
        t[i] = 2;
    System.out.printf("%d\n", find(3, t, 1, n));
  }
  
}



<|start_filename|>out/sqrttest.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include<cmath>

int main() {
    std::cout << (int)sqrt(4) << " " << (int)sqrt(16) << " " << (int)sqrt(20) << " " << (int)sqrt(1000) << " " << (int)sqrt(500) << " " << (int)sqrt(10) << " ";
}



<|start_filename|>out/euler19.go<|end_filename|>
package main
import "fmt"
func is_leap(year int) bool{
  return year % 400 == 0 || year % 100 != 0 && year % 4 == 0
}
func ndayinmonth(month int, year int) int{
  if month == 0 {
      return 31
  } else if month == 1 {
      if is_leap(year) {
          return 29
      } else {
          return 28
      }
  } else if month == 2 {
      return 31
  } else if month == 3 {
      return 30
  } else if month == 4 {
      return 31
  } else if month == 5 {
      return 30
  } else if month == 6 {
      return 31
  } else if month == 7 {
      return 31
  } else if month == 8 {
      return 30
  } else if month == 9 {
      return 31
  } else if month == 10 {
      return 30
  } else if month == 11 {
      return 31
  }
  return 0
}
func main() {
  month := 0
  year := 1901
  dayofweek := 1
  /* 01-01-1901 : mardi */
  count := 0
  for year != 2001 {
      ndays := ndayinmonth(month, year)
      dayofweek = (dayofweek + ndays) % 7
      month++
      if month == 12 {
          month = 0
          year++
      }
      if dayofweek % 7 == 6 {
          count++
      }
  }
  fmt.Printf("%d\n", count)
}



<|start_filename|>out/aaa_08tuple.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_08tuple is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type tuple_int_int;
type tuple_int_int_PTR is access tuple_int_int;
type tuple_int_int is record
  tuple_int_int_field_0 : Integer;
  tuple_int_int_field_1 : Integer;
end record;
type toto;
type toto_PTR is access toto;
type toto is record
  foo : tuple_int_int_PTR;
  bar : Integer;
end record;

  t : toto_PTR;
  f : tuple_int_int_PTR;
  e : tuple_int_int_PTR;
  d : Integer;
  c : Integer;
  bar_0 : Integer;
  b : Integer;
  a : Integer;
begin
  Get(bar_0);
  SkipSpaces;
  Get(c);
  SkipSpaces;
  Get(d);
  SkipSpaces;
  e := new tuple_int_int;
  e.tuple_int_int_field_0 := c;
  e.tuple_int_int_field_1 := d;
  t := new toto;
  t.foo := e;
  t.bar := bar_0;
  f := t.foo;
  a := f.tuple_int_int_field_0;
  b := f.tuple_int_int_field_1;
  PInt(a);
  PString(new char_array'( To_C(" ")));
  PInt(b);
  PString(new char_array'( To_C(" ")));
  PInt(t.bar);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/test_returns.cs<|end_filename|>
using System;

public class test_returns
{
  static bool is_pair(int i)
  {
    int j = 1;
    if (i < 10)
    {
        j = 2;
        if (i == 0)
        {
            j = 4;
            return true;
        }
        j = 3;
        if (i == 2)
        {
            j = 4;
            return true;
        }
        j = 5;
    }
    j = 6;
    if (i < 20)
    {
        if (i == 22)
            j = 0;
        j = 8;
    }
    return i % 2 == 0;
  }
  
  public static void Main(String[] args)
  {
    
  }
  
}



<|start_filename|>out/rot13.fs<|end_filename|>
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
: read-char current-char next-char ;
\ 
\ Ce test effectue un rot13 sur une chaine lue en entrée
\ 
: main
  read-int { strlen }
  skipspaces
  HERE strlen cells allot { tab4 }
  strlen 1 - 0 BEGIN 2dup >= WHILE DUP { toto }
    read-char { tmpc }
    tmpc { c }
    tmpc 32 <>
    IF
      c [char] a - 13 + 26 % [char] a + TO c
    THEN
    c tab4  toto cells +  !
   1 + REPEAT 2DROP
  strlen 1 - 0 BEGIN 2dup >= WHILE DUP { j }
    tab4  j cells +  @ EMIT
   1 + REPEAT 2DROP
  ;
main
BYE



<|start_filename|>out/euler46.groovy<|end_filename|>
import java.util.*

int eratostene(int[] t, int max0)
{
  int n = 0
  for (int i = 2; i < max0; i++)
      if (t[i] == i)
      {
          n++
          if (max0.intdiv(i) > i)
          {
              int j = i * i
              while (j < max0 && j > 0)
              {
                  t[j] = 0
                  j += i
              }
          }
      }
  return n
}

int maximumprimes = 6000
int[] era = new int[maximumprimes]
for (int j_ = 0; j_ < maximumprimes; j_++)
    era[j_] = j_
int nprimes = eratostene(era, maximumprimes)
int[] primes = new int[nprimes]
for (int o = 0; o < nprimes; o++)
    primes[o] = 0
int l = 0
for (int k = 2; k < maximumprimes; k++)
    if (era[k] == k)
    {
        primes[l] = k
        l++
    }
System.out.printf("%d == %d\n", l, nprimes)
boolean[] canbe = new boolean[maximumprimes]
for (int i_ = 0; i_ < maximumprimes; i_++)
    canbe[i_] = false
for (int i = 0; i < nprimes; i++)
    for (int j = 0; j < maximumprimes; j++)
    {
        int n = primes[i] + 2 * j * j
        if (n < maximumprimes)
            canbe[n] = true
    }
for (int m = 1; m <= maximumprimes; m++)
{
    int m2 = m * 2 + 1
    if (m2 < maximumprimes && !canbe[m2])
        System.out.printf("%d\n", m2)
}



<|start_filename|>out/euler19.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler19 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

function is_leap(year : in Integer) return Boolean is
begin
  return year rem 400 = 0 or else (year rem 100 /= 0 and then year rem 4 = 0);
end;
function ndayinmonth(month : in Integer; year : in Integer) return Integer is
begin
  if month = 0
  then
    return 31;
  else
    if month = 1
    then
      if is_leap(year)
      then
        return 29;
      else
        return 28;
      end if;
    else
      if month = 2
      then
        return 31;
      else
        if month = 3
        then
          return 30;
        else
          if month = 4
          then
            return 31;
          else
            if month = 5
            then
              return 30;
            else
              if month = 6
              then
                return 31;
              else
                if month = 7
                then
                  return 31;
                else
                  if month = 8
                  then
                    return 30;
                  else
                    if month = 9
                    then
                      return 31;
                    else
                      if month = 10
                      then
                        return 30;
                      else
                        if month = 11
                        then
                          return 31;
                        end if;
                      end if;
                    end if;
                  end if;
                end if;
              end if;
            end if;
          end if;
        end if;
      end if;
    end if;
  end if;
  return 0;
end;

  year : Integer;
  ndays : Integer;
  month : Integer;
  dayofweek : Integer;
  count : Integer;
begin
  month := 0;
  year := 1901;
  dayofweek := 1;
  -- 01-01-1901 : mardi 
  
  count := 0;
  while year /= 2001 loop
    ndays := ndayinmonth(month, year);
    dayofweek := (dayofweek + ndays) rem 7;
    month := month + 1;
    if month = 12
    then
      month := 0;
      year := year + 1;
    end if;
    if dayofweek rem 7 = 6
    then
      count := count + 1;
    end if;
  end loop;
  PInt(count);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/test_returns.fs<|end_filename|>
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: is_pair { i }
  1 { j }
  i 10 <
  IF
    2 TO j
    i 0 =
    IF
      4 TO j
      true exit
    THEN
    3 TO j
    i 2 =
    IF
      4 TO j
      true exit
    THEN
    5 TO j
  THEN
  6 TO j
  i 20 <
  IF
    i 22 =
    IF
      0 TO j
    THEN
    8 TO j
  THEN
  i 2 % 0 = exit
;

: main
  
  ;
main
BYE



<|start_filename|>out/aaa_readints.java<|end_filename|>
import java.util.*;

public class aaa_readints
{
  static Scanner scanner = new Scanner(System.in);
  static int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

  
  public static void main(String args[])
  {
    int len = Integer.parseInt(scanner.nextLine());
    System.out.printf("%d=len\n", len);
    int[] tab1 = read_int_line();
    for (int i = 0; i < len; i++)
        System.out.printf("%d=>%d\n", i, tab1[i]);
    len = Integer.parseInt(scanner.nextLine());
    int[][] tab2 = new int[len - 1][];
    for (int a = 0; a < len - 1; a++)
        tab2[a] = read_int_line();
    for (int i = 0; i < len - 1; i++)
    {
        for (int j = 0; j < len; j++)
            System.out.printf("%d ", tab2[i][j]);
        System.out.print("\n");
    }
  }
  
}



<|start_filename|>out/euler21.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int eratostene(int* t, int max0) {
    int i;
    int n = 0;
    for (i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            int j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
}

int fillPrimesFactors(int* t, int n, int* primes, int nprimes) {
    int i;
    for (i = 0; i < nprimes; i++)
    {
        int d = primes[i];
        while (n % d == 0)
        {
            t[d]++;
            n /= d;
        }
        if (n == 1)
            return primes[i];
    }
    return n;
}

int sumdivaux2(int* t, int n, int i) {
    while (i < n && t[i] == 0)
        i++;
    return i;
}

int sumdivaux(int* t, int n, int i) {
    int j;
    if (i > n)
        return 1;
    else if (t[i] == 0)
        return sumdivaux(t, n, sumdivaux2(t, n, i + 1));
    else
    {
        int o = sumdivaux(t, n, sumdivaux2(t, n, i + 1));
        int out0 = 0;
        int p = i;
        for (j = 1; j <= t[i]; j++)
        {
            out0 += p;
            p *= i;
        }
        return (out0 + 1) * o;
    }
}

int sumdiv(int nprimes, int* primes, int n) {
    int i;
    int *t = calloc(n + 1, sizeof(int));
    for (i = 0; i <= n; i++)
        t[i] = 0;
    int max0 = fillPrimesFactors(t, n, primes, nprimes);
    return sumdivaux(t, max0, 0);
}
int main(void) {
    int n, k, o, j;
    int maximumprimes = 1001;
    int *era = calloc(maximumprimes, sizeof(int));
    for (j = 0; j < maximumprimes; j++)
        era[j] = j;
    int nprimes = eratostene(era, maximumprimes);
    int *primes = calloc(nprimes, sizeof(int));
    for (o = 0; o < nprimes; o++)
        primes[o] = 0;
    int l = 0;
    for (k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    printf("%d == %d\n", l, nprimes);
    int sum = 0;
    for (n = 2; n < 1001; n++)
    {
        int other = sumdiv(nprimes, primes, n) - n;
        if (other > n)
        {
            int othersum = sumdiv(nprimes, primes, other) - other;
            if (othersum == n)
            {
                printf("%d & %d\n", other, n);
                sum += other + n;
            }
        }
    }
    printf("\n%d\n", sum);
    return 0;
}




<|start_filename|>out/aaa_06readcouple.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}

func main() {
  reader = bufio.NewReader(os.Stdin)
  for i := 1; i < 4; i++ {
      var b int
      var a int
      fmt.Fscanf(reader, "%d", &a)
      skip()
      fmt.Fscanf(reader, "%d", &b)
      skip()
      fmt.Printf("a = %d b = %d\n", a, b)
  }
  var l []int = make([]int, 10)
  for c := 0; c < 10; c++ {
      fmt.Fscanf(reader, "%d", &l[c])
      skip()
  }
  for j := 0; j < 10; j++ {
      fmt.Printf("%d\n", l[j])
  }
}



<|start_filename|>out/prologin_template_intlist.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure prologin_template_intlist is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type b is Array (Integer range <>) of Integer;
type b_PTR is access b;
function programme_candidat(tableau : in b_PTR; taille : in Integer) return Integer is
  out0 : Integer;
begin
  out0 := 0;
  for i in integer range 0..taille - 1 loop
    out0 := out0 + tableau(i);
  end loop;
  return out0;
end;

  taille : Integer;
  tableau : b_PTR;
begin
  Get(taille);
  SkipSpaces;
  tableau := new b (0..taille - 1);
  for a in integer range 0..taille - 1 loop
    Get(tableau(a));
    SkipSpaces;
  end loop;
  PInt(programme_candidat(tableau, taille));
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler22.java<|end_filename|>
import java.util.*;

public class euler22
{
  static Scanner scanner = new Scanner(System.in);
  static int score()
  {
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int len;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      len = scanner.nextInt();
    } else {
      len = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int sum = 0;
    for (int i = 1; i <= len; i++)
    {
        char c = scanner.findWithinHorizon(".", 1).charAt(0);
        sum += (int)(c) - (int)('A') + 1;
        // 		print c print " " print sum print " " 
    }
    return sum;
  }
  public static void main(String args[])
  {
    int sum = 0;
    int n;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      n = scanner.nextInt();
    } else {
      n = scanner.nextInt();
    }
    for (int i = 1; i <= n; i++)
        sum += i * score();
    System.out.printf("%d\n", sum);
  }
  
}



<|start_filename|>out/small_inline.cpp<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    std::vector<int> t( 2 );
    for (int d = 0; d < 2; d++)
    {
        std::cin >> t[d];
    }
    std::cout << t[0] << " - " << t[1] << "\n";
}



<|start_filename|>out/euler52.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: chiffre_sort recursive { a }
  a 10 <
  IF
    a exit
  ELSE
    a 10 // chiffre_sort { b }
    a 10 % { c }
    b 10 % { d }
    b 10 // { e }
    c d <
    IF
      c b 10 * + exit
    ELSE
      d c e 10 * + chiffre_sort 10 * + exit
    THEN
  THEN
;


: same_numbers { a b c d e f }
  a chiffre_sort { ca }
  ca b chiffre_sort = ca c chiffre_sort = AND ca d chiffre_sort = AND ca e chiffre_sort = AND ca f chiffre_sort = AND exit
;

: main
  142857 { num }
  num num 2 * num 3 * num 4 * num 6 * num 5 * same_numbers
  IF
    num s>d 0 d.r
    S"  " TYPE
    num 2 * s>d 0 d.r
    S"  " TYPE
    num 3 * s>d 0 d.r
    S"  " TYPE
    num 4 * s>d 0 d.r
    S"  " TYPE
    num 5 * s>d 0 d.r
    S"  " TYPE
    num 6 * s>d 0 d.r
    S\" \n" TYPE
  THEN
  ;
main
BYE



<|start_filename|>out/linkedList.java<|end_filename|>
import java.util.*;

public class linkedList
{
  static Scanner scanner = new Scanner(System.in);
  static class intlist {
    public int head;
    public intlist tail;
  }
  static intlist cons(intlist list, int i)
  {
    intlist out0 = new intlist();
    out0.head = i;
    out0.tail = list;
    return out0;
  }
  static boolean is_empty(intlist foo)
  {
    return true;
  }
  static intlist rev2(intlist acc, intlist torev)
  {
    if (is_empty(torev))
        return acc;
    else
    {
        intlist acc2 = new intlist();
        acc2.head = torev.head;
        acc2.tail = acc;
        return rev2(acc, torev.tail);
    }
  }
  static intlist rev(intlist empty, intlist torev)
  {
    return rev2(empty, torev);
  }
  static void test(intlist empty)
  {
    intlist list = empty;
    int i = -1;
    while (i != 0)
    {
        if (scanner.hasNext("^-")) {
          scanner.next("^-");
          i = -scanner.nextInt();
        }else{
          i = scanner.nextInt();
        }
        if (i != 0)
            list = cons(list, i);
    }
  }
  public static void main(String args[])
  {
    
  }
  
}



<|start_filename|>out/prologin_template_charmatrix.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure prologin_template_charmatrix is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PChar(c : in Character) is
begin
  Character'Write (Text_Streams.Stream (Current_Output), c);
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type e is Array (Integer range <>) of Character;
type e_PTR is access e;
type f is Array (Integer range <>) of e_PTR;
type f_PTR is access f;
function programme_candidat(tableau : in f_PTR; taille_x : in Integer; taille_y : in Integer) return Integer is
  out0 : Integer;
begin
  out0 := 0;
  for i in integer range 0..taille_y - 1 loop
    for j in integer range 0..taille_x - 1 loop
      out0 := out0 + Character'Pos(tableau(i)(j)) * (i + j * 2);
      PChar(tableau(i)(j));
    end loop;
    PString(new char_array'( To_C("--" & Character'Val(10))));
  end loop;
  return out0;
end;

  taille_y : Integer;
  taille_x : Integer;
  tableau : f_PTR;
  c : e_PTR;
  a : f_PTR;
begin
  Get(taille_x);
  SkipSpaces;
  Get(taille_y);
  SkipSpaces;
  a := new f (0..taille_y - 1);
  for b in integer range 0..taille_y - 1 loop
    c := new e (0..taille_x - 1);
    for d in integer range 0..taille_x - 1 loop
      Get(c(d));
    end loop;
    SkipSpaces;
    a(b) := c;
  end loop;
  tableau := a;
  PInt(programme_candidat(tableau, taille_x, taille_y));
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/brainfuck_compiler.lua<|end_filename|>
--[[
Ce test permet de tester les macros
C'est un compilateur brainfuck qui lit sur l'entrée standard pendant la compilation
et qui produit les macros metalang correspondante
--]]

local input = 32
local current_pos = 500
local mem = {}
for i = 0, 999 do
    mem[i + 1] = 0
end
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
current_pos = current_pos + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
mem[current_pos + 1] = mem[current_pos + 1] + 1
while mem[current_pos + 1] ~= 0 do
    mem[current_pos + 1] = mem[current_pos + 1] - 1
    current_pos = current_pos - 1
    mem[current_pos + 1] = mem[current_pos + 1] + 1
    io.write(string.format("%c", mem[current_pos + 1]))
    current_pos = current_pos + 1
end


<|start_filename|>out/euler50.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler50 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

function min2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a < b
  then
    return a;
  else
    return b;
  end if;
end;
type c is Array (Integer range <>) of Integer;
type c_PTR is access c;
function eratostene(t : in c_PTR; max0 : in Integer) return Integer is
  n : Integer;
  j : Integer;
begin
  n := 0;
  for i in integer range 2..max0 - 1 loop
    if t(i) = i
    then
      n := n + 1;
      if max0 / i > i
      then
        j := i * i;
        while j < max0 and then j > 0 loop
          t(j) := 0;
          j := j + i;
        end loop;
      end if;
    end if;
  end loop;
  return n;
end;

  sum : c_PTR;
  stop : Integer;
  resp : Integer;
  process : Boolean;
  primes : c_PTR;
  nprimes : Integer;
  maxl : Integer;
  maximumprimes : Integer;
  len : Integer;
  l : Integer;
  era : c_PTR;
begin
  maximumprimes := 1000001;
  era := new c (0..maximumprimes - 1);
  for j in integer range 0..maximumprimes - 1 loop
    era(j) := j;
  end loop;
  nprimes := eratostene(era, maximumprimes);
  primes := new c (0..nprimes - 1);
  for o in integer range 0..nprimes - 1 loop
    primes(o) := 0;
  end loop;
  l := 0;
  for k in integer range 2..maximumprimes - 1 loop
    if era(k) = k
    then
      primes(l) := k;
      l := l + 1;
    end if;
  end loop;
  PInt(l);
  PString(new char_array'( To_C(" == ")));
  PInt(nprimes);
  PString(new char_array'( To_C("" & Character'Val(10))));
  sum := new c (0..nprimes - 1);
  for i_0 in integer range 0..nprimes - 1 loop
    sum(i_0) := primes(i_0);
  end loop;
  maxl := 0;
  process := TRUE;
  stop := maximumprimes - 1;
  len := 1;
  resp := 1;
  while process loop
    process := FALSE;
    for i in integer range 0..stop loop
      if i + len < nprimes
      then
        sum(i) := sum(i) + primes(i + len);
        if maximumprimes > sum(i)
        then
          process := TRUE;
          if era(sum(i)) = sum(i)
          then
            maxl := len;
            resp := sum(i);
          end if;
        else
          stop := min2_0(stop, i);
        end if;
      end if;
    end loop;
    len := len + 1;
  end loop;
  PInt(resp);
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(maxl);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler32.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler32 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
--
--We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once;
--for example, the 5-digit number, 15234, is 1 through 5 pandigital.
--
--The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier,
--and product is 1 through 9 pandigital.
--
--Find the sum of all products whose multiplicand/multiplier/product identity can be written as a
--1 through 9 pandigital.
--
--HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.
--
--
--(a * 10 + b) ( c * 100 + d * 10 + e) =
--  a * c * 1000 +
--  a * d * 100 +
--  a * e * 10 +
--  b * c * 100 +
--  b * d * 10 +
--  b * e
--  => b != e != b * e % 10 ET
--  a != d != (b * e / 10 + b * d + a * e ) % 10
--

type f is Array (Integer range <>) of Boolean;
type f_PTR is access f;
function okdigits(ok : in f_PTR; n : in Integer) return Boolean is
  o : Boolean;
  digit : Integer;
begin
  if n = 0
  then
    return TRUE;
  else
    digit := n rem 10;
    if ok(digit)
    then
      ok(digit) := FALSE;
      o := okdigits(ok, n / 10);
      ok(digit) := TRUE;
      return o;
    else
      return FALSE;
    end if;
  end if;
end;

  product2 : Integer;
  product : Integer;
  counted : f_PTR;
  count : Integer;
  be : Integer;
  allowed : f_PTR;
begin
  count := 0;
  allowed := new f (0..9);
  for i in integer range 0..9 loop
    allowed(i) := i /= 0;
  end loop;
  counted := new f (0..99999);
  for j in integer range 0..99999 loop
    counted(j) := FALSE;
  end loop;
  for e in integer range 1..9 loop
    allowed(e) := FALSE;
    for b in integer range 1..9 loop
      if allowed(b)
      then
        allowed(b) := FALSE;
        be := b * e rem 10;
        if allowed(be)
        then
          allowed(be) := FALSE;
          for a in integer range 1..9 loop
            if allowed(a)
            then
              allowed(a) := FALSE;
              for c in integer range 1..9 loop
                if allowed(c)
                then
                  allowed(c) := FALSE;
                  for d in integer range 1..9 loop
                    if allowed(d)
                    then
                      allowed(d) := FALSE;
                      -- 2 * 3 digits 
                      
                      product := (a * 10 + b) * (c * 100 + d * 10 + e);
                      if
                      not counted(product) and then okdigits(allowed, product / 10)
                      then
                        counted(product) := TRUE;
                        count := count + product;
                        PInt(product);
                        PString(new char_array'( To_C(" ")));
                      end if;
                      -- 1  * 4 digits 
                      
                      product2 := b * (a * 1000 + c * 100 + d * 10 + e);
                      if
                      not counted(product2) and then okdigits(allowed, product2 / 10)
                      then
                        counted(product2) := TRUE;
                        count := count + product2;
                        PInt(product2);
                        PString(new char_array'( To_C(" ")));
                      end if;
                      allowed(d) := TRUE;
                    end if;
                  end loop;
                  allowed(c) := TRUE;
                end if;
              end loop;
              allowed(a) := TRUE;
            end if;
          end loop;
          allowed(be) := TRUE;
        end if;
        allowed(b) := TRUE;
      end if;
    end loop;
    allowed(e) := TRUE;
  end loop;
  PInt(count);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler09.go<|end_filename|>
package main
import "fmt"

func main() {
  /*
	a + b + c = 1000 && a * a + b * b = c * c
	*/
  for a := 1; a < 1001; a++ {
      for b := a + 1; b < 1001; b++ {
          c := 1000 - a - b
          a2b2 := a * a + b * b
          cc := c * c
          if cc == a2b2 && c > a {
              fmt.Printf("%d\n%d\n%d\n%d\n", a, b, c, a * b * c)
          }
      }
  }
}



<|start_filename|>out/pathfinding.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
pathfind_aux cache tab x y posX posY =
  if posX == x - 1 && posY == y - 1
  then return 0
  else if ((posX < 0 || posY < 0) || posX >= x) || posY >= y
       then return (x * y * 10)
       else ifM (((==) '#') <$> (join $ readIOA <$> (readIOA tab posY) <*> return posX))
                (return (x * y * 10))
                (ifM (((/=) (- 1)) <$> (join $ readIOA <$> (readIOA cache posY) <*> return posX))
                     (join $ readIOA <$> (readIOA cache posY) <*> return posX)
                     (do join $ writeIOA <$> (readIOA cache posY) <*> return posX <*> return (x * y * 10)
                         val1 <- pathfind_aux cache tab x y (posX + 1) posY
                         val2 <- pathfind_aux cache tab x y (posX - 1) posY
                         val3 <- pathfind_aux cache tab x y posX (posY - 1)
                         val4 <- pathfind_aux cache tab x y posX (posY + 1)
                         let out0 = 1 + (min (min (min val1 val2) val3) val4)
                         join $ writeIOA <$> (readIOA cache posY) <*> return posX <*> return out0
                         return out0))

pathfind tab x y =
  do cache <- array_init y (\ i ->
                              array_init x (\ j ->
                                              return (- 1)))
     pathfind_aux cache tab x y 0 0

main =
  do x <- read_int
     skip_whitespaces
     y <- read_int
     skip_whitespaces
     tab <- array_init y (\ i ->
                            do tab2 <- array_init x (\ j ->
                                                       getChar)
                               skip_whitespaces
                               return tab2)
     result <- pathfind tab x y
     printf "%d" (result :: Int) :: IO ()




<|start_filename|>out/aaa_02if.java<|end_filename|>
import java.util.*;

public class aaa_02if
{
  
  static boolean f(int i)
  {
    if (i == 0)
        return true;
    return false;
  }
  public static void main(String args[])
  {
    if (f(4))
        System.out.print("true <-\n ->\n");
    else
        System.out.print("false <-\n ->\n");
    System.out.print("small test end\n");
  }
  
}



<|start_filename|>out/euler06.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end

local lim = 100
local sum = trunc(lim * (lim + 1) / 2)
local carressum = sum * sum
local sumcarres = trunc(lim * (lim + 1) * (2 * lim + 1) / 6)
io.write(carressum - sumcarres)


<|start_filename|>out/aaa_integer.go<|end_filename|>
package main
import "fmt"

func main() {
  i := 0
  i--
  fmt.Printf("%d\n", i)
  i += 55
  fmt.Printf("%d\n", i)
  i *= 13
  fmt.Printf("%d\n", i)
  i /= 2
  fmt.Printf("%d\n", i)
  i++
  fmt.Printf("%d\n", i)
  i /= 3
  fmt.Printf("%d\n", i)
  i--
  fmt.Printf("%d\n", i)
  /*
http://fr.wikipedia.org/wiki/Modulo_(op%C3%A9ration)#Trois_d.C3.A9finitions_de_la_fonction_modulo
*/
  fmt.Printf("%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n", 117 / 17, 117 / -17, -117 / 17, -117 / -17, 117 % 17, 117 % -17, -117 % 17, -117 % -17)
}



<|start_filename|>out/montagnes.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure montagnes is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function montagnes0(tab : in a_PTR; len : in Integer) return Integer is
  x : Integer;
  max0 : Integer;
  j : Integer;
  i : Integer;
begin
  max0 := 1;
  j := 1;
  i := len - 2;
  while i >= 0 loop
    x := tab(i);
    while j >= 0 and then x > tab(len - j) loop
      j := j - 1;
    end loop;
    j := j + 1;
    tab(len - j) := x;
    if j > max0
    then
      max0 := j;
    end if;
    i := i - 1;
  end loop;
  return max0;
end;

  x : Integer;
  tab : a_PTR;
  len : Integer;
begin
  len := 0;
  Get(len);
  SkipSpaces;
  tab := new a (0..len - 1);
  for i in integer range 0..len - 1 loop
    x := 0;
    Get(x);
    SkipSpaces;
    tab(i) := x;
  end loop;
  PInt(montagnes0(tab, len));
end;


<|start_filename|>out/euler09.js<|end_filename|>
var util = require("util");

/*
	a + b + c = 1000 && a * a + b * b = c * c
	*/
for (var a = 1; a < 1001; a++)
    for (var b = a + 1; b < 1001; b++)
    {
        var c = 1000 - a - b;
        var a2b2 = a * a + b * b;
        var cc = c * c;
        if (cc == a2b2 && c > a)
            util.print(a, "\n", b, "\n", c, "\n", a * b * c, "\n");
    }



<|start_filename|>out/record2.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0

main :: IO ()
data Toto = Toto {
                    _foo :: IORef Int,
                    _bar :: IORef Int,
                    _blah :: IORef Int
                    }
  deriving Eq


mktoto v1 =
  (Toto <$> (newIORef v1) <*> (newIORef 0) <*> (newIORef 0))

result t =
  do writeIORef (_blah t) =<< (((+) 1) <$> (readIORef (_blah t)))
     ((+) <$> ((+) <$> (readIORef (_foo t)) <*> ((*) <$> (readIORef (_blah t)) <*> (readIORef (_bar t)))) <*> ((*) <$> (readIORef (_bar t)) <*> (readIORef (_foo t))))

main =
  do t <- mktoto 4
     a <- read_int
     writeIORef (_bar t) a
     skip_whitespaces
     b <- read_int
     writeIORef (_blah t) b
     printf "%d" =<< (result t :: IO Int)




<|start_filename|>out/euler36.cc<|end_filename|>
#include <iostream>
#include <vector>

bool palindrome2(std::vector<int> * pow2, int n) {
    std::vector<bool> *t = new std::vector<bool>( 20 );
    for (int i = 0; i < 20; i++)
        t->at(i) = n / pow2->at(i) % 2 == 1;
    int nnum = 0;
    for (int j = 1; j < 20; j++)
        if (t->at(j))
            nnum = j;
    for (int k = 0; k <= nnum / 2; k++)
        if (t->at(k) != t->at(nnum - k))
            return false;
    return true;
}

int main() {
    int p = 1;
    std::vector<int> *pow2 = new std::vector<int>( 20 );
    for (int i = 0; i < 20; i++)
    {
        p *= 2;
        pow2->at(i) = p / 2;
    }
    int sum = 0;
    for (int d = 1; d < 10; d++)
    {
        if (palindrome2(pow2, d))
        {
            std::cout << d << "\n";
            sum += d;
        }
        if (palindrome2(pow2, d * 10 + d))
        {
            std::cout << d * 10 + d << "\n";
            sum += d * 10 + d;
        }
    }
    for (int a0 = 0; a0 < 5; a0++)
    {
        int a = a0 * 2 + 1;
        for (int b = 0; b < 10; b++)
        {
            for (int c = 0; c < 10; c++)
            {
                int num0 = a * 100000 + b * 10000 + c * 1000 + c * 100 + b * 10 + a;
                if (palindrome2(pow2, num0))
                {
                    std::cout << num0 << "\n";
                    sum += num0;
                }
                int num1 = a * 10000 + b * 1000 + c * 100 + b * 10 + a;
                if (palindrome2(pow2, num1))
                {
                    std::cout << num1 << "\n";
                    sum += num1;
                }
            }
            int num2 = a * 100 + b * 10 + a;
            if (palindrome2(pow2, num2))
            {
                std::cout << num2 << "\n";
                sum += num2;
            }
            int num3 = a * 1000 + b * 100 + b * 10 + a;
            if (palindrome2(pow2, num3))
            {
                std::cout << num3 << "\n";
                sum += num3;
            }
        }
    }
    std::cout << "sum=" << sum << "\n";
}



<|start_filename|>out/brainfuck_compiler.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
main =
  do mem <- array_init 1000 (\ i ->
                               return 0)
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     writeIOA mem 500 =<< (((+) 1) <$> (readIOA mem 500))
     let a = 500 + 1
     writeIOA mem a =<< (((+) 1) <$> (readIOA mem a))
     writeIOA mem a =<< (((+) 1) <$> (readIOA mem a))
     writeIOA mem a =<< (((+) 1) <$> (readIOA mem a))
     writeIOA mem a =<< (((+) 1) <$> (readIOA mem a))
     writeIOA mem a =<< (((+) 1) <$> (readIOA mem a))
     writeIOA mem a =<< (((+) 1) <$> (readIOA mem a))
     writeIOA mem a =<< (((+) 1) <$> (readIOA mem a))
     writeIOA mem a =<< (((+) 1) <$> (readIOA mem a))
     writeIOA mem a =<< (((+) 1) <$> (readIOA mem a))
     writeIOA mem a =<< (((+) 1) <$> (readIOA mem a))
     let b c =
           ifM (((/=) 0) <$> (readIOA mem c))
               (do writeIOA mem c =<< ((-) <$> (readIOA mem c) <*> (return 1))
                   let d = c - 1
                   writeIOA mem d =<< (((+) 1) <$> (readIOA mem d))
                   printf "%c" =<< ((fmap chr (readIOA mem d)) :: IO Char)
                   let e = d + 1
                   b e)
               (return ()) in
           b a




<|start_filename|>out/euler42.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0

main :: IO ()
is_triangular n =
  {-
   n = k * (k + 1) / 2
	  n * 2 = k * (k + 1)
   -}
  let a = ((floor . sqrt . fromIntegral) (n * 2))
          in return (a * (a + 1) == n * 2)

score () =
  do skip_whitespaces
     len <- read_int
     skip_whitespaces
     let b i d =
           if i <= len
           then do c <- getChar
                   let e = d + (ord c) - (ord 'A') + 1
                   {-		print c print " " print sum print " " -}
                   b (i + 1) e
           else ifM (is_triangular d)
                    (return 1)
                    (return 0) in
           b 1 0

main =
  let f i =
        if i <= 55
        then ifM (is_triangular i)
                 (do printf "%d " (i::Int) :: IO()
                     f (i + 1))
                 (f (i + 1))
        else do printf "\n" :: IO ()
                n <- read_int
                let g h j =
                      if h <= n
                      then do k <- (((+) j) <$> (score ()))
                              g (h + 1) k
                      else printf "%d\n" (j::Int) :: IO() in
                      g 1 0 in
        f 1




<|start_filename|>out/calc.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
fibo a b i =
  let c j d e f =
        if j <= i + 1
        then do printf "%d" (j :: Int) :: IO ()
                let g = f + d
                let h = e + d
                c (j + 1) e h g
        else return f in
        c 0 a b 0

main =
  printf "%d" =<< (fibo 1 2 4 :: IO Int)




<|start_filename|>out/euler14.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function next0 (n)
  if math.fmod(n, 2) == 0 then
      return trunc(n / 2)
  else 
      return 3 * n + 1
  end
end

function find (n, m)
  if n == 1 then
      return 1
  elseif n >= 1000000 then
      return 1 + find(next0(n), m)
  elseif m[n + 1] ~= 0 then
      return m[n + 1]
  else 
      m[n + 1] = 1 + find(next0(n), m)
      return m[n + 1]
  end
end

local m = {}
for j = 0, 999999 do
    m[j + 1] = 0
end
local max0 = 0
local maxi = 0
for i = 1, 999 do
    --[[ normalement on met 999999 mais ça dépasse les int32... --]]
    local n2 = find(i, m)
    if n2 > max0 then
        max0 = n2
        maxi = i
    end
end
io.write(string.format("%d\n%d\n", max0, maxi))


<|start_filename|>out/tictactoe.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
/*
Tictactoe : un tictactoe avec une IA
*/
//  La structure de donnée 

type gamestate struct {
  cases [][]int;
  firstToPlay bool;
  note int;
  ended bool;
}
//  Un Mouvement 

type move struct {
  x int;
  y int;
}
//  On affiche l'état 
func print_state(g * gamestate) {
  fmt.Printf("\n|")
  for y := 0; y < 3; y++ {
      for x := 0; x < 3; x++ {
          if (*g).cases[x][y] == 0 {
              fmt.Printf(" ")
          } else if (*g).cases[x][y] == 1 {
              fmt.Printf("O")
          } else {
              fmt.Printf("X")
          }
          fmt.Printf("|")
      }
      if y != 2 {
          fmt.Printf("\n|-|-|-|\n|")
      }
  }
  fmt.Printf("\n")
}
//  On dit qui gagne (info stoquées dans g.ended et g.note ) 
func eval0(g * gamestate) {
  win := 0
  freecase := 0
  for y := 0; y < 3; y++ {
      col := -1
      lin := -1
      for x := 0; x < 3; x++ {
          if (*g).cases[x][y] == 0 {
              freecase++
          }
          colv := (*g).cases[x][y]
          linv := (*g).cases[y][x]
          if col == -1 && colv != 0 {
              col = colv
          } else if colv != col {
              col = -2
          }
          if lin == -1 && linv != 0 {
              lin = linv
          } else if linv != lin {
              lin = -2
          }
      }
      if col >= 0 {
          win = col
      } else if lin >= 0 {
          win = lin
      }
  }
  for x := 1; x < 3; x++ {
      if (*g).cases[0][0] == x && (*g).cases[1][1] == x && (*g).cases[2][2] == x {
          win = x
      }
      if (*g).cases[0][2] == x && (*g).cases[1][1] == x && (*g).cases[2][0] == x {
          win = x
      }
  }
  (*g).ended = win != 0 || freecase == 0
  if win == 1 {
      (*g).note = 1000
  } else if win == 2 {
      (*g).note = -1000
  } else {
      (*g).note = 0
  }
}
//  On applique un mouvement 
func apply_move_xy(x int, y int, g * gamestate) {
  player := 2
  if (*g).firstToPlay {
      player = 1
  }
  (*g).cases[x][y] = player
  (*g).firstToPlay = !(*g).firstToPlay
}
func apply_move(m * move, g * gamestate) {
  apply_move_xy((*m).x, (*m).y, g)
}
func cancel_move_xy(x int, y int, g * gamestate) {
  (*g).cases[x][y] = 0
  (*g).firstToPlay = !(*g).firstToPlay
  (*g).ended = false
}
func cancel_move(m * move, g * gamestate) {
  cancel_move_xy((*m).x, (*m).y, g)
}
func can_move_xy(x int, y int, g * gamestate) bool{
  return (*g).cases[x][y] == 0
}
func can_move(m * move, g * gamestate) bool{
  return can_move_xy((*m).x, (*m).y, g)
}
/*
Un minimax classique, renvoie la note du plateau
*/
func minmax(g * gamestate) int{
  eval0(g)
  if (*g).ended {
      return (*g).note
  }
  maxNote := -10000
  if !(*g).firstToPlay {
      maxNote = 10000
  }
  for x := 0; x < 3; x++ {
      for y := 0; y < 3; y++ {
          if can_move_xy(x, y, g) {
              apply_move_xy(x, y, g)
              currentNote := minmax(g)
              cancel_move_xy(x, y, g)
              /* Minimum ou Maximum selon le coté ou l'on joue*/
              if currentNote > maxNote == (*g).firstToPlay {
                  maxNote = currentNote
              }
          }
      }
  }
  return maxNote
}
/*
Renvoie le coup de l'IA
*/
func play(g * gamestate) * move{
  var minMove * move = new (move)
      (*minMove).x=0
      (*minMove).y=0
  minNote := 10000
  for x := 0; x < 3; x++ {
      for y := 0; y < 3; y++ {
          if can_move_xy(x, y, g) {
              apply_move_xy(x, y, g)
              currentNote := minmax(g)
              fmt.Printf("%d, %d, %d\n", x, y, currentNote)
              cancel_move_xy(x, y, g)
              if currentNote < minNote {
                  minNote = currentNote
                  (*minMove).x = x
                  (*minMove).y = y
              }
          }
      }
  }
  fmt.Printf("%d%d\n", (*minMove).x, (*minMove).y)
  return minMove
}
func init0() * gamestate{
  var cases [][]int = make([][]int, 3)
  for i := 0; i < 3; i++ {
      var tab []int = make([]int, 3)
      for j := 0; j < 3; j++ {
          tab[j] = 0
      }
      cases[i] = tab
  }
  var a * gamestate = new (gamestate)
      (*a).cases=cases
      (*a).firstToPlay=true
      (*a).note=0
      (*a).ended=false
  return a
}
func read_move() * move{
  var y int
  var x int
  fmt.Fscanf(reader, "%d", &x)
  skip()
  fmt.Fscanf(reader, "%d", &y)
  skip()
  var b * move = new (move)
      (*b).x=x
      (*b).y=y
  return b
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  for i := 0; i < 2; i++ {
      var state * gamestate = init0()
      var c * move = new (move)
          (*c).x=1
          (*c).y=1
      apply_move(c, state)
      var d * move = new (move)
          (*d).x=0
          (*d).y=0
      apply_move(d, state)
      for !(*state).ended {
          print_state(state)
          apply_move(play(state), state)
          eval0(state)
          print_state(state)
          if !(*state).ended {
              apply_move(play(state), state)
              eval0(state)
          }
      }
      print_state(state)
      fmt.Printf("%d\n", (*state).note)
  }
}



<|start_filename|>out/euler06.go<|end_filename|>
package main
import "fmt"

func main() {
  lim := 100
  sum := lim * (lim + 1) / 2
  carressum := sum * sum
  sumcarres := lim * (lim + 1) * (2 * lim + 1) / 6
  fmt.Printf("%d", carressum - sumcarres)
}



<|start_filename|>out/euler06.cpp<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    int lim = 100;
    int sum = lim * (lim + 1) / 2;
    int carressum = sum * sum;
    int sumcarres = lim * (lim + 1) * (2 * lim + 1) / 6;
    std::cout << carressum - sumcarres;
}



<|start_filename|>out/euler30.fs<|end_filename|>
: main
  \ 
  \ a + b * 10 + c * 100 + d * 1000 + e * 10 000 =
  \   a ^ 5 +
  \   b ^ 5 +
  \   c ^ 5 +
  \   d ^ 5 +
  \   e ^ 5
  \ 
  
  HERE 10 cells allot { p }
  9 0 BEGIN 2dup >= WHILE DUP { i }
    i i * i * i * i * p  i cells +  !
   1 + REPEAT 2DROP
  0 { sum }
  9 0 BEGIN 2dup >= WHILE DUP { a }
    9 0 BEGIN 2dup >= WHILE DUP { b }
      9 0 BEGIN 2dup >= WHILE DUP { c }
        9 0 BEGIN 2dup >= WHILE DUP { d }
          9 0 BEGIN 2dup >= WHILE DUP { e }
            9 0 BEGIN 2dup >= WHILE DUP { f }
              p  a cells +  @ p  b cells +  @ + p  c cells +  @ + p  d cells +  @ + p  e cells +  @ + p  f cells +  @ +
              { s }
              a b 10 * + c 100 * + d 1000 * + e 10000 * + f 100000 * + { r }
              s r = r 1 <> AND
              IF
                f s>d 0 d.r
                e s>d 0 d.r
                d s>d 0 d.r
                c s>d 0 d.r
                b s>d 0 d.r
                a s>d 0 d.r
                S"  " TYPE
                r s>d 0 d.r
                S\" \n" TYPE
                sum r + TO sum
              THEN
             1 + REPEAT 2DROP
           1 + REPEAT 2DROP
         1 + REPEAT 2DROP
       1 + REPEAT 2DROP
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  sum s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/euler28.groovy<|end_filename|>
import java.util.*

/*

43 44 45 46 47 48 49
42 21 22 23 24 25 26
41 20  7  8  9 10 27
40 19  6  1  2 11 28
39 18  5  4  3 12 29
38 17 16 15 14 13 30
37 36 35 34 33 32 31

1 3 5 7 9 13 17 21 25 31 37 43 49
  2 2 2 2 4  4  4  4  6   6  6  6


*/
int sumdiag(int n)
{
  int nterms = n * 2 - 1
  int un = 1
  int sum = 1
  for (int i = 0; i < nterms - 1; i++)
  {
      int d = 2 * (1 + i.intdiv(4))
      un += d
      //  print int d print "=>" print un print " " 
      sum += un
  }
  return sum
}

print(sumdiag(1001))



<|start_filename|>out/euler17.fs<|end_filename|>
: main
  3 16 + s>d 0 d.r
  S\" \n" TYPE
  3 33 + { one_to_nine }
  one_to_nine s>d 0 d.r
  S\" \n" TYPE
  one_to_nine 3 + { one_to_ten }
  one_to_ten 73 + { one_to_twenty }
  one_to_twenty 6 9 * + one_to_nine + 6 + { one_to_thirty }
  one_to_thirty 6 9 * + one_to_nine + 5 + { one_to_forty }
  one_to_forty 5 9 * + one_to_nine + 5 + { one_to_fifty }
  one_to_fifty 5 9 * + one_to_nine + 5 + { one_to_sixty }
  one_to_sixty 5 9 * + one_to_nine + 7 + { one_to_seventy }
  one_to_seventy 7 9 * + one_to_nine + 6 + { one_to_eighty }
  one_to_eighty 6 9 * + one_to_nine + 6 + { one_to_ninety }
  one_to_ninety 6 9 * + one_to_nine + { one_to_ninety_nine }
  one_to_ninety_nine s>d 0 d.r
  S\" \n" TYPE
  100 one_to_nine * one_to_ninety_nine 10 * + 10 9 * 99 * + 7 9 * + 11 + s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/fibo.java<|end_filename|>
import java.util.*;

public class fibo
{
  static Scanner scanner = new Scanner(System.in);
  /*
La suite de fibonaci
*/
  static int fibo0(int a, int b, int i)
  {
    int out0 = 0;
    int a2 = a;
    int b2 = b;
    for (int j = 0; j <= i + 1; j++)
    {
        out0 += a2;
        int tmp = b2;
        b2 += a2;
        a2 = tmp;
    }
    return out0;
  }
  public static void main(String args[])
  {
    int a;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      a = scanner.nextInt();
    } else {
      a = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int b;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      b = scanner.nextInt();
    } else {
      b = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int i;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      i = scanner.nextInt();
    } else {
      i = scanner.nextInt();
    }
    System.out.print(fibo0(a, b, i));
  }
  
}



<|start_filename|>out/prologin_template_charline.java<|end_filename|>
import java.util.*;

public class prologin_template_charline
{
  static Scanner scanner = new Scanner(System.in);
  static int programme_candidat(char[] tableau, int taille)
  {
    int out0 = 0;
    for (int i = 0; i < taille; i++)
    {
        out0 += (int)(tableau[i]) * i;
        System.out.print(tableau[i]);
    }
    System.out.print("--\n");
    return out0;
  }
  public static void main(String args[])
  {
    int taille = Integer.parseInt(scanner.nextLine());
    char[] tableau = scanner.nextLine().toCharArray();
    System.out.printf("%d\n", programme_candidat(tableau, taille));
  }
  
}



<|start_filename|>out/montagnes.cc<|end_filename|>
#include <iostream>
#include <vector>

int montagnes0(std::vector<int> * tab, int len) {
    int max0 = 1;
    int j = 1;
    int i = len - 2;
    while (i >= 0)
    {
        int x = tab->at(i);
        while (j >= 0 && x > tab->at(len - j))
            j--;
        j++;
        tab->at(len - j) = x;
        if (j > max0)
            max0 = j;
        i--;
    }
    return max0;
}

int main() {
    int len = 0;
    std::cin >> len;
    std::vector<int> *tab = new std::vector<int>( len );
    for (int i = 0; i < len; i++)
    {
        int x = 0;
        std::cin >> x;
        tab->at(i) = x;
    }
    std::cout << montagnes0(tab, len);
}



<|start_filename|>out/euler50.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

int eratostene(std::vector<int>& t, int max0) {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            if (max0 / i > i)
            {
                int j = i * i;
                while (j < max0 && j > 0)
                {
                    t[j] = 0;
                    j += i;
                }
            }
        }
    return n;
}

int main() {
    int maximumprimes = 1000001;
    std::vector<int> era( maximumprimes );
    for (int j = 0; j < maximumprimes; j++)
        era[j] = j;
    int nprimes = eratostene(era, maximumprimes);
    std::vector<int> primes( nprimes, 0 );
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    std::cout << l << " == " << nprimes << "\n";
    std::vector<int> sum( nprimes );
    for (int i_ = 0; i_ < nprimes; i_++)
        sum[i_] = primes[i_];
    int maxl = 0;
    bool process = true;
    int stop = maximumprimes - 1;
    int len = 1;
    int resp = 1;
    while (process)
    {
        process = false;
        for (int i = 0; i <= stop; i++)
            if (i + len < nprimes)
            {
                sum[i] += primes[i + len];
                if (maximumprimes > sum[i])
                {
                    process = true;
                    if (era[sum[i]] == sum[i])
                    {
                        maxl = len;
                        resp = sum[i];
                    }
                }
                else
                    stop = std::min(stop, i);
            }
        len++;
    }
    std::cout << resp << "\n" << maxl << "\n";
}



<|start_filename|>out/euler07.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler07 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function divisible(n : in Integer; t : in a_PTR; size : in Integer) return Boolean is
begin
  for i in integer range 0..size - 1 loop
    if n rem t(i) = 0
    then
      return TRUE;
    end if;
  end loop;
  return FALSE;
end;
function find(b : in Integer; t : in a_PTR; c : in Integer; nth : in Integer) return Integer is
  used : Integer;
  n : Integer;
begin
  n := b;
  used := c;
  while used /= nth loop
    if divisible(n, t, used)
    then
      n := n + 1;
    else
      t(used) := n;
      n := n + 1;
      used := used + 1;
    end if;
  end loop;
  return t(used - 1);
end;

  t : a_PTR;
  n : Integer;
begin
  n := 10001;
  t := new a (0..n - 1);
  for i in integer range 0..n - 1 loop
    t(i) := 2;
  end loop;
  PInt(find(3, t, 1, n));
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/aaa_041comment.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_041comment is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;


  i : Integer;
begin
  i := 4;
  --while i < 10 do 
  
  PInt(i);
  i := i + 1;
  --  end 
  
  PInt(i);
end;


<|start_filename|>out/prologin_template_intmatrix.lua<|end_filename|>

function readintline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), "-?%d+") do
    tab[index] = tonumber(a)
    index = index + 1
  end
  return tab
end
function programme_candidat (tableau, x, y)
  local out0 = 0
  for i = 0, y - 1 do
      for j = 0, x - 1 do
          out0 = out0 + tableau[i + 1][j + 1] * (i * 2 + j)
      end
  end
  return out0
end

local taille_x = tonumber(io.read('*l'))
local taille_y = tonumber(io.read('*l'))
local tableau = {}
for a = 0, taille_y - 1 do
    tableau[a + 1] = readintline()
end
io.write(string.format("%d\n", programme_candidat(tableau, taille_x, taille_y)))


<|start_filename|>out/aaa_read1.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int main(void) {
    int i, a;
    char *str = calloc(12, sizeof(char));
    for (a = 0; a < 12; a++)
        scanf("%c", &str[a]);
    scanf(" ");
    for (i = 0; i < 12; i++)
        printf("%c", str[i]);
    return 0;
}




<|start_filename|>out/linkedList.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end
function cons (list, i)
  local out0 = {head=i, tail=list}
  return out0
end

function is_empty (foo)
  return true
end

function rev2 (acc, torev)
  if is_empty(torev) then
      return acc
  else 
      local acc2 = {head=torev.head, tail=acc}
      return rev2(acc, torev.tail)
  end
end

function rev (empty, torev)
  return rev2(empty, torev)
end

function test (empty)
  local list = empty
  local i = -1
  while i ~= 0 do
      i = readint()
      if i ~= 0 then
          list = cons(list, i)
      end
  end
end




<|start_filename|>out/aaa_07triplet.java<|end_filename|>
import java.util.*;

public class aaa_07triplet
{
  static Scanner scanner = new Scanner(System.in);
  static int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

  
  public static void main(String args[])
  {
    for (int i = 1; i < 4; i++)
    {
        int[] d = read_int_line();
        int a = d[0];
        int b = d[1];
        int c = d[2];
        System.out.printf("a = %d b = %dc =%d\n", a, b, c);
    }
    int[] l = read_int_line();
    for (int j = 0; j < 10; j++)
        System.out.printf("%d\n", l[j]);
  }
  
}



<|start_filename|>out/aaa_read.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_read is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PChar(c : in Character) is
begin
  Character'Write (Text_Streams.Stream (Current_Output), c);
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
--
--Ce test permet de vérifier si les différents backends pour les langages implémentent bien
--read int, read char et skip
--

type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
type b is Array (Integer range <>) of Character;
type b_PTR is access b;

  tmpi2 : Integer;
  tmpi1 : Integer;
  tmpc : Character;
  tab4 : b_PTR;
  tab2 : a_PTR;
  tab : a_PTR;
  strlen : Integer;
  len : Integer;
  c : Integer;
begin
  Get(len);
  SkipSpaces;
  PInt(len);
  PString(new char_array'( To_C("=len" & Character'Val(10))));
  len := len * 2;
  PString(new char_array'( To_C("len*2=")));
  PInt(len);
  PString(new char_array'( To_C("" & Character'Val(10))));
  len := len / 2;
  tab := new a (0..len - 1);
  for i in integer range 0..len - 1 loop
    Get(tmpi1);
    SkipSpaces;
    PInt(i);
    PString(new char_array'( To_C("=>")));
    PInt(tmpi1);
    PString(new char_array'( To_C(" ")));
    tab(i) := tmpi1;
  end loop;
  PString(new char_array'( To_C("" & Character'Val(10))));
  tab2 := new a (0..len - 1);
  for i_0 in integer range 0..len - 1 loop
    Get(tmpi2);
    SkipSpaces;
    PInt(i_0);
    PString(new char_array'( To_C("==>")));
    PInt(tmpi2);
    PString(new char_array'( To_C(" ")));
    tab2(i_0) := tmpi2;
  end loop;
  Get(strlen);
  SkipSpaces;
  PInt(strlen);
  PString(new char_array'( To_C("=strlen" & Character'Val(10))));
  tab4 := new b (0..strlen - 1);
  for toto in integer range 0..strlen - 1 loop
    Get(tmpc);
    c := Character'Pos(tmpc);
    PChar(tmpc);
    PString(new char_array'( To_C(":")));
    PInt(c);
    PString(new char_array'( To_C(" ")));
    if tmpc /= ' '
    then
      c := (c - Character'Pos('a') + 13) rem 26 + Character'Pos('a');
    end if;
    tab4(toto) := Character'Val(c);
  end loop;
  for j in integer range 0..strlen - 1 loop
    PChar(tab4(j));
  end loop;
end;


<|start_filename|>out/euler26.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
periode restes len a b =
  let c d e =
        if d /= 0
        then do let chiffre = d `quot` b
                let reste = d `rem` b
                let f i =
                      if i <= e - 1
                      then ifM (((==) reste) <$> (readIOA restes i))
                               (return (e - i))
                               (f (i + 1))
                      else do writeIOA restes e reste
                              let g = e + 1
                              let h = reste * 10
                              c h g in
                      f 0
        else return 0 in
        c a len

main =
  do t <- array_init 1000 (\ j ->
                             return 0)
     let k i l n =
           if i <= 1000
           then do p <- periode t 0 1 i
                   if p > l
                   then k (i + 1) p i
                   else k (i + 1) l n
           else printf "%d\n%d\n" (n::Int) (l::Int) :: IO() in
           k 1 0 0




<|start_filename|>out/affect_param.go<|end_filename|>
package main
import "fmt"
func foo(a int) {
  a = 4
}
func main() {
  a := 0
  foo(a)
  fmt.Printf("%d\n", a)
}



<|start_filename|>out/euler03.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;
with Ada.Numerics.Elementary_Functions;
procedure euler03 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;


  sqrtia : Integer;
  maximum : Integer;
  found : Boolean;
  b0 : Integer;
  b : Integer;
  a : Integer;
begin
  maximum := 1;
  b0 := 2;
  a := 408464633;
  sqrtia := Integer(Float'Truncation(Ada.Numerics.Elementary_Functions.Sqrt(Float(a))));
  while a /= 1 loop
    b := b0;
    found := FALSE;
    while b <= sqrtia loop
      if a rem b = 0
      then
        a := a / b;
        b0 := b;
        b := a;
        sqrtia := Integer(Float'Truncation(Ada.Numerics.Elementary_Functions.Sqrt(Float(a))));
        found := TRUE;
      end if;
      b := b + 1;
    end loop;
    if not found
    then
      PInt(a);
      PString(new char_array'( To_C("" & Character'Val(10))));
      a := 1;
    end if;
  end loop;
end;


<|start_filename|>out/aaa_00hello.groovy<|end_filename|>
import java.util.*



print("Hello World\n")



<|start_filename|>out/euler24.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
fact n =
  let a i b =
        if i <= n
        then do let c = b * i
                a (i + 1) c
        else return b in
        a 2 1

show0 lim nth =
  do t <- array_init lim (\ i ->
                            return i)
     pris <- array_init lim (\ j ->
                               return False)
     let d k e =
           if k <= lim - 1
           then do n <- fact (lim - k)
                   let nchiffre = e `quot` n
                   let g = e `rem` n
                   let h l o =
                         if l <= lim - 1
                         then ifM (fmap not (readIOA pris l))
                                  (do if o == 0
                                      then do printf "%d" (l :: Int) :: IO ()
                                              writeIOA pris l True
                                      else return ()
                                      let p = o - 1
                                      h (l + 1) p)
                                  (h (l + 1) o)
                         else d (k + 1) g in
                         h 0 nchiffre
           else let f m =
                      if m <= lim - 1
                      then ifM (fmap not (readIOA pris m))
                               (do printf "%d" (m :: Int) :: IO ()
                                   f (m + 1))
                               (f (m + 1))
                      else printf "\n" :: IO () in
                      f 0 in
           d 1 nth

main =
  do show0 10 999999
     return ()




<|start_filename|>out/affect.cpp<|end_filename|>
#include <iostream>
#include <vector>
/*
Ce test permet de vérifier que l'implémentation de l'affectation fonctionne correctement
*/
struct toto {
    int foo;
    int bar;
    int blah;
};


toto mktoto(int v1) {
    toto t;
        t.foo = v1;
        t.bar = v1;
        t.blah = v1;;
    return t;
}


toto mktoto2(int v1) {
    toto t;
        t.foo = v1 + 3;
        t.bar = v1 + 2;
        t.blah = v1 + 1;;
    return t;
}


int result(toto& t_, toto& t2_) {
    toto t = t_;
    toto t2 = t2_;
    toto t3;
        t3.foo = 0;
        t3.bar = 0;
        t3.blah = 0;;
    t3 = t2;
    t = t2;
    t2 = t3;
    t.blah++;
    int len = 1;
    std::vector<int> cache0( len );
    for (int i = 0; i < len; i++)
        cache0[i] = -i;
    std::vector<int> cache1( len );
    for (int j = 0; j < len; j++)
        cache1[j] = j;
    std::vector<int> cache2 = cache0;
    cache0 = cache1;
    cache2 = cache0;
    return t.foo + t.blah * t.bar + t.bar * t.foo;
}

int main() {
    toto t = mktoto(4);
    toto t2 = mktoto(5);
    std::cin >> t.bar >> t.blah >> t2.bar >> t2.blah >> std::noskipws;
    std::cout << result(t, t2) << t.blah;
}



<|start_filename|>out/aaa_12strings.java<|end_filename|>
import java.util.*;

public class aaa_12strings
{
  
  
  public static void main(String args[])
  {
    System.out.print("tada ' \" \n\r\t $ & todo\n\n{foo} \\${blah}\nblah\n");
  }
  
}



<|start_filename|>out/euler02.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int main(void) {
    int a = 1;
    int b = 2;
    int sum = 0;
    while (a < 4000000)
    {
        if (a % 2 == 0)
            sum += a;
        int c = a;
        a = b;
        b += c;
    }
    printf("%d\n", sum);
    return 0;
}




<|start_filename|>out/aaa_01hello.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
main =
  do printf "Hello World" :: IO ()
     printf "%d \n%dfoo" (((4 + 6) * 2)::Int) (5::Int) :: IO()
     if 1 + (((1 + 1) * 2 * (3 + 8)) `quot` 4) - (1 - 2) - 3 == 12 && True
     then printf "True" :: IO ()
     else printf "False" :: IO ()
     printf "\n" :: IO ()
     if (3 * (4 + 5 + 6) * 2 == 45) == False
     then printf "True" :: IO ()
     else printf "False" :: IO ()
     printf " " :: IO ()
     if (2 == 1) == False
     then printf "True" :: IO ()
     else printf "False" :: IO ()
     printf " %d%d" ((((4 + 1) `quot` 3) `quot` (2 + 1))::Int) ((((4 * 1) `quot` 3) `quot` (2 * 1))::Int) :: IO()
     if not (not (5 == 0) && not (5 == 4))
     then printf "True" :: IO ()
     else printf "False" :: IO ()
     if (True && not False) && not (True && False)
     then printf "True" :: IO ()
     else printf "False" :: IO ()
     printf "\n" :: IO ()




<|start_filename|>out/euler50.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
eratostene t max0 =
  let c i d =
        if i <= max0 - 1
        then ifM (((==) i) <$> (readIOA t i))
                 (do let e = d + 1
                     if (max0 `quot` i) > i
                     then do let j = i * i
                             let f g =
                                   if g < max0 && g > 0
                                   then do writeIOA t g 0
                                           let h = g + i
                                           f h
                                   else c (i + 1) e in
                                   f j
                     else c (i + 1) e)
                 (c (i + 1) d)
        else return d in
        c 2 0

main =
  do era <- array_init 1000001 (\ j ->
                                  return j)
     nprimes <- eratostene era 1000001
     primes <- array_init nprimes (\ o ->
                                     return 0)
     let m k p =
           if k <= 1000001 - 1
           then ifM (((==) k) <$> (readIOA era k))
                    (do writeIOA primes p k
                        let bf = p + 1
                        m (k + 1) bf)
                    (m (k + 1) p)
           else do printf "%d == %d\n" (p::Int) (nprimes::Int) :: IO()
                   sum <- array_init nprimes (\ i_ ->
                                                readIOA primes i_)
                   let stop = 1000001 - 1
                   let q r s u v w =
                         if u
                         then let x i y z ba bb =
                                    if i <= bb
                                    then if i + r < nprimes
                                         then do writeIOA sum i =<< ((+) <$> (readIOA sum i) <*> (readIOA primes (i + r)))
                                                 ifM (((>) 1000001) <$> (readIOA sum i))
                                                     (ifM ((==) <$> (readIOA era =<< (readIOA sum i)) <*> (readIOA sum i))
                                                          (do be <- readIOA sum i
                                                              x (i + 1) r True be bb)
                                                          (x (i + 1) y True ba bb))
                                                     (do let bd = (min bb i)
                                                         x (i + 1) y z ba bd)
                                         else x (i + 1) y z ba bb
                                    else do let bc = r + 1
                                            q bc y z ba bb in
                                    x 0 s False v w
                         else printf "%d\n%d\n" (v::Int) (s::Int) :: IO() in
                         q 1 0 True 1 stop in
           m 2 0




<|start_filename|>out/euler50.java<|end_filename|>
import java.util.*;

public class euler50
{
  
  static int eratostene(int[] t, int max0)
  {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            if (max0 / i > i)
            {
                int j = i * i;
                while (j < max0 && j > 0)
                {
                    t[j] = 0;
                    j += i;
                }
            }
        }
    return n;
  }
  public static void main(String args[])
  {
    int maximumprimes = 1000001;
    int[] era = new int[maximumprimes];
    for (int j = 0; j < maximumprimes; j++)
        era[j] = j;
    int nprimes = eratostene(era, maximumprimes);
    int[] primes = new int[nprimes];
    for (int o = 0; o < nprimes; o++)
        primes[o] = 0;
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    System.out.printf("%d == %d\n", l, nprimes);
    int[] sum = new int[nprimes];
    for (int i_ = 0; i_ < nprimes; i_++)
        sum[i_] = primes[i_];
    int maxl = 0;
    boolean process = true;
    int stop = maximumprimes - 1;
    int len = 1;
    int resp = 1;
    while (process)
    {
        process = false;
        for (int i = 0; i <= stop; i++)
            if (i + len < nprimes)
            {
                sum[i] += primes[i + len];
                if (maximumprimes > sum[i])
                {
                    process = true;
                    if (era[sum[i]] == sum[i])
                    {
                        maxl = len;
                        resp = sum[i];
                    }
                }
                else
                    stop = Math.min(stop, i);
            }
        len++;
    }
    System.out.printf("%d\n%d\n", resp, maxl);
  }
  
}



<|start_filename|>out/aaa_05array.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_05array is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type c is Array (Integer range <>) of Boolean;
type c_PTR is access c;
function id(b : in c_PTR) return c_PTR is
begin
  return b;
end;
procedure g(t : in c_PTR; index : in Integer) is
begin
  t(index) := FALSE;
end;

  j : Integer;
  a : c_PTR;
begin
  j := 0;
  a := new c (0..4);
  for i in integer range 0..4 loop
    PInt(i);
    j := j + i;
    a(i) := i rem 2 = 0;
  end loop;
  PInt(j);
  PString(new char_array'( To_C(" ")));
  if a(0)
  then
    PString(new char_array'( To_C("True")));
  else
    PString(new char_array'( To_C("False")));
  end if;
  PString(new char_array'( To_C("" & Character'Val(10))));
  g(id(a), 0);
  if a(0)
  then
    PString(new char_array'( To_C("True")));
  else
    PString(new char_array'( To_C("False")));
  end if;
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler07.cpp<|end_filename|>
#include <iostream>
#include <vector>

bool divisible(int n, std::vector<int>& t, int size) {
    for (int i = 0; i < size; i++)
        if (n % t[i] == 0)
            return true;
    return false;
}


int find(int n, std::vector<int>& t, int used, int nth) {
    while (used != nth)
        if (divisible(n, t, used))
            n++;
        else
        {
            t[used] = n;
            n++;
            used++;
        }
    return t[used - 1];
}

int main() {
    int n = 10001;
    std::vector<int> t( n, 2 );
    std::cout << find(3, t, 1, n) << "\n";
}



<|start_filename|>out/euler23.cs<|end_filename|>
using System;

public class euler23
{
  static int eratostene(int[] t, int max0)
  {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            int j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
  }
  
  static int fillPrimesFactors(int[] t, int n, int[] primes, int nprimes)
  {
    for (int i = 0; i < nprimes; i++)
    {
        int d = primes[i];
        while (n % d == 0)
        {
            t[d]++;
            n /= d;
        }
        if (n == 1)
            return primes[i];
    }
    return n;
  }
  
  static int sumdivaux2(int[] t, int n, int i)
  {
    while (i < n && t[i] == 0)
        i++;
    return i;
  }
  
  static int sumdivaux(int[] t, int n, int i)
  {
    if (i > n)
        return 1;
    else if (t[i] == 0)
        return sumdivaux(t, n, sumdivaux2(t, n, i + 1));
    else
    {
        int o = sumdivaux(t, n, sumdivaux2(t, n, i + 1));
        int out0 = 0;
        int p = i;
        for (int j = 1; j <= t[i]; j++)
        {
            out0 += p;
            p *= i;
        }
        return (out0 + 1) * o;
    }
  }
  
  static int sumdiv(int nprimes, int[] primes, int n)
  {
    int[] t = new int[n + 1];
    for (int i = 0; i <= n; i++)
        t[i] = 0;
    int max0 = fillPrimesFactors(t, n, primes, nprimes);
    return sumdivaux(t, max0, 0);
  }
  
  public static void Main(String[] args)
  {
    int maximumprimes = 30001;
    int[] era = new int[maximumprimes];
    for (int s = 0; s < maximumprimes; s++)
        era[s] = s;
    int nprimes = eratostene(era, maximumprimes);
    int[] primes = new int[nprimes];
    for (int t = 0; t < nprimes; t++)
        primes[t] = 0;
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    int n = 100;
    //  28124 ça prend trop de temps mais on arrive a passer le test 
    bool[] abondant = new bool[n + 1];
    for (int p = 0; p <= n; p++)
        abondant[p] = false;
    bool[] summable = new bool[n + 1];
    for (int q = 0; q <= n; q++)
        summable[q] = false;
    int sum = 0;
    for (int r = 2; r <= n; r++)
    {
        int other = sumdiv(nprimes, primes, r) - r;
        if (other > r)
            abondant[r] = true;
    }
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            if (abondant[i] && abondant[j] && i + j <= n)
                summable[i + j] = true;
    for (int o = 1; o <= n; o++)
        if (!summable[o])
            sum += o;
    Console.Write("\n" + sum + "\n");
  }
  
}



<|start_filename|>out/dichoexp.cs<|end_filename|>
using System;

public class dichoexp
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static void stdin_sep(){
  do{
    if (eof) return;
    char c = readChar_();
    if (c == ' ' || c == '\n' || c == '\t' || c == '\r'){
      consommeChar();
    }else{
      return;
    }
  } while(true);
}
static int readInt(){
  int i = 0;
  char s = readChar_();
  int sign = 1;
  if (s == '-'){
    sign = -1;
    consommeChar();
  }
  do{
    char c = readChar_();
    if (c <= '9' && c >= '0'){
      i = i * 10 + c - '0';
      consommeChar();
    }else{
      return i * sign;
    }
  } while(true);
} 
  static int exp0(int a, int b)
  {
    if (b == 0)
        return 1;
    if (b % 2 == 0)
    {
        int o = exp0(a, b / 2);
        return o * o;
    }
    else
        return a * exp0(a, b - 1);
  }
  
  public static void Main(String[] args)
  {
    int a = 0;
    int b = 0;
    a = readInt();
    stdin_sep();
    b = readInt();
    Console.Write(exp0(a, b));
  }
  
}



<|start_filename|>out/euler32.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
\ 
\ We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once;
\ for example, the 5-digit number, 15234, is 1 through 5 pandigital.
\ 
\ The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier,
\ and product is 1 through 9 pandigital.
\ 
\ Find the sum of all products whose multiplicand/multiplier/product identity can be written as a
\ 1 through 9 pandigital.
\ 
\ HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.
\ 
\ 
\ (a * 10 + b) ( c * 100 + d * 10 + e) =
\   a * c * 1000 +
\   a * d * 100 +
\   a * e * 10 +
\   b * c * 100 +
\   b * d * 10 +
\   b * e
\   => b != e != b * e % 10 ET
\   a != d != (b * e / 10 + b * d + a * e ) % 10
\ 

: okdigits recursive { ok n }
  n 0 =
  IF
    true exit
  ELSE
    n 10 % { digit }
    ok  digit cells +  @
    IF
      false ok  digit cells +  !
      ok n 10 // okdigits { o }
      true ok  digit cells +  !
      o exit
    ELSE
      false exit
    THEN
  THEN
;

: main
  0 { count }
  HERE 10 cells allot { allowed }
  9 0 BEGIN 2dup >= WHILE DUP { i }
    i 0 <> allowed  i cells +  !
   1 + REPEAT 2DROP
  HERE 100000 cells allot { counted }
  99999 0 BEGIN 2dup >= WHILE DUP { j }
    false counted  j cells +  !
   1 + REPEAT 2DROP
  9 1 BEGIN 2dup >= WHILE DUP { e }
    false allowed  e cells +  !
    9 1 BEGIN 2dup >= WHILE DUP { b }
      allowed  b cells +  @
      IF
        false allowed  b cells +  !
        b e * 10 % { be }
        allowed  be cells +  @
        IF
          false allowed  be cells +  !
          9 1 BEGIN 2dup >= WHILE DUP { a }
            allowed  a cells +  @
            IF
              false allowed  a cells +  !
              9 1 BEGIN 2dup >= WHILE DUP { c }
                allowed  c cells +  @
                IF
                  false allowed  c cells +  !
                  9 1 BEGIN 2dup >= WHILE DUP { d }
                    allowed  d cells +  @
                    IF
                      false allowed  d cells +  !
                      \  2 * 3 digits 
                      
                      a 10 * b + c 100 * d 10 * + e + * { product }
                      counted  product cells +  @ INVERT allowed product 10 // okdigits AND
                      IF
                        true counted  product cells +  !
                        count product + TO count
                        product s>d 0 d.r
                        S"  " TYPE
                      THEN
                      \  1  * 4 digits 
                      
                      b a 1000 * c 100 * + d 10 * + e + * { product2 }
                      counted  product2 cells +  @ INVERT allowed product2 10 // okdigits AND
                      IF
                        true counted  product2 cells +  !
                        count product2 + TO count
                        product2 s>d 0 d.r
                        S"  " TYPE
                      THEN
                      true allowed  d cells +  !
                    THEN
                   1 + REPEAT 2DROP
                  true allowed  c cells +  !
                THEN
               1 + REPEAT 2DROP
              true allowed  a cells +  !
            THEN
           1 + REPEAT 2DROP
          true allowed  be cells +  !
        THEN
        true allowed  b cells +  !
      THEN
     1 + REPEAT 2DROP
    true allowed  e cells +  !
   1 + REPEAT 2DROP
  count s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/aaa_05array.go<|end_filename|>
package main
import "fmt"
func id(b []bool) []bool{
  return b
}
func g(t []bool, index int) {
  t[index] = false
}
func main() {
  j := 0
  var a []bool = make([]bool, 5)
  for i := 0; i < 5; i++ {
      fmt.Printf("%d", i)
      j += i
      a[i] = i % 2 == 0
  }
  fmt.Printf("%d ", j)
  if a[0] {
      fmt.Printf("True")
  } else {
      fmt.Printf("False")
  }
  fmt.Printf("\n")
  g(id(a), 0)
  if a[0] {
      fmt.Printf("True")
  } else {
      fmt.Printf("False")
  }
  fmt.Printf("\n")
}



<|start_filename|>out/aaa_read1.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}

func main() {
  reader = bufio.NewReader(os.Stdin)
  var str []byte = make([]byte, 12)
  for a := 0; a < 12; a++ {
      fmt.Fscanf(reader, "%c", &str[a])
  }
  skip()
  for i := 0; i < 12; i++ {
      fmt.Printf("%c", str[i])
  }
}



<|start_filename|>out/prologin_template_charmatrix.cc<|end_filename|>
#include <iostream>
#include <vector>
std::vector<char> *getline() {
    if (std::cin.flags() & std::ios_base::skipws) {
        char c = std::cin.peek();
        if (c == '\n' || c == ' ') std::cin.ignore();
        std::cin.unsetf(std::ios::skipws);
    }
    std::string line;
    std::getline(std::cin, line);
    std::vector<char> *c = new std::vector<char>(line.begin(), line.end());
    std::cin >> std::skipws;
    return c;
}

int programme_candidat(std::vector<std::vector<char> *> * tableau, int taille_x, int taille_y) {
    int out0 = 0;
    for (int i = 0; i < taille_y; i++)
    {
        for (int j = 0; j < taille_x; j++)
        {
            out0 += (int)(tableau->at(i)->at(j)) * (i + j * 2);
            std::cout << tableau->at(i)->at(j);
        }
        std::cout << "--\n";
    }
    return out0;
}

int main() {
    int taille_y, taille_x;
    std::cin >> taille_x >> taille_y;
    std::vector<std::vector<char> *> *a = new std::vector<std::vector<char> *>( taille_y );
    for (int b = 0; b < taille_y; b++)
        a->at(b) = getline();
    std::vector<std::vector<char> *> * tableau = a;
    std::cout << programme_candidat(tableau, taille_x, taille_y) << "\n";
}



<|start_filename|>out/prologin_template_charmatrix.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func programme_candidat(tableau [][]byte, taille_x int, taille_y int) int{
  out0 := 0
  for i := 0; i < taille_y; i++ {
      for j := 0; j < taille_x; j++ {
          out0 += (int)(tableau[i][j]) * (i + j * 2)
          fmt.Printf("%c", tableau[i][j])
      }
      fmt.Printf("--\n")
  }
  return out0
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var taille_y int
  var taille_x int
  fmt.Fscanf(reader, "%d", &taille_x)
  skip()
  fmt.Fscanf(reader, "%d", &taille_y)
  skip()
  var a [][]byte = make([][]byte, taille_y)
  for b := 0; b < taille_y; b++ {
      var c []byte = make([]byte, taille_x)
      for d := 0; d < taille_x; d++ {
          fmt.Fscanf(reader, "%c", &c[d])
      }
      skip()
      a[b] = c
  }
  var tableau [][]byte = a
  fmt.Printf("%d\n", programme_candidat(tableau, taille_x, taille_y))
}



<|start_filename|>out/euler11.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
find n m x y dx dy =
  if ((x < 0 || x == 20) || y < 0) || y == 20
  then return (- 1)
  else if n == 0
       then return 1
       else ((*) <$> (join $ readIOA <$> (readIOA m y) <*> return x) <*> (find (n - 1) m (x + dx) (y + dy) dx dy))

main =
  do directions <- array_init 8 (\ i ->
                                   return (if i == 0
                                           then (0, 1)
                                           else if i == 1
                                                then (1, 0)
                                                else if i == 2
                                                     then (0, - 1)
                                                     else if i == 3
                                                          then (- 1, 0)
                                                          else if i == 4
                                                               then (1, 1)
                                                               else if i == 5
                                                                    then (1, - 1)
                                                                    else if i == 6
                                                                         then (- 1, 1)
                                                                         else (- 1, - 1)))
     m <- array_init 20 (\ c ->
                           (join (newListArray . (,) 0 . subtract 1 <$> return 20 <*> fmap (map read . words) getLine)))
     let d j e =
           if j <= 7
           then (readIOA directions j) >>= (\ (dx, dy) ->
                                             let f x g =
                                                   if x <= 19
                                                   then let h y k =
                                                              if y <= 19
                                                              then do l <- ((max <$> (return k) <*> (find 4 m x y dx dy)))
                                                                      h (y + 1) l
                                                              else f (x + 1) k in
                                                              h 0 g
                                                   else d (j + 1) g in
                                                   f 0 e)
           else printf "%d\n" (e::Int) :: IO() in
           d 0 0




<|start_filename|>out/fibo.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure fibo is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
--
--La suite de fibonaci
--

function fibo0(a : in Integer; b : in Integer; i : in Integer) return Integer is
  tmp : Integer;
  out0 : Integer;
  b2 : Integer;
  a2 : Integer;
begin
  out0 := 0;
  a2 := a;
  b2 := b;
  for j in integer range 0..i + 1 loop
    out0 := out0 + a2;
    tmp := b2;
    b2 := b2 + a2;
    a2 := tmp;
  end loop;
  return out0;
end;

  i : Integer;
  b : Integer;
  a : Integer;
begin
  Get(a);
  SkipSpaces;
  Get(b);
  SkipSpaces;
  Get(i);
  PInt(fibo0(a, b, i));
end;


<|start_filename|>out/euler33.cs<|end_filename|>
using System;

public class euler33
{
  static int pgcd(int a, int b)
  {
    int c = Math.Min(a, b);
    int d = Math.Max(a, b);
    int reste = d % c;
    if (reste == 0)
        return c;
    else
        return pgcd(c, reste);
  }
  
  public static void Main(String[] args)
  {
    int top = 1;
    int bottom = 1;
    for (int i = 1; i < 10; i++)
        for (int j = 1; j < 10; j++)
            for (int k = 1; k < 10; k++)
                if (i != j && j != k)
                {
                    int a = i * 10 + j;
                    int b = j * 10 + k;
                    if (a * k == i * b)
                    {
                        Console.Write(a + "/" + b + "\n");
                        top *= a;
                        bottom *= b;
                    }
                }
    Console.Write(top + "/" + bottom + "\n");
    int p = pgcd(top, bottom);
    Console.Write("pgcd=" + p + "\n" + (bottom / p) + "\n");
  }
  
}



<|start_filename|>out/prologin_template_2charline.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func programme_candidat(tableau1 []byte, taille1 int, tableau2 []byte, taille2 int) int{
  out0 := 0
  for i := 0; i < taille1; i++ {
      out0 += (int)(tableau1[i]) * i
      fmt.Printf("%c", tableau1[i])
  }
  fmt.Printf("--\n")
  for j := 0; j < taille2; j++ {
      out0 += (int)(tableau2[j]) * j * 100
      fmt.Printf("%c", tableau2[j])
  }
  fmt.Printf("--\n")
  return out0
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var taille1 int
  fmt.Fscanf(reader, "%d", &taille1)
  skip()
  var tableau1 []byte = make([]byte, taille1)
  for a := 0; a < taille1; a++ {
      fmt.Fscanf(reader, "%c", &tableau1[a])
  }
  var taille2 int
  skip()
  fmt.Fscanf(reader, "%d", &taille2)
  skip()
  var tableau2 []byte = make([]byte, taille2)
  for b := 0; b < taille2; b++ {
      fmt.Fscanf(reader, "%c", &tableau2[b])
  }
  skip()
  fmt.Printf("%d\n", programme_candidat(tableau1, taille1, tableau2, taille2))
}



<|start_filename|>out/ocaml01.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
foo () =
  let b i =
        if i <= 10
        then b (i + 1)
        else return 0 in
        b 0

bar () =
  let c i =
        if i <= 10
        then c (i + 1)
        else return 0 in
        c 0

main =
  return ()




<|start_filename|>out/euler15.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int main(void) {
    int m, k, o, p, l, i, j;
    int n = 10;
    /* normalement on doit mettre 20 mais là on se tape un overflow */
    n++;
    int* *tab = calloc(n, sizeof(int*));
    for (i = 0; i < n; i++)
    {
        int *tab2 = calloc(n, sizeof(int));
        for (j = 0; j < n; j++)
            tab2[j] = 0;
        tab[i] = tab2;
    }
    for (l = 0; l < n; l++)
    {
        tab[n - 1][l] = 1;
        tab[l][n - 1] = 1;
    }
    for (o = 2; o <= n; o++)
    {
        int r = n - o;
        for (p = 2; p <= n; p++)
        {
            int q = n - p;
            tab[r][q] = tab[r + 1][q] + tab[r][q + 1];
        }
    }
    for (m = 0; m < n; m++)
    {
        for (k = 0; k < n; k++)
            printf("%d ", tab[m][k]);
        printf("\n");
    }
    printf("%d\n", tab[0][0]);
    return 0;
}




<|start_filename|>out/euler08.cs<|end_filename|>
using System;

public class euler08
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static char readChar(){
  char out_ = readChar_();
  consommeChar();
  return out_;
}
  
  public static void Main(String[] args)
  {
    int i = 1;
    int[] last = new int[5];
    for (int j = 0; j < 5; j++)
    {
        char c = readChar();
        int d = (int)(c) - (int)('0');
        i *= d;
        last[j] = d;
    }
    int max0 = i;
    int index = 0;
    int nskipdiv = 0;
    for (int k = 1; k < 996; k++)
    {
        char e = readChar();
        int f = (int)(e) - (int)('0');
        if (f == 0)
        {
            i = 1;
            nskipdiv = 4;
        }
        else
        {
            i *= f;
            if (nskipdiv < 0)
                i /= last[index];
            nskipdiv--;
        }
        last[index] = f;
        index = (index + 1) % 5;
        max0 = Math.Max(max0, i);
    }
    Console.Write(max0 + "\n");
  }
  
}



<|start_filename|>out/euler11.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class euler11
{
  static int find(int n, int[][] m, int x, int y, int dx, int dy)
  {
    if (x < 0 || x == 20 || y < 0 || y == 20)
        return -1;
    else if (n == 0)
        return 1;
    else
        return m[y][x] * find(n - 1, m, x + dx, y + dy, dx, dy);
  }
  
  public class tuple_int_int {
    public int tuple_int_int_field_0;
    public int tuple_int_int_field_1;
  }
  public static void Main(String[] args)
  {
    tuple_int_int[] directions = new tuple_int_int[8];
    for (int i = 0; i < 8; i++)
        if (i == 0)
        {
            tuple_int_int c = new tuple_int_int();
            c.tuple_int_int_field_0 = 0;
            c.tuple_int_int_field_1 = 1;
            directions[i] = c;
        }
        else if (i == 1)
        {
            tuple_int_int d = new tuple_int_int();
            d.tuple_int_int_field_0 = 1;
            d.tuple_int_int_field_1 = 0;
            directions[i] = d;
        }
        else if (i == 2)
        {
            tuple_int_int e = new tuple_int_int();
            e.tuple_int_int_field_0 = 0;
            e.tuple_int_int_field_1 = -1;
            directions[i] = e;
        }
        else if (i == 3)
        {
            tuple_int_int f = new tuple_int_int();
            f.tuple_int_int_field_0 = -1;
            f.tuple_int_int_field_1 = 0;
            directions[i] = f;
        }
        else if (i == 4)
        {
            tuple_int_int g = new tuple_int_int();
            g.tuple_int_int_field_0 = 1;
            g.tuple_int_int_field_1 = 1;
            directions[i] = g;
        }
        else if (i == 5)
        {
            tuple_int_int h = new tuple_int_int();
            h.tuple_int_int_field_0 = 1;
            h.tuple_int_int_field_1 = -1;
            directions[i] = h;
        }
        else if (i == 6)
        {
            tuple_int_int k = new tuple_int_int();
            k.tuple_int_int_field_0 = -1;
            k.tuple_int_int_field_1 = 1;
            directions[i] = k;
        }
        else
        {
            tuple_int_int l = new tuple_int_int();
            l.tuple_int_int_field_0 = -1;
            l.tuple_int_int_field_1 = -1;
            directions[i] = l;
        }
    int max0 = 0;
    int[][] m = new int[20][];
    for (int o = 0; o < 20; o++)
        m[o] = new List<string>(Console.ReadLine().Split(" ".ToCharArray())).ConvertAll(int.Parse).ToArray();
    for (int j = 0; j < 8; j++)
    {
        tuple_int_int p = directions[j];
        int dx = p.tuple_int_int_field_0;
        int dy = p.tuple_int_int_field_1;
        for (int x = 0; x < 20; x++)
            for (int y = 0; y < 20; y++)
                max0 = Math.Max(max0, find(4, m, x, y, dx, dy));
    }
    Console.Write(max0 + "\n");
  }
  
}



<|start_filename|>out/affect_param.cs<|end_filename|>
using System;

public class affect_param
{
  static void foo(int a)
  {
    a = 4;
  }
  
  public static void Main(String[] args)
  {
    int a = 0;
    foo(a);
    Console.Write(a + "\n");
  }
  
}



<|start_filename|>out/affect_param.groovy<|end_filename|>
import java.util.*

void foo(int a)
{
  a = 4
}

int a = 0
foo(a)
System.out.printf("%d\n", a)



<|start_filename|>out/aaa_read2.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_char_(){
    if (current_char == null) current_char = read_char0();
    var out = current_char;
    current_char = read_char0();
    return out;
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}
/*
Ce test permet de vérifier si les différents backends pour les langages implémentent bien
read int, read char et skip
*/
var len = read_int_();
stdinsep();
util.print(len, "=len\n");
var tab = new Array(len);
for (var a = 0; a < len; a++)
{
    tab[a] = read_int_();
    stdinsep();
}
for (var i = 0; i < len; i++)
    util.print(i, "=>", tab[i], " ");
util.print("\n");
var tab2 = new Array(len);
for (var b = 0; b < len; b++)
{
    tab2[b] = read_int_();
    stdinsep();
}
for (var i_ = 0; i_ < len; i_++)
    util.print(i_, "==>", tab2[i_], " ");
var strlen = read_int_();
stdinsep();
util.print(strlen, "=strlen\n");
var tab4 = new Array(strlen);
for (var d = 0; d < strlen; d++)
{
    tab4[d] = read_char_();
}
stdinsep();
for (var i3 = 0; i3 < strlen; i3++)
{
    var tmpc = tab4[i3];
    var c = tmpc.charCodeAt(0);
    util.print(tmpc, ":", c, " ");
    if (tmpc != ' ')
        c = ~~((c - 'a'.charCodeAt(0) + 13) % 26) + 'a'.charCodeAt(0);
    tab4[i3] = String.fromCharCode(c);
}
for (var j = 0; j < strlen; j++)
    util.print(tab4[j]);



<|start_filename|>out/brainfuck_compiler.js<|end_filename|>
var util = require("util");
/*
Ce test permet de tester les macros
C'est un compilateur brainfuck qui lit sur l'entrée standard pendant la compilation
et qui produit les macros metalang correspondante
*/
var input = ' ';
var current_pos = 500;
var mem = new Array(1000);
for (var i = 0; i < 1000; i++)
    mem[i] = 0;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
current_pos++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
mem[current_pos]++;
while (mem[current_pos] != 0)
{
    mem[current_pos]--;
    current_pos--;
    mem[current_pos]++;
    util.print(String.fromCharCode(mem[current_pos]));
    current_pos++;
}



<|start_filename|>out/aaa_05array.cc<|end_filename|>
#include <iostream>
#include <vector>

std::vector<bool> * id(std::vector<bool> * b) {
    return b;
}


void g(std::vector<bool> * t, int index) {
    t->at(index) = false;
}

int main() {
    int j = 0;
    std::vector<bool> *a = new std::vector<bool>( 5 );
    for (int i = 0; i < 5; i++)
    {
        std::cout << i;
        j += i;
        a->at(i) = i % 2 == 0;
    }
    std::cout << j << " ";
    if (a->at(0))
        std::cout << "True";
    else
        std::cout << "False";
    std::cout << "\n";
    g(id(a), 0);
    if (a->at(0))
        std::cout << "True";
    else
        std::cout << "False";
    std::cout << "\n";
}



<|start_filename|>out/euler05.cs<|end_filename|>
using System;

public class euler05
{
  static int[] primesfactors(int n)
  {
    int[] tab = new int[n + 1];
    for (int i = 0; i <= n; i++)
        tab[i] = 0;
    int d = 2;
    while (n != 1 && d * d <= n)
        if (n % d == 0)
        {
            tab[d]++;
            n /= d;
        }
        else
            d++;
    tab[n]++;
    return tab;
  }
  
  public static void Main(String[] args)
  {
    int lim = 20;
    int[] o = new int[lim + 1];
    for (int m = 0; m <= lim; m++)
        o[m] = 0;
    for (int i = 1; i <= lim; i++)
    {
        int[] t = primesfactors(i);
        for (int j = 1; j <= i; j++)
            o[j] = Math.Max(o[j], t[j]);
    }
    int product = 1;
    for (int k = 1; k <= lim; k++)
        for (int l = 1; l <= o[k]; l++)
            product *= k;
    Console.Write(product + "\n");
  }
  
}



<|start_filename|>out/prologin_template_intmatrix.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int programme_candidat(int** tableau, int x, int y) {
    int i, j;
    int out0 = 0;
    for (i = 0; i < y; i++)
        for (j = 0; j < x; j++)
            out0 += tableau[i][j] * (i * 2 + j);
    return out0;
}
int main(void) {
    int a, c, taille_y, taille_x;
    scanf("%d %d ", &taille_x, &taille_y);
    int* *tableau = calloc(taille_y, sizeof(int*));
    for (a = 0; a < taille_y; a++)
    {
        int *b = calloc(taille_x, sizeof(int));
        for (c = 0; c < taille_x; c++)
            scanf("%d ", &b[c]);
        tableau[a] = b;
    }
    printf("%d\n", programme_candidat(tableau, taille_x, taille_y));
    return 0;
}




<|start_filename|>out/euler32.js<|end_filename|>
var util = require("util");
/*
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once;
for example, the 5-digit number, 15234, is 1 through 5 pandigital.

The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier,
and product is 1 through 9 pandigital.

Find the sum of all products whose multiplicand/multiplier/product identity can be written as a
1 through 9 pandigital.

HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.


(a * 10 + b) ( c * 100 + d * 10 + e) =
  a * c * 1000 +
  a * d * 100 +
  a * e * 10 +
  b * c * 100 +
  b * d * 10 +
  b * e
  => b != e != b * e % 10 ET
  a != d != (b * e / 10 + b * d + a * e ) % 10
*/
function okdigits(ok, n){
    if (n == 0)
        return true;
    else
    {
        var digit = ~~(n % 10);
        if (ok[digit])
        {
            ok[digit] = false;
            var o = okdigits(ok, ~~(n / 10));
            ok[digit] = true;
            return o;
        }
        else
            return false;
    }
}
var count = 0;
var allowed = new Array(10);
for (var i = 0; i < 10; i++)
    allowed[i] = i != 0;
var counted = new Array(100000);
for (var j = 0; j < 100000; j++)
    counted[j] = false;
for (var e = 1; e < 10; e++)
{
    allowed[e] = false;
    for (var b = 1; b < 10; b++)
        if (allowed[b])
        {
            allowed[b] = false;
            var be = ~~(b * e % 10);
            if (allowed[be])
            {
                allowed[be] = false;
                for (var a = 1; a < 10; a++)
                    if (allowed[a])
                    {
                        allowed[a] = false;
                        for (var c = 1; c < 10; c++)
                            if (allowed[c])
                            {
                                allowed[c] = false;
                                for (var d = 1; d < 10; d++)
                                    if (allowed[d])
                                    {
                                        allowed[d] = false;
                                        //  2 * 3 digits 
                                        var product = (a * 10 + b) * (c * 100 + d * 10 + e);
                                        if (!counted[product] && okdigits(allowed, ~~(product / 10)))
                                        {
                                            counted[product] = true;
                                            count += product;
                                            util.print(product, " ");
                                        }
                                        //  1  * 4 digits 
                                        var product2 = b * (a * 1000 + c * 100 + d * 10 + e);
                                        if (!counted[product2] && okdigits(allowed, ~~(product2 / 10)))
                                        {
                                            counted[product2] = true;
                                            count += product2;
                                            util.print(product2, " ");
                                        }
                                        allowed[d] = true;
                                    }
                                allowed[c] = true;
                            }
                        allowed[a] = true;
                    }
                allowed[be] = true;
            }
            allowed[b] = true;
        }
    allowed[e] = true;
}
util.print(count, "\n");



<|start_filename|>out/euler10.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int eratostene(int* t, int max0) {
    int i;
    int sum = 0;
    for (i = 2; i < max0; i++)
        if (t[i] == i)
        {
            sum += i;
            if (max0 / i > i)
            {
                int j = i * i;
                while (j < max0 && j > 0)
                {
                    t[j] = 0;
                    j += i;
                }
            }
        }
    return sum;
}
int main(void) {
    int i;
    int n = 100000;
    /* normalement on met 2000 000 mais là on se tape des int overflow dans plein de langages */
    int *t = calloc(n, sizeof(int));
    for (i = 0; i < n; i++)
        t[i] = i;
    t[1] = 0;
    printf("%d\n", eratostene(t, n));
    return 0;
}




<|start_filename|>out/aaa_013option.fs<|end_filename|>
struct
  cell% field ->a
  cell% field ->b
  cell% field ->c
  cell% field ->d
  cell% field ->e
  cell% field ->f
  cell% field ->g
  cell% field ->h
end-struct foo%


: default0 { a b c d e f }
  0 exit
;


: aa { b }
  
;

: main
  0 { a }
  S\" ___\n" TYPE
  ;
main
BYE



<|start_filename|>out/recordtest.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

class Toto {
  int foo
  int bar
}
@Field Scanner scanner = new Scanner(System.in)
Toto param = new Toto()
param.foo = 0
param.bar = 0
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  param.bar = -scanner.nextInt()
}else{
  param.bar = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  param.foo = -scanner.nextInt()
}else{
  param.foo = scanner.nextInt()
}
print(param.bar + param.foo * param.bar)



<|start_filename|>out/str2.js<|end_filename|>
var util = require("util");

util.print("ma petite chaine en or");



<|start_filename|>out/euler19.cpp<|end_filename|>
#include <iostream>
#include <vector>

bool is_leap(int year) {
    return year % 400 == 0 || year % 100 != 0 && year % 4 == 0;
}


int ndayinmonth(int month, int year) {
    if (month == 0)
        return 31;
    else if (month == 1)
        if (is_leap(year))
            return 29;
        else
            return 28;
    else if (month == 2)
        return 31;
    else if (month == 3)
        return 30;
    else if (month == 4)
        return 31;
    else if (month == 5)
        return 30;
    else if (month == 6)
        return 31;
    else if (month == 7)
        return 31;
    else if (month == 8)
        return 30;
    else if (month == 9)
        return 31;
    else if (month == 10)
        return 30;
    else if (month == 11)
        return 31;
    return 0;
}

int main() {
    int month = 0;
    int year = 1901;
    int dayofweek = 1;
    //  01-01-1901 : mardi 
    int count = 0;
    while (year != 2001)
    {
        int ndays = ndayinmonth(month, year);
        dayofweek = (dayofweek + ndays) % 7;
        month++;
        if (month == 12)
        {
            month = 0;
            year++;
        }
        if (dayofweek % 7 == 6)
            count++;
    }
    std::cout << count << "\n";
}



<|start_filename|>out/euler09.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler09 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;


  cc : Integer;
  c : Integer;
  a2b2 : Integer;
begin
  --
  --	a + b + c = 1000 && a * a + b * b = c * c
  --	
  
  for a in integer range 1..1000 loop
    for b in integer range a + 1..1000 loop
      c := 1000 - a - b;
      a2b2 := a * a + b * b;
      cc := c * c;
      if cc = a2b2 and then c > a
      then
        PInt(a);
        PString(new char_array'( To_C("" & Character'Val(10))));
        PInt(b);
        PString(new char_array'( To_C("" & Character'Val(10))));
        PInt(c);
        PString(new char_array'( To_C("" & Character'Val(10))));
        PInt(a * b * c);
        PString(new char_array'( To_C("" & Character'Val(10))));
      end if;
    end loop;
  end loop;
end;


<|start_filename|>out/test_returns.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure test_returns is


type stringptr is access all char_array;
function is_pair(i : in Integer) return Boolean is
  j : Integer;
begin
  j := 1;
  if i < 10
  then
    j := 2;
    if i = 0
    then
      j := 4;
      return TRUE;
    end if;
    j := 3;
    if i = 2
    then
      j := 4;
      return TRUE;
    end if;
    j := 5;
  end if;
  j := 6;
  if i < 20
  then
    if i = 22
    then
      j := 0;
    end if;
    j := 8;
  end if;
  return i rem 2 = 0;
end;

begin
  NULL;
  
end;


<|start_filename|>out/euler28.go<|end_filename|>
package main
import "fmt"
/*

43 44 45 46 47 48 49
42 21 22 23 24 25 26
41 20  7  8  9 10 27
40 19  6  1  2 11 28
39 18  5  4  3 12 29
38 17 16 15 14 13 30
37 36 35 34 33 32 31

1 3 5 7 9 13 17 21 25 31 37 43 49
  2 2 2 2 4  4  4  4  6   6  6  6


*/
func sumdiag(n int) int{
  nterms := n * 2 - 1
  un := 1
  sum := 1
  for i := 0; i < nterms - 1; i++ {
      d := 2 * (1 + i / 4)
      un += d
      /* print int d print "=>" print un print " " */
      sum += un
  }
  return sum
}
func main() {
  fmt.Printf("%d", sumdiag(1001))
}



<|start_filename|>out/loop_unroll.groovy<|end_filename|>
import java.util.*

/*
Ce test permet de vérifier le comportement des macros
Il effectue du loop unrolling
*/

int j = 0
j = 0
System.out.printf("%d\n", j)
j = 1
System.out.printf("%d\n", j)
j = 2
System.out.printf("%d\n", j)
j = 3
System.out.printf("%d\n", j)
j = 4
System.out.printf("%d\n", j)



<|start_filename|>out/euler17.cs<|end_filename|>
using System;

public class euler17
{
  
  public static void Main(String[] args)
  {
    Console.Write((3 + 16) + "\n");
    int one_to_nine = 3 + 33;
    Console.Write(one_to_nine + "\n");
    int one_to_ten = one_to_nine + 3;
    int one_to_twenty = one_to_ten + 73;
    int one_to_thirty = one_to_twenty + 6 * 9 + one_to_nine + 6;
    int one_to_forty = one_to_thirty + 6 * 9 + one_to_nine + 5;
    int one_to_fifty = one_to_forty + 5 * 9 + one_to_nine + 5;
    int one_to_sixty = one_to_fifty + 5 * 9 + one_to_nine + 5;
    int one_to_seventy = one_to_sixty + 5 * 9 + one_to_nine + 7;
    int one_to_eighty = one_to_seventy + 7 * 9 + one_to_nine + 6;
    int one_to_ninety = one_to_eighty + 6 * 9 + one_to_nine + 6;
    int one_to_ninety_nine = one_to_ninety + 6 * 9 + one_to_nine;
    Console.Write(one_to_ninety_nine + "\n" + (100 * one_to_nine + one_to_ninety_nine * 10 + 10 * 9 * 99 + 7 * 9 + 11) + "\n");
  }
  
}



<|start_filename|>out/dichoexp.java<|end_filename|>
import java.util.*;

public class dichoexp
{
  static Scanner scanner = new Scanner(System.in);
  static int exp0(int a, int b)
  {
    if (b == 0)
        return 1;
    if (b % 2 == 0)
    {
        int o = exp0(a, b / 2);
        return o * o;
    }
    else
        return a * exp0(a, b - 1);
  }
  public static void main(String args[])
  {
    int a = 0;
    int b = 0;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      a = -scanner.nextInt();
    }else{
      a = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      b = -scanner.nextInt();
    }else{
      b = scanner.nextInt();
    }
    System.out.print(exp0(a, b));
  }
  
}



<|start_filename|>out/euler12.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
eratostene t max0 =
  let c i e =
        if i <= max0 - 1
        then ifM (((==) i) <$> (readIOA t i))
                 (do let j = i * i
                     let f = e + 1
                     let g h =
                           if h < max0 && h > 0
                           then do writeIOA t h 0
                                   let p = h + i
                                   g p
                           else c (i + 1) f in
                           g j)
                 (c (i + 1) e)
        else return e in
        c 2 0

fillPrimesFactors t n primes nprimes =
  let q i r =
        if i <= nprimes - 1
        then do d <- readIOA primes i
                let s u =
                      if (u `rem` d) == 0
                      then do writeIOA t d =<< (((+) 1) <$> (readIOA t d))
                              let v = u `quot` d
                              s v
                      else if u == 1
                           then readIOA primes i
                           else q (i + 1) u in
                      s r
        else return r in
        q 0 n

find ndiv2 =
  do era <- array_init 110 (\ j ->
                              return j)
     nprimes <- eratostene era 110
     primes <- array_init nprimes (\ o ->
                                     return 0)
     let w k x =
           if k <= 110 - 1
           then ifM (((==) k) <$> (readIOA era k))
                    (do writeIOA primes x k
                        let bc = x + 1
                        w (k + 1) bc)
                    (w (k + 1) x)
           else let y n =
                      if n <= 10000
                      then do primesFactors <- array_init (n + 2) (\ m ->
                                                                     return 0)
                              max0 <- ((max <$> (fillPrimesFactors primesFactors n primes nprimes) <*> (fillPrimesFactors primesFactors (n + 1) primes nprimes)))
                              writeIOA primesFactors 2 =<< ((-) <$> (readIOA primesFactors 2) <*> (return 1))
                              let z i ba =
                                    if i <= max0
                                    then ifM (((/=) 0) <$> (readIOA primesFactors i))
                                             (do bb <- (((*) ba) <$> (((+) 1) <$> (readIOA primesFactors i)))
                                                 z (i + 1) bb)
                                             (z (i + 1) ba)
                                    else if ba > ndiv2
                                         then return ((n * (n + 1)) `quot` 2)
                                         else {- print "n=" print n print "\t" print (n * (n + 1) / 2 ) print " " print ndivs print "\n" -}
                                              y (n + 1) in
                                    z 0 1
                      else return 0 in
                      y 1 in
           w 2 0

main =
  printf "%d\n" =<< ((find 500)::IO Int)




<|start_filename|>out/plus_petit.java<|end_filename|>
import java.util.*;

public class plus_petit
{
  static Scanner scanner = new Scanner(System.in);
  static int go0(int[] tab, int a, int b)
  {
    int m = (a + b) / 2;
    if (a == m)
        if (tab[a] == m)
            return b;
        else
            return a;
    int i = a;
    int j = b;
    while (i < j)
    {
        int e = tab[i];
        if (e < m)
            i++;
        else
        {
            j--;
            tab[i] = tab[j];
            tab[j] = e;
        }
    }
    if (i < m)
        return go0(tab, a, m);
    else
        return go0(tab, m, b);
  }
  static int plus_petit0(int[] tab, int len)
  {
    return go0(tab, 0, len);
  }
  public static void main(String args[])
  {
    int len = 0;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      len = -scanner.nextInt();
    }else{
      len = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int[] tab = new int[len];
    for (int i = 0; i < len; i++)
    {
        int tmp = 0;
        if (scanner.hasNext("^-")) {
          scanner.next("^-");
          tmp = -scanner.nextInt();
        }else{
          tmp = scanner.nextInt();
        }
        scanner.findWithinHorizon("[\n\r ]*", 1);
        tab[i] = tmp;
    }
    System.out.print(plus_petit0(tab, len));
  }
  
}



<|start_filename|>out/aaa_03binding.groovy<|end_filename|>
import java.util.*

int g(int i)
{
  int j = i * 4
  if (j % 2 == 1)
      return 0
  return j
}
void h(int i)
{
  System.out.printf("%d\n", i)
}

h(14)
int a = 4
int b = 5
print(a + b)
//  main 
h(15)
a = 2
b = 1
print(a + b)



<|start_filename|>out/aaa_041comment.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int main(void) {
    int i = 4;
    /*while i < 10 do */
    printf("%d", i);
    i++;
    /*  end */
    printf("%d", i);
    return 0;
}




<|start_filename|>out/euler24.js<|end_filename|>
var util = require("util");
function fact(n){
    var prod = 1;
    for (var i = 2; i <= n; i++)
        prod *= i;
    return prod;
}
function show(lim, nth){
    var t = new Array(lim);
    for (var i = 0; i < lim; i++)
        t[i] = i;
    var pris = new Array(lim);
    for (var j = 0; j < lim; j++)
        pris[j] = false;
    for (var k = 1; k < lim; k++)
    {
        var n = fact(lim - k);
        var nchiffre = ~~(nth / n);
        nth = ~~(nth % n);
        for (var l = 0; l < lim; l++)
            if (!pris[l])
            {
                if (nchiffre == 0)
                {
                    util.print(l);
                    pris[l] = true;
                }
                nchiffre--;
            }
    }
    for (var m = 0; m < lim; m++)
        if (!pris[m])
            util.print(m);
    util.print("\n");
}
show(10, 999999);



<|start_filename|>out/test_instant.groovy<|end_filename|>
import java.util.*

int foo(int a, int b)
{
  return a + b
}

print(10)



<|start_filename|>out/aaa_05array.groovy<|end_filename|>
import java.util.*

boolean[] id(boolean[] b)
{
  return b
}
void g(boolean[] t, int index)
{
  t[index] = false
}

int j = 0
boolean[] a = new boolean[5]
for (int i = 0; i < 5; i++)
{
    print(i)
    j += i
    a[i] = i % 2 == 0
}
System.out.printf("%d ", j)
if (a[0])
    print("True")
else
    print("False")
print("\n")
g(id(a), 0)
if (a[0])
    print("True")
else
    print("False")
print("\n")



<|start_filename|>out/small_inline.cc<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    std::vector<int> *t = new std::vector<int>( 2 );
    for (int d = 0; d < 2; d++)
    {
        std::cin >> t->at(d);
    }
    std::cout << t->at(0) << " - " << t->at(1) << "\n";
}



<|start_filename|>out/prologin_template_intlist.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class prologin_template_intlist
{
  static int programme_candidat(int[] tableau, int taille)
  {
    int out0 = 0;
    for (int i = 0; i < taille; i++)
        out0 += tableau[i];
    return out0;
  }
  
  public static void Main(String[] args)
  {
    int taille = int.Parse(Console.ReadLine());
    int[] tableau = new List<string>(Console.ReadLine().Split(" ".ToCharArray())).ConvertAll(int.Parse).ToArray();
    Console.Write(programme_candidat(tableau, taille) + "\n");
  }
  
}



<|start_filename|>out/euler03.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end

local maximum = 1
local b0 = 2
local a = 408464633
local sqrtia = math.floor(math.sqrt(a))
while a ~= 1 do
    local b = b0
    local found = false
    while b <= sqrtia do
        if math.fmod(a, b) == 0 then
            a = trunc(a / b)
            b0 = b
            b = a
            sqrtia = math.floor(math.sqrt(a))
            found = true
        end
        b = b + 1
    end
    if not(found) then
        io.write(string.format("%d\n", a))
        a = 1
    end
end


<|start_filename|>out/bigints.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int max2_(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}

int min2_(int a, int b) {
    if (a < b)
        return a;
    else
        return b;
}
typedef struct bigint {
  int bigint_sign;
    int bigint_len;
    int* bigint_chiffres;
} bigint;

struct bigint * read_bigint(int len) {
    int i, j;
    char c;
    int *chiffres = calloc(len, sizeof(int));
    for (j = 0; j < len; j++)
    {
        scanf("%c", &c);
        chiffres[j] = (int)(c);
    }
    for (i = 0; i <= (len - 1) / 2; i++)
    {
        int tmp = chiffres[i];
        chiffres[i] = chiffres[len - 1 - i];
        chiffres[len - 1 - i] = tmp;
    }
    struct bigint * e = malloc(sizeof(bigint));
    e->bigint_sign = 1;
    e->bigint_len = len;
    e->bigint_chiffres = chiffres;
    return e;
}

void print_bigint(struct bigint * a) {
    int i;
    if (!a->bigint_sign)
        printf("%c", '-');
    for (i = 0; i < a->bigint_len; i++)
        printf("%d", a->bigint_chiffres[a->bigint_len - 1 - i]);
}

int bigint_eq(struct bigint * a, struct bigint * b) {
    int i;
    /* Renvoie vrai si a = b */
    if (a->bigint_sign != b->bigint_sign)
        return 0;
    else if (a->bigint_len != b->bigint_len)
        return 0;
    else
    {
        for (i = 0; i < a->bigint_len; i++)
            if (a->bigint_chiffres[i] != b->bigint_chiffres[i])
                return 0;
        return 1;
    }
}

int bigint_gt(struct bigint * a, struct bigint * b) {
    int i;
    /* Renvoie vrai si a > b */
    if (a->bigint_sign && !b->bigint_sign)
        return 1;
    else if (!a->bigint_sign && b->bigint_sign)
        return 0;
    else
    {
        if (a->bigint_len > b->bigint_len)
            return a->bigint_sign;
        else if (a->bigint_len < b->bigint_len)
            return !a->bigint_sign;
        else
            for (i = 0; i < a->bigint_len; i++)
            {
                int j = a->bigint_len - 1 - i;
                if (a->bigint_chiffres[j] > b->bigint_chiffres[j])
                    return a->bigint_sign;
                else if (a->bigint_chiffres[j] < b->bigint_chiffres[j])
                    return !a->bigint_sign;
            }
        return 1;
    }
}

int bigint_lt(struct bigint * a, struct bigint * b) {
    return !bigint_gt(a, b);
}

struct bigint * add_bigint_positif(struct bigint * a, struct bigint * b) {
    int i;
    /* Une addition ou on en a rien a faire des signes */
    int len = max2_(a->bigint_len, b->bigint_len) + 1;
    int retenue = 0;
    int *chiffres = calloc(len, sizeof(int));
    for (i = 0; i < len; i++)
    {
        int tmp = retenue;
        if (i < a->bigint_len)
            tmp += a->bigint_chiffres[i];
        if (i < b->bigint_len)
            tmp += b->bigint_chiffres[i];
        retenue = tmp / 10;
        chiffres[i] = tmp % 10;
    }
    while (len > 0 && chiffres[len - 1] == 0)
        len--;
    struct bigint * f = malloc(sizeof(bigint));
    f->bigint_sign = 1;
    f->bigint_len = len;
    f->bigint_chiffres = chiffres;
    return f;
}

struct bigint * sub_bigint_positif(struct bigint * a, struct bigint * b) {
    int i;
    /* Une soustraction ou on en a rien a faire des signes
Pré-requis : a > b
*/
    int len = a->bigint_len;
    int retenue = 0;
    int *chiffres = calloc(len, sizeof(int));
    for (i = 0; i < len; i++)
    {
        int tmp = retenue + a->bigint_chiffres[i];
        if (i < b->bigint_len)
            tmp -= b->bigint_chiffres[i];
        if (tmp < 0)
        {
            tmp += 10;
            retenue = -1;
        }
        else
            retenue = 0;
        chiffres[i] = tmp;
    }
    while (len > 0 && chiffres[len - 1] == 0)
        len--;
    struct bigint * g = malloc(sizeof(bigint));
    g->bigint_sign = 1;
    g->bigint_len = len;
    g->bigint_chiffres = chiffres;
    return g;
}

struct bigint * neg_bigint(struct bigint * a) {
    struct bigint * h = malloc(sizeof(bigint));
    h->bigint_sign = !a->bigint_sign;
    h->bigint_len = a->bigint_len;
    h->bigint_chiffres = a->bigint_chiffres;
    return h;
}

struct bigint * add_bigint(struct bigint * a, struct bigint * b) {
    if (a->bigint_sign == b->bigint_sign)
        if (a->bigint_sign)
            return add_bigint_positif(a, b);
        else
            return neg_bigint(add_bigint_positif(a, b));
    else if (a->bigint_sign)
    {
        /* a positif, b negatif */
        if (bigint_gt(a, neg_bigint(b)))
            return sub_bigint_positif(a, b);
        else
            return neg_bigint(sub_bigint_positif(b, a));
    }
    else
        /* a negatif, b positif */
        if (bigint_gt(neg_bigint(a), b))
            return neg_bigint(sub_bigint_positif(a, b));
        else
            return sub_bigint_positif(b, a);
}

struct bigint * sub_bigint(struct bigint * a, struct bigint * b) {
    return add_bigint(a, neg_bigint(b));
}

struct bigint * mul_bigint_cp(struct bigint * a, struct bigint * b) {
    int l, i, j, k;
    /* Cet algorithm est quadratique.
C'est le même que celui qu'on enseigne aux enfants en CP.
D'ou le nom de la fonction. */
    int len = a->bigint_len + b->bigint_len + 1;
    int *chiffres = calloc(len, sizeof(int));
    for (k = 0; k < len; k++)
        chiffres[k] = 0;
    for (i = 0; i < a->bigint_len; i++)
    {
        int retenue = 0;
        for (j = 0; j < b->bigint_len; j++)
        {
            chiffres[i + j] += retenue + b->bigint_chiffres[j] * a->bigint_chiffres[i];
            retenue = chiffres[i + j] / 10;
            chiffres[i + j] = chiffres[i + j] % 10;
        }
        chiffres[i + b->bigint_len] += retenue;
    }
    chiffres[a->bigint_len + b->bigint_len] = chiffres[a->bigint_len + b->bigint_len - 1] / 10;
    chiffres[a->bigint_len + b->bigint_len - 1] = chiffres[a->bigint_len + b->bigint_len - 1] % 10;
    for (l = 0; l < 3; l++)
        if (len != 0 && chiffres[len - 1] == 0)
            len--;
    struct bigint * m = malloc(sizeof(bigint));
    m->bigint_sign = a->bigint_sign == b->bigint_sign;
    m->bigint_len = len;
    m->bigint_chiffres = chiffres;
    return m;
}

struct bigint * bigint_premiers_chiffres(struct bigint * a, int i) {
    int len = min2_(i, a->bigint_len);
    while (len != 0 && a->bigint_chiffres[len - 1] == 0)
        len--;
    struct bigint * o = malloc(sizeof(bigint));
    o->bigint_sign = a->bigint_sign;
    o->bigint_len = len;
    o->bigint_chiffres = a->bigint_chiffres;
    return o;
}

struct bigint * bigint_shift(struct bigint * a, int i) {
    int k;
    int *chiffres = calloc(a->bigint_len + i, sizeof(int));
    for (k = 0; k < a->bigint_len + i; k++)
        if (k >= i)
            chiffres[k] = a->bigint_chiffres[k - i];
        else
            chiffres[k] = 0;
    struct bigint * p = malloc(sizeof(bigint));
    p->bigint_sign = a->bigint_sign;
    p->bigint_len = a->bigint_len + i;
    p->bigint_chiffres = chiffres;
    return p;
}

struct bigint * mul_bigint(struct bigint * aa, struct bigint * bb) {
    if (aa->bigint_len == 0)
        return aa;
    else if (bb->bigint_len == 0)
        return bb;
    else if (aa->bigint_len < 3 || bb->bigint_len < 3)
        return mul_bigint_cp(aa, bb);
    /* Algorithme de Karatsuba */
    int split = min2_(aa->bigint_len, bb->bigint_len) / 2;
    struct bigint * a = bigint_shift(aa, -split);
    struct bigint * b = bigint_premiers_chiffres(aa, split);
    struct bigint * c = bigint_shift(bb, -split);
    struct bigint * d = bigint_premiers_chiffres(bb, split);
    struct bigint * amoinsb = sub_bigint(a, b);
    struct bigint * cmoinsd = sub_bigint(c, d);
    struct bigint * ac = mul_bigint(a, c);
    struct bigint * bd = mul_bigint(b, d);
    struct bigint * amoinsbcmoinsd = mul_bigint(amoinsb, cmoinsd);
    struct bigint * acdec = bigint_shift(ac, 2 * split);
    return add_bigint(add_bigint(acdec, bd), bigint_shift(sub_bigint(add_bigint(ac, bd), amoinsbcmoinsd), split));
    /* ac × 102k + (ac + bd – (a – b)(c – d)) × 10k + bd */
}
/* 
Division,
Modulo
 */


int log10(int a) {
    int out0 = 1;
    while (a >= 10)
    {
        a /= 10;
        out0++;
    }
    return out0;
}

struct bigint * bigint_of_int(int i) {
    int k, j;
    int size = log10(i);
    if (i == 0)
        size = 0;
    int *t = calloc(size, sizeof(int));
    for (j = 0; j < size; j++)
        t[j] = 0;
    for (k = 0; k < size; k++)
    {
        t[k] = i % 10;
        i /= 10;
    }
    struct bigint * q = malloc(sizeof(bigint));
    q->bigint_sign = 1;
    q->bigint_len = size;
    q->bigint_chiffres = t;
    return q;
}

struct bigint * fact_bigint(struct bigint * a) {
    struct bigint * one = bigint_of_int(1);
    struct bigint * out0 = one;
    while (!bigint_eq(a, one))
    {
        out0 = mul_bigint(a, out0);
        a = sub_bigint(a, one);
    }
    return out0;
}

int sum_chiffres_bigint(struct bigint * a) {
    int i;
    int out0 = 0;
    for (i = 0; i < a->bigint_len; i++)
        out0 += a->bigint_chiffres[i];
    return out0;
}
/*  http://projecteuler.net/problem=20  */


int euler20() {
    struct bigint * a = bigint_of_int(15);
    /* normalement c'est 100 */
    a = fact_bigint(a);
    return sum_chiffres_bigint(a);
}

struct bigint * bigint_exp(struct bigint * a, int b) {
    if (b == 1)
        return a;
    else if (b % 2 == 0)
        return bigint_exp(mul_bigint(a, a), b / 2);
    else
        return mul_bigint(a, bigint_exp(a, b - 1));
}

struct bigint * bigint_exp_10chiffres(struct bigint * a, int b) {
    a = bigint_premiers_chiffres(a, 10);
    if (b == 1)
        return a;
    else if (b % 2 == 0)
        return bigint_exp_10chiffres(mul_bigint(a, a), b / 2);
    else
        return mul_bigint(a, bigint_exp_10chiffres(a, b - 1));
}

void euler48() {
    int i;
    struct bigint * sum = bigint_of_int(0);
    for (i = 1; i < 101; i++)
    {
        /* 1000 normalement */
        struct bigint * ib = bigint_of_int(i);
        struct bigint * ibeib = bigint_exp_10chiffres(ib, i);
        sum = add_bigint(sum, ibeib);
        sum = bigint_premiers_chiffres(sum, 10);
    }
    printf("euler 48 = ");
    print_bigint(sum);
    printf("\n");
}

int euler16() {
    struct bigint * a = bigint_of_int(2);
    a = bigint_exp(a, 100);
    /* 1000 normalement */
    return sum_chiffres_bigint(a);
}

int euler25() {
    int i = 2;
    struct bigint * a = bigint_of_int(1);
    struct bigint * b = bigint_of_int(1);
    while (b->bigint_len < 100)
    {
        /* 1000 normalement */
        struct bigint * c = add_bigint(a, b);
        a = b;
        b = c;
        i++;
    }
    return i;
}

int euler29() {
    int l, i, k, j2, j;
    int maxA = 5;
    int maxB = 5;
    struct bigint * *a_bigint = calloc(maxA + 1, sizeof(struct bigint *));
    for (j = 0; j <= maxA; j++)
        a_bigint[j] = bigint_of_int(j * j);
    struct bigint * *a0_bigint = calloc(maxA + 1, sizeof(struct bigint *));
    for (j2 = 0; j2 <= maxA; j2++)
        a0_bigint[j2] = bigint_of_int(j2);
    int *b = calloc(maxA + 1, sizeof(int));
    for (k = 0; k <= maxA; k++)
        b[k] = 2;
    int n = 0;
    int found = 1;
    while (found)
    {
        struct bigint * min0 = a0_bigint[0];
        found = 0;
        for (i = 2; i <= maxA; i++)
            if (b[i] <= maxB)
                if (found)
                {
                    if (bigint_lt(a_bigint[i], min0))
                        min0 = a_bigint[i];
                }
                else
                {
                    min0 = a_bigint[i];
                    found = 1;
                }
        if (found)
        {
            n++;
            for (l = 2; l <= maxA; l++)
                if (bigint_eq(a_bigint[l], min0) && b[l] <= maxB)
                {
                    b[l]++;
                    a_bigint[l] = mul_bigint(a_bigint[l], a0_bigint[l]);
                }
        }
    }
    return n;
}
int main(void) {
    int i;
    printf("%d\n", euler29());
    struct bigint * sum = read_bigint(50);
    for (i = 2; i < 101; i++)
    {
        scanf(" ");
        struct bigint * tmp = read_bigint(50);
        sum = add_bigint(sum, tmp);
    }
    printf("euler13 = ");
    print_bigint(sum);
    printf("\neuler25 = %d\neuler16 = %d\n", euler25(), euler16());
    euler48();
    printf("euler20 = %d\n", euler20());
    struct bigint * a = bigint_of_int(999999);
    struct bigint * b = bigint_of_int(9951263);
    print_bigint(a);
    printf(">>1=");
    print_bigint(bigint_shift(a, -1));
    printf("\n");
    print_bigint(a);
    printf("*");
    print_bigint(b);
    printf("=");
    print_bigint(mul_bigint(a, b));
    printf("\n");
    print_bigint(a);
    printf("*");
    print_bigint(b);
    printf("=");
    print_bigint(mul_bigint_cp(a, b));
    printf("\n");
    print_bigint(a);
    printf("+");
    print_bigint(b);
    printf("=");
    print_bigint(add_bigint(a, b));
    printf("\n");
    print_bigint(b);
    printf("-");
    print_bigint(a);
    printf("=");
    print_bigint(sub_bigint(b, a));
    printf("\n");
    print_bigint(a);
    printf("-");
    print_bigint(b);
    printf("=");
    print_bigint(sub_bigint(a, b));
    printf("\n");
    print_bigint(a);
    printf(">");
    print_bigint(b);
    printf("=");
    if (bigint_gt(a, b))
        printf("True");
    else
        printf("False");
    printf("\n");
    return 0;
}




<|start_filename|>out/euler40.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int exp0(int a, int e) {
    int i;
    int o = 1;
    for (i = 1; i <= e; i++)
        o *= a;
    return o;
}

int e(int* t, int n) {
    int i;
    for (i = 1; i < 9; i++)
        if (n >= t[i] * i)
            n -= t[i] * i;
        else
        {
            int nombre = exp0(10, i - 1) + n / i;
            int chiffre = i - 1 - n % i;
            return nombre / exp0(10, chiffre) % 10;
        }
    return -1;
}
int main(void) {
    int l, k2, j2, k, j, i2, i;
    int *t = calloc(9, sizeof(int));
    for (i = 0; i < 9; i++)
        t[i] = exp0(10, i) - exp0(10, i - 1);
    for (i2 = 1; i2 < 9; i2++)
        printf("%d => %d\n", i2, t[i2]);
    for (j = 0; j < 81; j++)
        printf("%d", e(t, j));
    printf("\n");
    for (k = 1; k < 51; k++)
        printf("%d", k);
    printf("\n");
    for (j2 = 169; j2 < 221; j2++)
        printf("%d", e(t, j2));
    printf("\n");
    for (k2 = 90; k2 < 111; k2++)
        printf("%d", k2);
    printf("\n");
    int out0 = 1;
    for (l = 0; l < 7; l++)
    {
        int puiss = exp0(10, l);
        int v = e(t, puiss - 1);
        out0 *= v;
        printf("10^%d=%d v=%d\n", l, puiss, v);
    }
    printf("%d\n", out0);
    return 0;
}




<|start_filename|>out/prologin_template_charline.lua<|end_filename|>

function readcharline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), ".") do
    tab[index] = string.byte(a)
    index = index + 1
  end
  return tab
end
function programme_candidat (tableau, taille)
  local out0 = 0
  for i = 0, taille - 1 do
      out0 = out0 + tableau[i + 1] * i
      io.write(string.format("%c", tableau[i + 1]))
  end
  io.write("--\n")
  return out0
end

local taille = tonumber(io.read('*l'))
local tableau = readcharline()
io.write(string.format("%d\n", programme_candidat(tableau, taille)))


<|start_filename|>out/sort.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int[] copytab(int[] tab, int len)
{
  int[] o = new int[len]
  for (int i = 0; i < len; i++)
      o[i] = tab[i]
  return o
}
void bubblesort(int[] tab, int len)
{
  for (int i = 0; i < len; i++)
      for (int j = i + 1; j < len; j++)
          if (tab[i] > tab[j])
          {
              int tmp = tab[i]
              tab[i] = tab[j]
              tab[j] = tmp
          }
}
void qsort0(int[] tab, int len, int i, int j)
{
  if (i < j)
  {
      int i0 = i
      int j0 = j
      //  pivot : tab[0] 
      while (i != j)
          if (tab[i] > tab[j])
              if (i == j - 1)
              {
                  //  on inverse simplement
                  int tmp = tab[i]
                  tab[i] = tab[j]
                  tab[j] = tmp
                  i++
              }
              else
              {
                  //  on place tab[i+1] à la place de tab[j], tab[j] à la place de tab[i] et tab[i] à la place de tab[i+1] 
                  int tmp = tab[i]
                  tab[i] = tab[j]
                  tab[j] = tab[i + 1]
                  tab[i + 1] = tmp
                  i++
              }
          else
              j--
      qsort0(tab, len, i0, i - 1)
      qsort0(tab, len, i + 1, j0)
  }
}
@Field Scanner scanner = new Scanner(System.in)
int len = 2
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  len = -scanner.nextInt()
}else{
  len = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
int[] tab = new int[len]
for (int i_ = 0; i_ < len; i_++)
{
    int tmp = 0
    if (scanner.hasNext("^-")) {
      scanner.next("^-")
      tmp = -scanner.nextInt()
    }else{
      tmp = scanner.nextInt()
    }
    scanner.findWithinHorizon("[\n\r ]*", 1)
    tab[i_] = tmp
}
int[] tab2 = copytab(tab, len)
bubblesort(tab2, len)
for (int i = 0; i < len; i++)
    System.out.printf("%d ", tab2[i])
print("\n")
int[] tab3 = copytab(tab, len)
qsort0(tab3, len, 0, len - 1)
for (int i = 0; i < len; i++)
    System.out.printf("%d ", tab3[i])
print("\n")



<|start_filename|>out/triangles.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure triangles is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
-- Ce code a été généré par metalang
--   Il gère les entrées sorties pour un programme dynamique classique
--   dans les épreuves de prologin
--on le retrouve ici : http://projecteuler.net/problem=18
--

type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
type b is Array (Integer range <>) of a_PTR;
type b_PTR is access b;
function find0(len : in Integer; tab : in b_PTR; cache : in b_PTR; x : in Integer; y : in Integer) return Integer is
  result : Integer;
  out1 : Integer;
  out0 : Integer;
begin
  --
  --	Cette fonction est récursive
  --	
  
  if y = len - 1
  then
    return tab(y)(x);
  else
    if x > y
    then
      return (-10000);
    else
      if cache(y)(x) /= 0
      then
        return cache(y)(x);
      end if;
    end if;
  end if;
  result := 0;
  out0 := find0(len, tab, cache, x, y + 1);
  out1 := find0(len, tab, cache, x + 1, y + 1);
  if out0 > out1
  then
    result := out0 + tab(y)(x);
  else
    result := out1 + tab(y)(x);
  end if;
  cache(y)(x) := result;
  return result;
end;
function find(len : in Integer; tab : in b_PTR) return Integer is
  tab3 : a_PTR;
  tab2 : b_PTR;
begin
  tab2 := new b (0..len - 1);
  for i in integer range 0..len - 1 loop
    tab3 := new a (0..i);
    for j in integer range 0..i loop
      tab3(j) := 0;
    end loop;
    tab2(i) := tab3;
  end loop;
  return find0(len, tab, tab2, 0, 0);
end;

  tmp : Integer;
  tab2 : a_PTR;
  tab : b_PTR;
  len : Integer;
begin
  Get(len);
  SkipSpaces;
  tab := new b (0..len - 1);
  for i in integer range 0..len - 1 loop
    tab2 := new a (0..i);
    for j in integer range 0..i loop
      Get(tmp);
      SkipSpaces;
      tab2(j) := tmp;
    end loop;
    tab(i) := tab2;
  end loop;
  PInt(find(len, tab));
  PString(new char_array'( To_C("" & Character'Val(10))));
  for k in integer range 0..len - 1 loop
    for l in integer range 0..k loop
      PInt(tab(k)(l));
      PString(new char_array'( To_C(" ")));
    end loop;
    PString(new char_array'( To_C("" & Character'Val(10))));
  end loop;
end;


<|start_filename|>out/min3.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int min2_(int a, int b) {
    if (a < b)
        return a;
    else
        return b;
}
int main(void) {
    printf("%d %d %d %d %d %d\n", min2_(min2_(2, 3), 4), min2_(min2_(2, 4), 3), min2_(min2_(3, 2), 4), min2_(min2_(3, 4), 2), min2_(min2_(4, 2), 3), min2_(min2_(4, 3), 2));
    return 0;
}




<|start_filename|>out/triangles.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

/*  Ce code a été généré par metalang
   Il gère les entrées sorties pour un programme dynamique classique
   dans les épreuves de prologin
on le retrouve ici : http://projecteuler.net/problem=18
 */


int find0(int len, int** tab, int** cache, int x, int y) {
    /*
	Cette fonction est récursive
	*/
    if (y == len - 1)
        return tab[y][x];
    else if (x > y)
        return -10000;
    else if (cache[y][x] != 0)
        return cache[y][x];
    int result = 0;
    int out0 = find0(len, tab, cache, x, y + 1);
    int out1 = find0(len, tab, cache, x + 1, y + 1);
    if (out0 > out1)
        result = out0 + tab[y][x];
    else
        result = out1 + tab[y][x];
    cache[y][x] = result;
    return result;
}

int find(int len, int** tab) {
    int i, j;
    int* *tab2 = calloc(len, sizeof(int*));
    for (i = 0; i < len; i++)
    {
        int *tab3 = calloc(i + 1, sizeof(int));
        for (j = 0; j <= i; j++)
            tab3[j] = 0;
        tab2[i] = tab3;
    }
    return find0(len, tab, tab2, 0, 0);
}
int main(void) {
    int k, l, i, j, tmp, len;
    scanf("%d ", &len);
    int* *tab = calloc(len, sizeof(int*));
    for (i = 0; i < len; i++)
    {
        int *tab2 = calloc(i + 1, sizeof(int));
        for (j = 0; j <= i; j++)
        {
            scanf("%d ", &tmp);
            tab2[j] = tmp;
        }
        tab[i] = tab2;
    }
    printf("%d\n", find(len, tab));
    for (k = 0; k < len; k++)
    {
        for (l = 0; l <= k; l++)
            printf("%d ", tab[k][l]);
        printf("\n");
    }
    return 0;
}




<|start_filename|>out/aaa_08tuple.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

typedef struct tuple_int_int {
  int tuple_int_int_field_0;
    int tuple_int_int_field_1;
} tuple_int_int;
typedef struct toto {
  struct tuple_int_int * foo;
    int bar;
} toto;
int main(void) {
    int d, c, bar_;
    scanf("%d %d %d ", &bar_, &c, &d);
    struct tuple_int_int * e = malloc(sizeof(tuple_int_int));
    e->tuple_int_int_field_0 = c;
    e->tuple_int_int_field_1 = d;
    struct toto * t = malloc(sizeof(toto));
    t->foo = e;
    t->bar = bar_;
    struct tuple_int_int * f = t->foo;
    int a = f->tuple_int_int_field_0;
    int b = f->tuple_int_int_field_1;
    printf("%d %d %d\n", a, b, t->bar);
    return 0;
}




<|start_filename|>out/euler36.groovy<|end_filename|>
import java.util.*

boolean palindrome2(int[] pow2, int n)
{
  boolean[] t = new boolean[20]
  for (int i = 0; i < 20; i++)
      t[i] = n.intdiv(pow2[i]) % 2 == 1
  int nnum = 0
  for (int j = 1; j < 20; j++)
      if (t[j])
          nnum = j
  for (int k = 0; k <= nnum.intdiv(2); k++)
      if (t[k] != t[nnum - k])
          return false
  return true
}

int p = 1
int[] pow2 = new int[20]
for (int i = 0; i < 20; i++)
{
    p *= 2
    pow2[i] = p.intdiv(2)
}
int sum = 0
for (int d = 1; d < 10; d++)
{
    if (palindrome2(pow2, d))
    {
        System.out.printf("%d\n", d)
        sum += d
    }
    if (palindrome2(pow2, d * 10 + d))
    {
        System.out.printf("%d\n", d * 10 + d)
        sum += d * 10 + d
    }
}
for (int a0 = 0; a0 < 5; a0++)
{
    int a = a0 * 2 + 1
    for (int b = 0; b < 10; b++)
    {
        for (int c = 0; c < 10; c++)
        {
            int num0 = a * 100000 + b * 10000 + c * 1000 + c * 100 + b * 10 + a
            if (palindrome2(pow2, num0))
            {
                System.out.printf("%d\n", num0)
                sum += num0
            }
            int num1 = a * 10000 + b * 1000 + c * 100 + b * 10 + a
            if (palindrome2(pow2, num1))
            {
                System.out.printf("%d\n", num1)
                sum += num1
            }
        }
        int num2 = a * 100 + b * 10 + a
        if (palindrome2(pow2, num2))
        {
            System.out.printf("%d\n", num2)
            sum += num2
        }
        int num3 = a * 1000 + b * 100 + b * 10 + a
        if (palindrome2(pow2, num3))
        {
            System.out.printf("%d\n", num3)
            sum += num3
        }
    }
}
System.out.printf("sum=%d\n", sum)



<|start_filename|>out/test_instant.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
foo a b =
  return (a + b)

main =
  printf "%d" (10 :: Int) :: IO ()




<|start_filename|>out/triangles.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
find0 len tab cache x y =
  {-
	Cette fonction est récursive
	-}
  if y == len - 1
  then join $ readIOA <$> (readIOA tab y) <*> return x
  else if x > y
       then return (- 10000)
       else ifM (((/=) 0) <$> (join $ readIOA <$> (readIOA cache y) <*> return x))
                (join $ readIOA <$> (readIOA cache y) <*> return x)
                (do out0 <- find0 len tab cache x (y + 1)
                    out1 <- find0 len tab cache (x + 1) (y + 1)
                    a <- if out0 > out1
                         then (((+) out0) <$> (join $ readIOA <$> (readIOA tab y) <*> return x))
                         else (((+) out1) <$> (join $ readIOA <$> (readIOA tab y) <*> return x))
                    join $ writeIOA <$> (readIOA cache y) <*> return x <*> return a
                    return a)

find len tab =
  do tab2 <- array_init len (\ i ->
                               array_init (i + 1) (\ j ->
                                                     return 0))
     find0 len tab tab2 0 0

main =
  do len <- read_int
     skip_whitespaces
     tab <- array_init len (\ i ->
                              array_init (i + 1) (\ j ->
                                                    do tmp <- read_int
                                                       skip_whitespaces
                                                       return tmp))
     printf "%d\n" =<< ((find len tab)::IO Int)
     let b k =
           if k <= len - 1
           then let c l =
                      if l <= k
                      then do printf "%d " =<< ((join $ readIOA <$> (readIOA tab k) <*> return l)::IO Int)
                              c (l + 1)
                      else do printf "\n" :: IO ()
                              b (k + 1) in
                      c 0
           else return () in
           b 0




<|start_filename|>out/testing_count.fs<|end_filename|>
: cnt { a } a 1 cells - @ ;
: main
  40 dup HERE SWAP 1 + cells allot dup -rot ! 1 cells + { tab }
  39 0 BEGIN 2dup >= WHILE DUP { i }
    i i * tab  i cells +  !
   1 + REPEAT 2DROP
  tab cnt s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/aaa_11arrayconst.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_11arrayconst is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
procedure test(tab : in a_PTR; len : in Integer) is
begin
  for i in integer range 0..len - 1 loop
    PInt(tab(i));
    PString(new char_array'( To_C(" ")));
  end loop;
  PString(new char_array'( To_C("" & Character'Val(10))));
end;

  t : a_PTR;
begin
  t := new a (0..4);
  for i in integer range 0..4 loop
    t(i) := 1;
  end loop;
  test(t, 5);
end;


<|start_filename|>out/euler26.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler26 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type e is Array (Integer range <>) of Integer;
type e_PTR is access e;
function periode(restes : in e_PTR; c : in Integer; d : in Integer; b : in Integer) return Integer is
  reste : Integer;
  len : Integer;
  chiffre : Integer;
  a : Integer;
begin
  len := c;
  a := d;
  while a /= 0 loop
    chiffre := a / b;
    reste := a rem b;
    for i in integer range 0..len - 1 loop
      if restes(i) = reste
      then
        return len - i;
      end if;
    end loop;
    restes(len) := reste;
    len := len + 1;
    a := reste * 10;
  end loop;
  return 0;
end;

  t : e_PTR;
  p : Integer;
  mi : Integer;
  m : Integer;
begin
  t := new e (0..999);
  for j in integer range 0..999 loop
    t(j) := 0;
  end loop;
  m := 0;
  mi := 0;
  for i in integer range 1..1000 loop
    p := periode(t, 0, 1, i);
    if p > m
    then
      mi := i;
      m := p;
    end if;
  end loop;
  PInt(mi);
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(m);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/aaa_05array.js<|end_filename|>
var util = require("util");
function id(b){
    return b;
}
function g(t, index){
    t[index] = false;
}
var j = 0;
var a = new Array(5);
for (var i = 0; i < 5; i++)
{
    util.print(i);
    j += i;
    a[i] = ~~(i % 2) == 0;
}
util.print(j, " ");
if (a[0])
    util.print("True");
else
    util.print("False");
util.print("\n");
g(id(a), 0);
if (a[0])
    util.print("True");
else
    util.print("False");
util.print("\n");



<|start_filename|>out/aaa_read2.java<|end_filename|>
import java.util.*;

public class aaa_read2
{
  static Scanner scanner = new Scanner(System.in);
  static int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

  /*
Ce test permet de vérifier si les différents backends pour les langages implémentent bien
read int, read char et skip
*/
  public static void main(String args[])
  {
    int len = Integer.parseInt(scanner.nextLine());
    System.out.printf("%d=len\n", len);
    int[] tab = read_int_line();
    for (int i = 0; i < len; i++)
        System.out.printf("%d=>%d ", i, tab[i]);
    System.out.print("\n");
    int[] tab2 = read_int_line();
    for (int i_ = 0; i_ < len; i_++)
        System.out.printf("%d==>%d ", i_, tab2[i_]);
    int strlen = Integer.parseInt(scanner.nextLine());
    System.out.printf("%d=strlen\n", strlen);
    char[] tab4 = scanner.nextLine().toCharArray();
    for (int i3 = 0; i3 < strlen; i3++)
    {
        char tmpc = tab4[i3];
        int c = (int)(tmpc);
        System.out.printf("%c:%d ", tmpc, c);
        if (tmpc != ' ')
            c = (c - (int)('a') + 13) % 26 + (int)('a');
        tab4[i3] = (char)(c);
    }
    for (int j = 0; j < strlen; j++)
        System.out.print(tab4[j]);
  }
  
}



<|start_filename|>out/aaa_06readcouple.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_06readcouple is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;

type d is Array (Integer range <>) of Integer;
type d_PTR is access d;

  l : d_PTR;
  b : Integer;
  a : Integer;
begin
  for i in integer range 1..3 loop
    Get(a);
    SkipSpaces;
    Get(b);
    SkipSpaces;
    PString(new char_array'( To_C("a = ")));
    PInt(a);
    PString(new char_array'( To_C(" b = ")));
    PInt(b);
    PString(new char_array'( To_C("" & Character'Val(10))));
  end loop;
  l := new d (0..9);
  for c in integer range 0..9 loop
    Get(l(c));
    SkipSpaces;
  end loop;
  for j in integer range 0..9 loop
    PInt(l(j));
    PString(new char_array'( To_C("" & Character'Val(10))));
  end loop;
end;


<|start_filename|>out/tuple.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure tuple is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type tuple_int_int;
type tuple_int_int_PTR is access tuple_int_int;
type tuple_int_int is record
  tuple_int_int_field_0 : Integer;
  tuple_int_int_field_1 : Integer;
end record;
function f(tuple0 : in tuple_int_int_PTR) return tuple_int_int_PTR is
  d : tuple_int_int_PTR;
  c : tuple_int_int_PTR;
  b : Integer;
  a : Integer;
begin
  c := tuple0;
  a := c.tuple_int_int_field_0;
  b := c.tuple_int_int_field_1;
  d := new tuple_int_int;
  d.tuple_int_int_field_0 := a + 1;
  d.tuple_int_int_field_1 := b + 1;
  return d;
end;

  t : tuple_int_int_PTR;
  g : tuple_int_int_PTR;
  e : tuple_int_int_PTR;
  b : Integer;
  a : Integer;
begin
  e := new tuple_int_int;
  e.tuple_int_int_field_0 := 0;
  e.tuple_int_int_field_1 := 1;
  t := f(e);
  g := t;
  a := g.tuple_int_int_field_0;
  b := g.tuple_int_int_field_1;
  PInt(a);
  PString(new char_array'( To_C(" -- ")));
  PInt(b);
  PString(new char_array'( To_C("--" & Character'Val(10))));
end;


<|start_filename|>out/euler28.js<|end_filename|>
var util = require("util");
/*

43 44 45 46 47 48 49
42 21 22 23 24 25 26
41 20  7  8  9 10 27
40 19  6  1  2 11 28
39 18  5  4  3 12 29
38 17 16 15 14 13 30
37 36 35 34 33 32 31

1 3 5 7 9 13 17 21 25 31 37 43 49
  2 2 2 2 4  4  4  4  6   6  6  6


*/
function sumdiag(n){
    var nterms = n * 2 - 1;
    var un = 1;
    var sum = 1;
    for (var i = 0; i < nterms - 1; i++)
    {
        var d = 2 * (1 + ~~(i / 4));
        un += d;
        //  print int d print "=>" print un print " " 
        sum += un;
    }
    return sum;
}
util.print(sumdiag(1001));



<|start_filename|>out/affect.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
--[[
Ce test permet de vérifier que l'implémentation de l'affectation fonctionne correctement
--]]

function mktoto (v1)
  local t = {foo=v1, bar=v1, blah=v1}
  return t
end

function mktoto2 (v1)
  local t = {foo=v1 + 3, bar=v1 + 2, blah=v1 + 1}
  return t
end

function result (t_, t2_)
  local t = t_
  local t2 = t2_
  local t3 = {foo=0, bar=0, blah=0}
  t3 = t2
  t = t2
  t2 = t3
  t.blah = t.blah + 1
  local len = 1
  local cache0 = {}
  for i = 0, len - 1 do
      cache0[i + 1] = -i
  end
  local cache1 = {}
  for j = 0, len - 1 do
      cache1[j + 1] = j
  end
  local cache2 = cache0
  cache0 = cache1
  cache2 = cache0
  return t.foo + t.blah * t.bar + t.bar * t.foo
end

local t = mktoto(4)
local t2 = mktoto(5)
t.bar = readint()
stdinsep()
t.blah = readint()
stdinsep()
t2.bar = readint()
stdinsep()
t2.blah = readint()
io.write(string.format("%d%d", result(t, t2), t.blah))


<|start_filename|>out/cambriolage.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

int nbPassePartout(int n, std::vector<std::vector<int>>& passepartout, int m, std::vector<std::vector<int>>& serrures) {
    int max_ancient = 0;
    int max_recent = 0;
    for (int i = 0; i < m; i++)
    {
        if (serrures[i][0] == -1 && serrures[i][1] > max_ancient)
            max_ancient = serrures[i][1];
        if (serrures[i][0] == 1 && serrures[i][1] > max_recent)
            max_recent = serrures[i][1];
    }
    int max_ancient_pp = 0;
    int max_recent_pp = 0;
    for (int i = 0; i < n; i++)
    {
        std::vector<int> pp = passepartout[i];
        if (pp[0] >= max_ancient && pp[1] >= max_recent)
            return 1;
        max_ancient_pp = std::max(max_ancient_pp, pp[0]);
        max_recent_pp = std::max(max_recent_pp, pp[1]);
    }
    if (max_ancient_pp >= max_ancient && max_recent_pp >= max_recent)
        return 2;
    else
        return 0;
}

int main() {
    int out_, m, out01, n;
    std::cin >> n;
    std::vector<std::vector<int>> passepartout( n );
    for (int i = 0; i < n; i++)
    {
        std::vector<int> out0( 2 );
        for (int j = 0; j < 2; j++)
        {
            std::cin >> out01;
            out0[j] = out01;
        }
        passepartout[i] = out0;
    }
    std::cin >> m;
    std::vector<std::vector<int>> serrures( m );
    for (int k = 0; k < m; k++)
    {
        std::vector<int> out1( 2 );
        for (int l = 0; l < 2; l++)
        {
            std::cin >> out_;
            out1[l] = out_;
        }
        serrures[k] = out1;
    }
    std::cout << nbPassePartout(n, passepartout, m, serrures);
}



<|start_filename|>out/euler11.lua<|end_filename|>

function readintline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), "-?%d+") do
    tab[index] = tonumber(a)
    index = index + 1
  end
  return tab
end
function find (n, m, x, y, dx, dy)
  if x < 0 or x == 20 or y < 0 or y == 20 then
      return -1
  elseif n == 0 then
      return 1
  else 
      return m[y + 1][x + 1] * find(n - 1, m, x + dx, y + dy, dx, dy)
  end
end

local directions = {}
for i = 0, 7 do
    if i == 0 then
        directions[i + 1] = table.pack(0, 1)
    elseif i == 1 then
        directions[i + 1] = table.pack(1, 0)
    elseif i == 2 then
        directions[i + 1] = table.pack(0, -1)
    elseif i == 3 then
        directions[i + 1] = table.pack(-1, 0)
    elseif i == 4 then
        directions[i + 1] = table.pack(1, 1)
    elseif i == 5 then
        directions[i + 1] = table.pack(1, -1)
    elseif i == 6 then
        directions[i + 1] = table.pack(-1, 1)
    else 
        directions[i + 1] = table.pack(-1, -1)
    end
end
local max0 = 0
local m = {}
for c = 0, 19 do
    m[c + 1] = readintline()
end
for j = 0, 7 do
    dx, dy = table.unpack(directions[j + 1])
    for x = 0, 19 do
        for y = 0, 19 do
            max0 = math.max(max0, find(4, m, x, y, dx, dy))
        end
    end
end
io.write(string.format("%d\n", max0))


<|start_filename|>out/euler02.lua<|end_filename|>

local a = 1
local b = 2
local sum = 0
while a < 4000000 do
    if math.fmod(a, 2) == 0 then
        sum = sum + a
    end
    local c = a
    a = b
    b = b + c
end
io.write(string.format("%d\n", sum))


<|start_filename|>out/aaa_read.cc<|end_filename|>
#include <iostream>
#include <vector>
/*
Ce test permet de vérifier si les différents backends pour les langages implémentent bien
read int, read char et skip
*/
int main() {
    int strlen, tmpi2, tmpi1, len;
    char tmpc;
    std::cin >> len;
    std::cout << len << "=len\n";
    len *= 2;
    std::cout << "len*2=" << len << "\n";
    len /= 2;
    std::vector<int> *tab = new std::vector<int>( len );
    for (int i = 0; i < len; i++)
    {
        std::cin >> tmpi1;
        std::cout << i << "=>" << tmpi1 << " ";
        tab->at(i) = tmpi1;
    }
    std::cout << "\n";
    std::vector<int> *tab2 = new std::vector<int>( len );
    for (int i_ = 0; i_ < len; i_++)
    {
        std::cin >> tmpi2;
        std::cout << i_ << "==>" << tmpi2 << " ";
        tab2->at(i_) = tmpi2;
    }
    std::cin >> strlen;
    std::cout << strlen << "=strlen\n";
    std::vector<char> *tab4 = new std::vector<char>( strlen );
    for (int toto = 0; toto < strlen; toto++)
    {
        std::cin >> tmpc >> std::noskipws;
        int c = (int)(tmpc);
        std::cout << tmpc << ":" << c << " ";
        if (tmpc != ' ')
            c = (c - (int)('a') + 13) % 26 + (int)('a');
        tab4->at(toto) = (char)(c);
    }
    for (int j = 0; j < strlen; j++)
        std::cout << tab4->at(j);
}



<|start_filename|>out/tuple.groovy<|end_filename|>
import java.util.*

class Tuple_int_int {
  int tuple_int_int_field_0
  int tuple_int_int_field_1
}
Tuple_int_int f(Tuple_int_int tuple0)
{
  Tuple_int_int c = tuple0
  int a = c.tuple_int_int_field_0
  int b = c.tuple_int_int_field_1
  Tuple_int_int d = new Tuple_int_int()
  d.tuple_int_int_field_0 = a + 1
  d.tuple_int_int_field_1 = b + 1
  return d
}

Tuple_int_int e = new Tuple_int_int()
e.tuple_int_int_field_0 = 0
e.tuple_int_int_field_1 = 1
Tuple_int_int t = f(e)
Tuple_int_int g = t
int a = g.tuple_int_int_field_0
int b = g.tuple_int_int_field_1
System.out.printf("%d -- %d--\n", a, b)



<|start_filename|>out/vigenere.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_char_(){
    if (current_char == null) current_char = read_char0();
    var out = current_char;
    current_char = read_char0();
    return out;
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function position_alphabet(c){
    var i = c.charCodeAt(0);
    if (i <= 'Z'.charCodeAt(0) && i >= 'A'.charCodeAt(0))
        return i - 'A'.charCodeAt(0);
    else if (i <= 'z'.charCodeAt(0) && i >= 'a'.charCodeAt(0))
        return i - 'a'.charCodeAt(0);
    else
        return -1;
}
function of_position_alphabet(c){
    return String.fromCharCode(c + 'a'.charCodeAt(0));
}
function crypte(taille_cle, cle, taille, message){
    for (var i = 0; i < taille; i++)
    {
        var lettre = position_alphabet(message[i]);
        if (lettre != -1)
        {
            var addon = position_alphabet(cle[~~(i % taille_cle)]);
            var new0 = ~~((addon + lettre) % 26);
            message[i] = of_position_alphabet(new0);
        }
    }
}
var taille_cle = read_int_();
stdinsep();
var cle = new Array(taille_cle);
for (var index = 0; index < taille_cle; index++)
{
    var out0 = read_char_();
    cle[index] = out0;
}
stdinsep();
var taille = read_int_();
stdinsep();
var message = new Array(taille);
for (var index2 = 0; index2 < taille; index2++)
{
    var out2 = read_char_();
    message[index2] = out2;
}
crypte(taille_cle, cle, taille, message);
for (var i = 0; i < taille; i++)
    util.print(message[i]);
util.print("\n");



<|start_filename|>out/sqrttest.fs<|end_filename|>
: main
  4 s>f fsqrt f>s s>d 0 d.r
  S"  " TYPE
  16 s>f fsqrt f>s s>d 0 d.r
  S"  " TYPE
  20 s>f fsqrt f>s s>d 0 d.r
  S"  " TYPE
  1000 s>f fsqrt f>s s>d 0 d.r
  S"  " TYPE
  500 s>f fsqrt f>s s>d 0 d.r
  S"  " TYPE
  10 s>f fsqrt f>s s>d 0 d.r
  S"  " TYPE
  ;
main
BYE



<|start_filename|>out/linkedList.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure linkedList is


type stringptr is access all char_array;
type intlist;
type intlist_PTR is access intlist;
type intlist is record
  head : Integer;
  tail : intlist_PTR;
end record;
function cons(list : in intlist_PTR; i : in Integer) return intlist_PTR is
  out0 : intlist_PTR;
begin
  out0 := new intlist;
  out0.head := i;
  out0.tail := list;
  return out0;
end;
function is_empty(foo : in intlist_PTR) return Boolean is
begin
  return TRUE;
end;
function rev2(acc : in intlist_PTR; torev : in intlist_PTR) return intlist_PTR is
  acc2 : intlist_PTR;
begin
  if is_empty(torev)
  then
    return acc;
  else
    acc2 := new intlist;
    acc2.head := torev.head;
    acc2.tail := acc;
    return rev2(acc, torev.tail);
  end if;
end;
function rev(empty : in intlist_PTR; torev : in intlist_PTR) return intlist_PTR is
begin
  return rev2(empty, torev);
end;
procedure test(empty : in intlist_PTR) is
  list : intlist_PTR;
  i : Integer;
begin
  list := empty;
  i := (-1);
  while i /= 0 loop
    Get(i);
    if i /= 0
    then
      list := cons(list, i);
    end if;
  end loop;
end;

begin
  NULL;
  
end;


<|start_filename|>out/dichoexp.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure dichoexp is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
function exp0(a : in Integer; b : in Integer) return Integer is
  o : Integer;
begin
  if b = 0
  then
    return 1;
  end if;
  if b rem 2 = 0
  then
    o := exp0(a, b / 2);
    return o * o;
  else
    return a * exp0(a, b - 1);
  end if;
end;

  b : Integer;
  a : Integer;
begin
  a := 0;
  b := 0;
  Get(a);
  SkipSpaces;
  Get(b);
  PInt(exp0(a, b));
end;


<|start_filename|>out/aaa_013option.cs<|end_filename|>
using System;

public class aaa_013option
{
  public class foo {
    public int a;
    public int? b;
    public int[] c;
    public int?[] d;
    public int[] e;
    public foo f;
    public foo[] g;
    public foo[] h;
  }
  static int default0(int? a, foo b, int?[] c, foo[] d, int[] e, foo[] f)
  {
    return 0;
  }
  
  static void aa(foo b)
  {
    
  }
  
  public static void Main(String[] args)
  {
    int? a = null;
    Console.Write("___\n");
  }
  
}



<|start_filename|>out/prologin_template_charline.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure prologin_template_charline is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PChar(c : in Character) is
begin
  Character'Write (Text_Streams.Stream (Current_Output), c);
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type b is Array (Integer range <>) of Character;
type b_PTR is access b;
function programme_candidat(tableau : in b_PTR; taille : in Integer) return Integer is
  out0 : Integer;
begin
  out0 := 0;
  for i in integer range 0..taille - 1 loop
    out0 := out0 + Character'Pos(tableau(i)) * i;
    PChar(tableau(i));
  end loop;
  PString(new char_array'( To_C("--" & Character'Val(10))));
  return out0;
end;

  taille : Integer;
  tableau : b_PTR;
begin
  Get(taille);
  SkipSpaces;
  tableau := new b (0..taille - 1);
  for a in integer range 0..taille - 1 loop
    Get(tableau(a));
  end loop;
  SkipSpaces;
  PInt(programme_candidat(tableau, taille));
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/min3.cs<|end_filename|>
using System;

public class min3
{
  
  public static void Main(String[] args)
  {
    Console.Write(Math.Min(Math.Min(2, 3), 4) + " " + Math.Min(Math.Min(2, 4), 3) + " " + Math.Min(Math.Min(3, 2), 4) + " " + Math.Min(Math.Min(3, 4), 2) + " " + Math.Min(Math.Min(4, 2), 3) + " " + Math.Min(Math.Min(4, 3), 2) + "\n");
  }
  
}



<|start_filename|>out/euler32.java<|end_filename|>
import java.util.*;

public class euler32
{
  
  /*
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once;
for example, the 5-digit number, 15234, is 1 through 5 pandigital.

The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier,
and product is 1 through 9 pandigital.

Find the sum of all products whose multiplicand/multiplier/product identity can be written as a
1 through 9 pandigital.

HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.


(a * 10 + b) ( c * 100 + d * 10 + e) =
  a * c * 1000 +
  a * d * 100 +
  a * e * 10 +
  b * c * 100 +
  b * d * 10 +
  b * e
  => b != e != b * e % 10 ET
  a != d != (b * e / 10 + b * d + a * e ) % 10
*/
  static boolean okdigits(boolean[] ok, int n)
  {
    if (n == 0)
        return true;
    else
    {
        int digit = n % 10;
        if (ok[digit])
        {
            ok[digit] = false;
            boolean o = okdigits(ok, n / 10);
            ok[digit] = true;
            return o;
        }
        else
            return false;
    }
  }
  public static void main(String args[])
  {
    int count = 0;
    boolean[] allowed = new boolean[10];
    for (int i = 0; i < 10; i++)
        allowed[i] = i != 0;
    boolean[] counted = new boolean[100000];
    for (int j = 0; j < 100000; j++)
        counted[j] = false;
    for (int e = 1; e < 10; e++)
    {
        allowed[e] = false;
        for (int b = 1; b < 10; b++)
            if (allowed[b])
            {
                allowed[b] = false;
                int be = b * e % 10;
                if (allowed[be])
                {
                    allowed[be] = false;
                    for (int a = 1; a < 10; a++)
                        if (allowed[a])
                        {
                            allowed[a] = false;
                            for (int c = 1; c < 10; c++)
                                if (allowed[c])
                                {
                                    allowed[c] = false;
                                    for (int d = 1; d < 10; d++)
                                        if (allowed[d])
                                        {
                                            allowed[d] = false;
                                            //  2 * 3 digits 
                                            int product = (a * 10 + b) * (c * 100 + d * 10 + e);
                                            if (!counted[product] && okdigits(allowed, product / 10))
                                            {
                                                counted[product] = true;
                                                count += product;
                                                System.out.printf("%d ", product);
                                            }
                                            //  1  * 4 digits 
                                            int product2 = b * (a * 1000 + c * 100 + d * 10 + e);
                                            if (!counted[product2] && okdigits(allowed, product2 / 10))
                                            {
                                                counted[product2] = true;
                                                count += product2;
                                                System.out.printf("%d ", product2);
                                            }
                                            allowed[d] = true;
                                        }
                                    allowed[c] = true;
                                }
                            allowed[a] = true;
                        }
                    allowed[be] = true;
                }
                allowed[b] = true;
            }
        allowed[e] = true;
    }
    System.out.printf("%d\n", count);
  }
  
}



<|start_filename|>out/euler22.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int score()
{
  scanner.findWithinHorizon("[\n\r ]*", 1)
  int len
  if (scanner.hasNext("^-")) {
    scanner.next("^-")
    len = scanner.nextInt()
  } else {
    len = scanner.nextInt()
  }
  scanner.findWithinHorizon("[\n\r ]*", 1)
  int sum = 0
  for (int i = 1; i <= len; i++)
  {
      char c = scanner.findWithinHorizon(".", 1).charAt(0)
      sum += (0+c) - (0+(char)'A') + 1
      // 		print c print " " print sum print " " 
  }
  return sum
}
@Field Scanner scanner = new Scanner(System.in)
int sum = 0
int n
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  n = scanner.nextInt()
} else {
  n = scanner.nextInt()
}
for (int i = 1; i <= n; i++)
    sum += i * score()
System.out.printf("%d\n", sum)



<|start_filename|>out/prologin_template_charmatrix.java<|end_filename|>
import java.util.*;

public class prologin_template_charmatrix
{
  static Scanner scanner = new Scanner(System.in);
  static int programme_candidat(char[][] tableau, int taille_x, int taille_y)
  {
    int out0 = 0;
    for (int i = 0; i < taille_y; i++)
    {
        for (int j = 0; j < taille_x; j++)
        {
            out0 += (int)(tableau[i][j]) * (i + j * 2);
            System.out.print(tableau[i][j]);
        }
        System.out.print("--\n");
    }
    return out0;
  }
  public static void main(String args[])
  {
    int taille_x = Integer.parseInt(scanner.nextLine());
    int taille_y = Integer.parseInt(scanner.nextLine());
    char[][] a = new char[taille_y][];
    for (int b = 0; b < taille_y; b++)
        a[b] = scanner.nextLine().toCharArray();
    char[][] tableau = a;
    System.out.printf("%d\n", programme_candidat(tableau, taille_x, taille_y));
  }
  
}



<|start_filename|>out/euler45.cpp<|end_filename|>
#include <iostream>
#include <vector>

int triangle(int n) {
    if (n % 2 == 0)
        return (n / 2) * (n + 1);
    else
        return n * ((n + 1) / 2);
}


int penta(int n) {
    if (n % 2 == 0)
        return (n / 2) * (3 * n - 1);
    else
        return ((3 * n - 1) / 2) * n;
}


int hexa(int n) {
    return n * (2 * n - 1);
}


bool findPenta2(int n, int a, int b) {
    if (b == a + 1)
        return penta(a) == n || penta(b) == n;
    int c = (a + b) / 2;
    int p = penta(c);
    if (p == n)
        return true;
    else if (p < n)
        return findPenta2(n, c, b);
    else
        return findPenta2(n, a, c);
}


bool findHexa2(int n, int a, int b) {
    if (b == a + 1)
        return hexa(a) == n || hexa(b) == n;
    int c = (a + b) / 2;
    int p = hexa(c);
    if (p == n)
        return true;
    else if (p < n)
        return findHexa2(n, c, b);
    else
        return findHexa2(n, a, c);
}

int main() {
    for (int n = 285; n < 55386; n++)
    {
        int t = triangle(n);
        if (findPenta2(t, n / 5, n) && findHexa2(t, n / 5, n / 2 + 10))
            std::cout << n << "\n" << t << "\n";
    }
}



<|start_filename|>out/ocaml01.lua<|end_filename|>
function foo ()
  for i = 0, 10 do
      
  end
  return 0
end

function bar ()
  for i = 0, 10 do
      local a = 0
  end
  return 0
end




<|start_filename|>out/euler11.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function find(n, m, x, y, dx, dy){
    if (x < 0 || x == 20 || y < 0 || y == 20)
        return -1;
    else if (n == 0)
        return 1;
    else
        return m[y][x] * find(n - 1, m, x + dx, y + dy, dx, dy);
}
var directions = new Array(8);
for (var i = 0; i < 8; i++)
    if (i == 0)
    {
        var c = {
            "tuple_int_int_field_0":0,
            "tuple_int_int_field_1":1};
        directions[i] = c;
    }
    else if (i == 1)
    {
        var d = {
            "tuple_int_int_field_0":1,
            "tuple_int_int_field_1":0};
        directions[i] = d;
    }
    else if (i == 2)
    {
        var e = {
            "tuple_int_int_field_0":0,
            "tuple_int_int_field_1":-1};
        directions[i] = e;
    }
    else if (i == 3)
    {
        var f = {
            "tuple_int_int_field_0":-1,
            "tuple_int_int_field_1":0};
        directions[i] = f;
    }
    else if (i == 4)
    {
        var g = {
            "tuple_int_int_field_0":1,
            "tuple_int_int_field_1":1};
        directions[i] = g;
    }
    else if (i == 5)
    {
        var h = {
            "tuple_int_int_field_0":1,
            "tuple_int_int_field_1":-1};
        directions[i] = h;
    }
    else if (i == 6)
    {
        var k = {
            "tuple_int_int_field_0":-1,
            "tuple_int_int_field_1":1};
        directions[i] = k;
    }
    else
    {
        var l = {
            "tuple_int_int_field_0":-1,
            "tuple_int_int_field_1":-1};
        directions[i] = l;
    }
var max0 = 0;
var m = new Array(20);
for (var o = 0; o < 20; o++)
{
    var p = new Array(20);
    for (var q = 0; q < 20; q++)
    {
        p[q] = read_int_();
        stdinsep();
    }
    m[o] = p;
}
for (var j = 0; j < 8; j++)
{
    var r = directions[j];
    var dx = r["tuple_int_int_field_0"];
    var dy = r["tuple_int_int_field_1"];
    for (var x = 0; x < 20; x++)
        for (var y = 0; y < 20; y++)
            max0 = Math.max(max0, find(4, m, x, y, dx, dy));
}
util.print(max0, "\n");



<|start_filename|>out/euler10.cs<|end_filename|>
using System;

public class euler10
{
  static int eratostene(int[] t, int max0)
  {
    int sum = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            sum += i;
            if (max0 / i > i)
            {
                int j = i * i;
                while (j < max0 && j > 0)
                {
                    t[j] = 0;
                    j += i;
                }
            }
        }
    return sum;
  }
  
  public static void Main(String[] args)
  {
    int n = 100000;
    //  normalement on met 2000 000 mais là on se tape des int overflow dans plein de langages 
    int[] t = new int[n];
    for (int i = 0; i < n; i++)
        t[i] = i;
    t[1] = 0;
    Console.Write(eratostene(t, n) + "\n");
  }
  
}



<|start_filename|>out/prologin_template_charline.cc<|end_filename|>
#include <iostream>
#include <vector>
std::vector<char> *getline() {
    if (std::cin.flags() & std::ios_base::skipws) {
        char c = std::cin.peek();
        if (c == '\n' || c == ' ') std::cin.ignore();
        std::cin.unsetf(std::ios::skipws);
    }
    std::string line;
    std::getline(std::cin, line);
    std::vector<char> *c = new std::vector<char>(line.begin(), line.end());
    std::cin >> std::skipws;
    return c;
}

int programme_candidat(std::vector<char> * tableau, int taille) {
    int out0 = 0;
    for (int i = 0; i < taille; i++)
    {
        out0 += (int)(tableau->at(i)) * i;
        std::cout << tableau->at(i);
    }
    std::cout << "--\n";
    return out0;
}

int main() {
    int taille;
    std::cin >> taille;
    std::vector<char> * tableau = getline();
    std::cout << programme_candidat(tableau, taille) << "\n";
}



<|start_filename|>out/euler28.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler28 is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
--
--
--43 44 45 46 47 48 49
--42 21 22 23 24 25 26
--41 20  7  8  9 10 27
--40 19  6  1  2 11 28
--39 18  5  4  3 12 29
--38 17 16 15 14 13 30
--37 36 35 34 33 32 31
--
--1 3 5 7 9 13 17 21 25 31 37 43 49
--  2 2 2 2 4  4  4  4  6   6  6  6
--
--
--

function sumdiag(n : in Integer) return Integer is
  un : Integer;
  sum : Integer;
  nterms : Integer;
  d : Integer;
begin
  nterms := n * 2 - 1;
  un := 1;
  sum := 1;
  for i in integer range 0..nterms - 2 loop
    d := 2 * (1 + i / 4);
    un := un + d;
    -- print int d print "=>" print un print " " 
    
    sum := sum + un;
  end loop;
  return sum;
end;

begin
  PInt(sumdiag(1001));
end;


<|start_filename|>out/euler42.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end
function readchar()
    if buffer == "" then buffer = io.read("*line") end
    local c = string.byte(buffer)
    buffer = string.sub(buffer, 2, -1)
    return c
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function is_triangular (n)
  --[[
   n = k * (k + 1) / 2
	  n * 2 = k * (k + 1)
   --]]
  local a = math.floor(math.sqrt(n * 2))
  return a * (a + 1) == n * 2
end

function score ()
  stdinsep()
  local len = readint()
  stdinsep()
  local sum = 0
  for i = 1, len do
      local c = readchar()
      sum = sum + c - 65 + 1
      --[[		print c print " " print sum print " " --]]
  end
  if is_triangular(sum) then
      return 1
  else 
      return 0
  end
end

for i = 1, 55 do
    if is_triangular(i) then
        io.write(string.format("%d ", i))
    end
end
io.write("\n")
local sum = 0
local n = readint()
for i = 1, n do
    sum = sum + score()
end
io.write(string.format("%d\n", sum))


<|start_filename|>out/bigints.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

class Bigint {
  boolean bigint_sign
  int bigint_len
  int[] bigint_chiffres
}
Bigint read_bigint(int len)
{
  int[] chiffres = new int[len]
  for (int j = 0; j < len; j++)
  {
      char c = scanner.findWithinHorizon(".", 1).charAt(0)
      chiffres[j] = (0+c)
  }
  for (int i = 0; i <= (len - 1).intdiv(2); i++)
  {
      int tmp = chiffres[i]
      chiffres[i] = chiffres[len - 1 - i]
      chiffres[len - 1 - i] = tmp
  }
  Bigint e = new Bigint()
  e.bigint_sign = true
  e.bigint_len = len
  e.bigint_chiffres = chiffres
  return e
}
void print_bigint(Bigint a)
{
  if (!a.bigint_sign)
      print((char)'-')
  for (int i = 0; i < a.bigint_len; i++)
      print(a.bigint_chiffres[a.bigint_len - 1 - i])
}
boolean bigint_eq(Bigint a, Bigint b)
{
  //  Renvoie vrai si a = b 
  if (a.bigint_sign != b.bigint_sign)
      return false
  else if (a.bigint_len != b.bigint_len)
      return false
  else
  {
      for (int i = 0; i < a.bigint_len; i++)
          if (a.bigint_chiffres[i] != b.bigint_chiffres[i])
              return false
      return true
  }
}
boolean bigint_gt(Bigint a, Bigint b)
{
  //  Renvoie vrai si a > b 
  if (a.bigint_sign && !b.bigint_sign)
      return true
  else if (!a.bigint_sign && b.bigint_sign)
      return false
  else
  {
      if (a.bigint_len > b.bigint_len)
          return a.bigint_sign
      else if (a.bigint_len < b.bigint_len)
          return !a.bigint_sign
      else
          for (int i = 0; i < a.bigint_len; i++)
          {
              int j = a.bigint_len - 1 - i
              if (a.bigint_chiffres[j] > b.bigint_chiffres[j])
                  return a.bigint_sign
              else if (a.bigint_chiffres[j] < b.bigint_chiffres[j])
                  return !a.bigint_sign
          }
      return true
  }
}
boolean bigint_lt(Bigint a, Bigint b)
{
  return !bigint_gt(a, b)
}
Bigint add_bigint_positif(Bigint a, Bigint b)
{
  //  Une addition ou on en a rien a faire des signes 
  int len = Math.max(a.bigint_len, b.bigint_len) + 1
  int retenue = 0
  int[] chiffres = new int[len]
  for (int i = 0; i < len; i++)
  {
      int tmp = retenue
      if (i < a.bigint_len)
          tmp += a.bigint_chiffres[i]
      if (i < b.bigint_len)
          tmp += b.bigint_chiffres[i]
      retenue = tmp.intdiv(10)
      chiffres[i] = tmp % 10
  }
  while (len > 0 && chiffres[len - 1] == 0)
      len--
  Bigint f = new Bigint()
  f.bigint_sign = true
  f.bigint_len = len
  f.bigint_chiffres = chiffres
  return f
}
Bigint sub_bigint_positif(Bigint a, Bigint b)
{
  /* Une soustraction ou on en a rien a faire des signes
Pré-requis : a > b
*/
  int len = a.bigint_len
  int retenue = 0
  int[] chiffres = new int[len]
  for (int i = 0; i < len; i++)
  {
      int tmp = retenue + a.bigint_chiffres[i]
      if (i < b.bigint_len)
          tmp -= b.bigint_chiffres[i]
      if (tmp < 0)
      {
          tmp += 10
          retenue = -1
      }
      else
          retenue = 0
      chiffres[i] = tmp
  }
  while (len > 0 && chiffres[len - 1] == 0)
      len--
  Bigint g = new Bigint()
  g.bigint_sign = true
  g.bigint_len = len
  g.bigint_chiffres = chiffres
  return g
}
Bigint neg_bigint(Bigint a)
{
  Bigint h = new Bigint()
  h.bigint_sign = !a.bigint_sign
  h.bigint_len = a.bigint_len
  h.bigint_chiffres = a.bigint_chiffres
  return h
}
Bigint add_bigint(Bigint a, Bigint b)
{
  if (a.bigint_sign == b.bigint_sign)
      if (a.bigint_sign)
          return add_bigint_positif(a, b)
      else
          return neg_bigint(add_bigint_positif(a, b))
  else if (a.bigint_sign)
  {
      //  a positif, b negatif 
      if (bigint_gt(a, neg_bigint(b)))
          return sub_bigint_positif(a, b)
      else
          return neg_bigint(sub_bigint_positif(b, a))
  }
  else
      //  a negatif, b positif 
      if (bigint_gt(neg_bigint(a), b))
          return neg_bigint(sub_bigint_positif(a, b))
      else
          return sub_bigint_positif(b, a)
}
Bigint sub_bigint(Bigint a, Bigint b)
{
  return add_bigint(a, neg_bigint(b))
}
Bigint mul_bigint_cp(Bigint a, Bigint b)
{
  /* Cet algorithm est quadratique.
C'est le même que celui qu'on enseigne aux enfants en CP.
D'ou le nom de la fonction. */
  int len = a.bigint_len + b.bigint_len + 1
  int[] chiffres = new int[len]
  for (int k = 0; k < len; k++)
      chiffres[k] = 0
  for (int i = 0; i < a.bigint_len; i++)
  {
      int retenue = 0
      for (int j = 0; j < b.bigint_len; j++)
      {
          chiffres[i + j] += retenue + b.bigint_chiffres[j] * a.bigint_chiffres[i]
          retenue = chiffres[i + j].intdiv(10)
          chiffres[i + j] = chiffres[i + j] % 10
      }
      chiffres[i + b.bigint_len] += retenue
  }
  chiffres[a.bigint_len + b.bigint_len] = chiffres[a.bigint_len + b.bigint_len - 1].intdiv(10)
  chiffres[a.bigint_len + b.bigint_len - 1] = chiffres[a.bigint_len + b.bigint_len - 1] % 10
  for (int l = 0; l < 3; l++)
      if (len != 0 && chiffres[len - 1] == 0)
          len--
  Bigint m = new Bigint()
  m.bigint_sign = a.bigint_sign == b.bigint_sign
  m.bigint_len = len
  m.bigint_chiffres = chiffres
  return m
}
Bigint bigint_premiers_chiffres(Bigint a, int i)
{
  int len = Math.min(i, a.bigint_len)
  while (len != 0 && a.bigint_chiffres[len - 1] == 0)
      len--
  Bigint o = new Bigint()
  o.bigint_sign = a.bigint_sign
  o.bigint_len = len
  o.bigint_chiffres = a.bigint_chiffres
  return o
}
Bigint bigint_shift(Bigint a, int i)
{
  int[] chiffres = new int[a.bigint_len + i]
  for (int k = 0; k < a.bigint_len + i; k++)
      if (k >= i)
          chiffres[k] = a.bigint_chiffres[k - i]
      else
          chiffres[k] = 0
  Bigint p = new Bigint()
  p.bigint_sign = a.bigint_sign
  p.bigint_len = a.bigint_len + i
  p.bigint_chiffres = chiffres
  return p
}
Bigint mul_bigint(Bigint aa, Bigint bb)
{
  if (aa.bigint_len == 0)
      return aa
  else if (bb.bigint_len == 0)
      return bb
  else if (aa.bigint_len < 3 || bb.bigint_len < 3)
      return mul_bigint_cp(aa, bb)
  //  Algorithme de Karatsuba 
  int split = Math.min(aa.bigint_len, bb.bigint_len).intdiv(2)
  Bigint a = bigint_shift(aa, -split)
  Bigint b = bigint_premiers_chiffres(aa, split)
  Bigint c = bigint_shift(bb, -split)
  Bigint d = bigint_premiers_chiffres(bb, split)
  Bigint amoinsb = sub_bigint(a, b)
  Bigint cmoinsd = sub_bigint(c, d)
  Bigint ac = mul_bigint(a, c)
  Bigint bd = mul_bigint(b, d)
  Bigint amoinsbcmoinsd = mul_bigint(amoinsb, cmoinsd)
  Bigint acdec = bigint_shift(ac, 2 * split)
  return add_bigint(add_bigint(acdec, bd), bigint_shift(sub_bigint(add_bigint(ac, bd), amoinsbcmoinsd), split))
  //  ac × 102k + (ac + bd – (a – b)(c – d)) × 10k + bd 
}
/*
Division,
Modulo
*/
int log10(int a)
{
  int out0 = 1
  while (a >= 10)
  {
      a /= 10
      out0++
  }
  return out0
}
Bigint bigint_of_int(int i)
{
  int size = log10(i)
  if (i == 0)
      size = 0
  int[] t = new int[size]
  for (int j = 0; j < size; j++)
      t[j] = 0
  for (int k = 0; k < size; k++)
  {
      t[k] = i % 10
      i /= 10
  }
  Bigint q = new Bigint()
  q.bigint_sign = true
  q.bigint_len = size
  q.bigint_chiffres = t
  return q
}
Bigint fact_bigint(Bigint a)
{
  Bigint one = bigint_of_int(1)
  Bigint out0 = one
  while (!bigint_eq(a, one))
  {
      out0 = mul_bigint(a, out0)
      a = sub_bigint(a, one)
  }
  return out0
}
int sum_chiffres_bigint(Bigint a)
{
  int out0 = 0
  for (int i = 0; i < a.bigint_len; i++)
      out0 += a.bigint_chiffres[i]
  return out0
}
//  http://projecteuler.net/problem=20 
int euler20()
{
  Bigint a = bigint_of_int(15)
  //  normalement c'est 100 
  a = fact_bigint(a)
  return sum_chiffres_bigint(a)
}
Bigint bigint_exp(Bigint a, int b)
{
  if (b == 1)
      return a
  else if (b % 2 == 0)
      return bigint_exp(mul_bigint(a, a), b.intdiv(2))
  else
      return mul_bigint(a, bigint_exp(a, b - 1))
}
Bigint bigint_exp_10chiffres(Bigint a, int b)
{
  a = bigint_premiers_chiffres(a, 10)
  if (b == 1)
      return a
  else if (b % 2 == 0)
      return bigint_exp_10chiffres(mul_bigint(a, a), b.intdiv(2))
  else
      return mul_bigint(a, bigint_exp_10chiffres(a, b - 1))
}
void euler48()
{
  Bigint sum = bigint_of_int(0)
  for (int i = 1; i < 101; i++)
  {
      //  1000 normalement 
      Bigint ib = bigint_of_int(i)
      Bigint ibeib = bigint_exp_10chiffres(ib, i)
      sum = add_bigint(sum, ibeib)
      sum = bigint_premiers_chiffres(sum, 10)
  }
  print("euler 48 = ")
  print_bigint(sum)
  print("\n")
}
int euler16()
{
  Bigint a = bigint_of_int(2)
  a = bigint_exp(a, 100)
  //  1000 normalement 
  return sum_chiffres_bigint(a)
}
int euler25()
{
  int i = 2
  Bigint a = bigint_of_int(1)
  Bigint b = bigint_of_int(1)
  while (b.bigint_len < 100)
  {
      //  1000 normalement 
      Bigint c = add_bigint(a, b)
      a = b
      b = c
      i++
  }
  return i
}
int euler29()
{
  int maxA = 5
  int maxB = 5
  Bigint[] a_bigint = new Bigint[maxA + 1]
  for (int j = 0; j <= maxA; j++)
      a_bigint[j] = bigint_of_int(j * j)
  Bigint[] a0_bigint = new Bigint[maxA + 1]
  for (int j2 = 0; j2 <= maxA; j2++)
      a0_bigint[j2] = bigint_of_int(j2)
  int[] b = new int[maxA + 1]
  for (int k = 0; k <= maxA; k++)
      b[k] = 2
  int n = 0
  boolean found = true
  while (found)
  {
      Bigint min0 = a0_bigint[0]
      found = false
      for (int i = 2; i <= maxA; i++)
          if (b[i] <= maxB)
              if (found)
              {
                  if (bigint_lt(a_bigint[i], min0))
                      min0 = a_bigint[i]
              }
              else
              {
                  min0 = a_bigint[i]
                  found = true
              }
      if (found)
      {
          n++
          for (int l = 2; l <= maxA; l++)
              if (bigint_eq(a_bigint[l], min0) && b[l] <= maxB)
              {
                  b[l]++
                  a_bigint[l] = mul_bigint(a_bigint[l], a0_bigint[l])
              }
      }
  }
  return n
}
@Field Scanner scanner = new Scanner(System.in)
System.out.printf("%d\n", euler29())
Bigint sum = read_bigint(50)
for (int i = 2; i < 101; i++)
{
    scanner.findWithinHorizon("[\n\r ]*", 1)
    Bigint tmp = read_bigint(50)
    sum = add_bigint(sum, tmp)
}
print("euler13 = ")
print_bigint(sum)
System.out.printf("\neuler25 = %d\neuler16 = %d\n", euler25(), euler16())
euler48()
System.out.printf("euler20 = %d\n", euler20())
Bigint a = bigint_of_int(999999)
Bigint b = bigint_of_int(9951263)
print_bigint(a)
print(">>1=")
print_bigint(bigint_shift(a, -1))
print("\n")
print_bigint(a)
print("*")
print_bigint(b)
print("=")
print_bigint(mul_bigint(a, b))
print("\n")
print_bigint(a)
print("*")
print_bigint(b)
print("=")
print_bigint(mul_bigint_cp(a, b))
print("\n")
print_bigint(a)
print("+")
print_bigint(b)
print("=")
print_bigint(add_bigint(a, b))
print("\n")
print_bigint(b)
print("-")
print_bigint(a)
print("=")
print_bigint(sub_bigint(b, a))
print("\n")
print_bigint(a)
print("-")
print_bigint(b)
print("=")
print_bigint(sub_bigint(a, b))
print("\n")
print_bigint(a)
print(">")
print_bigint(b)
print("=")
if (bigint_gt(a, b))
    print("True")
else
    print("False")
print("\n")



<|start_filename|>out/euler14.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler14 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

function next0(n : in Integer) return Integer is
begin
  if n rem 2 = 0
  then
    return n / 2;
  else
    return 3 * n + 1;
  end if;
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function find(n : in Integer; m : in a_PTR) return Integer is
begin
  if n = 1
  then
    return 1;
  else
    if n >= 1000000
    then
      return 1 + find(next0(n), m);
    else
      if m(n) /= 0
      then
        return m(n);
      else
        m(n) := 1 + find(next0(n), m);
        return m(n);
      end if;
    end if;
  end if;
end;

  n2 : Integer;
  maxi : Integer;
  max0 : Integer;
  m : a_PTR;
begin
  m := new a (0..999999);
  for j in integer range 0..999999 loop
    m(j) := 0;
  end loop;
  max0 := 0;
  maxi := 0;
  for i in integer range 1..999 loop
    -- normalement on met 999999 mais ça dépasse les int32... 
    
    n2 := find(i, m);
    if n2 > max0
    then
      max0 := n2;
      maxi := i;
    end if;
  end loop;
  PInt(max0);
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(maxi);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/aaa_readints.cpp<|end_filename|>
#include <iostream>
#include <vector>

template <typename T> std::vector<std::vector<T>> read_matrix(int l, int c) {
    std::vector<std::vector<T>> matrix(l, std::vector<T>(c));
    for (std::vector<T>& line : matrix)
        for (T& elem : line)
            std::cin >> elem;
    return matrix;
}

int main() {
    int len;
    std::cin >> len;
    std::cout << len << "=len\n";
    std::vector<int> tab1( len );
    for (int a = 0; a < len; a++)
    {
        std::cin >> tab1[a];
    }
    for (int i = 0; i < len; i++)
        std::cout << i << "=>" << tab1[i] << "\n";
    std::cin >> len;
    std::vector<std::vector<int>> tab2 = read_matrix<int>(len - 1, len);
    for (int i = 0; i < len - 1; i++)
    {
        for (int j = 0; j < len; j++)
            std::cout << tab2[i][j] << " ";
        std::cout << "\n";
    }
}



<|start_filename|>out/aaa_03binding.cpp<|end_filename|>
#include <iostream>
#include <vector>

int g(int i) {
    int j = i * 4;
    if (j % 2 == 1)
        return 0;
    return j;
}


void h(int i) {
    std::cout << i << "\n";
}

int main() {
    h(14);
    int a = 4;
    int b = 5;
    std::cout << a + b;
    //  main 
    h(15);
    a = 2;
    b = 1;
    std::cout << a + b;
}



<|start_filename|>out/triangles.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
\  Ce code a été généré par metalang
\    Il gère les entrées sorties pour un programme dynamique classique
\    dans les épreuves de prologin
\ on le retrouve ici : http://projecteuler.net/problem=18
\ 

: find0 recursive { len tab cache x y }
  \ 
  \ 	Cette fonction est récursive
  \ 	
  
  y len 1 - =
  IF
    tab  y cells +  @  x cells +  @ exit
  ELSE
    x y >
    IF
      10000 NEGATE exit
    ELSE
      cache  y cells +  @  x cells +  @ 0 <>
      IF
        cache  y cells +  @  x cells +  @ exit
      THEN
    THEN
  THEN
  0 { result }
  len tab cache x y 1 + find0 { out0 }
  len tab cache x 1 + y 1 + find0 { out1 }
  out0 out1 >
  IF
    out0 tab  y cells +  @  x cells +  @ + TO result
  ELSE
    out1 tab  y cells +  @  x cells +  @ + TO result
  THEN
  result cache  y cells +  @  x cells +  !
  result exit
;


: find01 { len tab }
  HERE len cells allot { tab2 }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    HERE i 1 + cells allot { tab3 }
    i 0 BEGIN 2dup >= WHILE DUP { j }
      0 tab3  j cells +  !
     1 + REPEAT 2DROP
    tab3 tab2  i cells +  !
   1 + REPEAT 2DROP
  len tab tab2 0 0 find0 exit
;

: main
  read-int { len }
  skipspaces
  HERE len cells allot { tab }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    HERE i 1 + cells allot { tab2 }
    i 0 BEGIN 2dup >= WHILE DUP { j }
      read-int { tmp }
      skipspaces
      tmp tab2  j cells +  !
     1 + REPEAT 2DROP
    tab2 tab  i cells +  !
   1 + REPEAT 2DROP
  len tab find01 s>d 0 d.r
  S\" \n" TYPE
  len 1 - 0 BEGIN 2dup >= WHILE DUP { k }
    k 0 BEGIN 2dup >= WHILE DUP { l }
      tab  k cells +  @  l cells +  @ s>d 0 d.r
      S"  " TYPE
     1 + REPEAT 2DROP
    S\" \n" TYPE
   1 + REPEAT 2DROP
  ;
main
BYE



<|start_filename|>out/euler31.js<|end_filename|>
var util = require("util");
function result(sum, t, maxIndex, cache){
    if (cache[sum][maxIndex] != 0)
        return cache[sum][maxIndex];
    else if (sum == 0 || maxIndex == 0)
        return 1;
    else
    {
        var out0 = 0;
        var div = ~~(sum / t[maxIndex]);
        for (var i = 0; i <= div; i++)
            out0 += result(sum - i * t[maxIndex], t, maxIndex - 1, cache);
        cache[sum][maxIndex] = out0;
        return out0;
    }
}
var t = new Array(8);
for (var i = 0; i < 8; i++)
    t[i] = 0;
t[0] = 1;
t[1] = 2;
t[2] = 5;
t[3] = 10;
t[4] = 20;
t[5] = 50;
t[6] = 100;
t[7] = 200;
var cache = new Array(201);
for (var j = 0; j < 201; j++)
{
    var o = new Array(8);
    for (var k = 0; k < 8; k++)
        o[k] = 0;
    cache[j] = o;
}
util.print(result(200, t, 7, cache));



<|start_filename|>out/aaa_12strings.go<|end_filename|>
package main
import "fmt"

func main() {
  fmt.Printf("tada ' \" \n\r\t $ & todo\n\n{foo} \\${blah}\nblah\n")
}



<|start_filename|>out/euler14.cs<|end_filename|>
using System;

public class euler14
{
  static int next0(int n)
  {
    if (n % 2 == 0)
        return n / 2;
    else
        return 3 * n + 1;
  }
  
  static int find(int n, int[] m)
  {
    if (n == 1)
        return 1;
    else if (n >= 1000000)
        return 1 + find(next0(n), m);
    else if (m[n] != 0)
        return m[n];
    else
    {
        m[n] = 1 + find(next0(n), m);
        return m[n];
    }
  }
  
  public static void Main(String[] args)
  {
    int[] m = new int[1000000];
    for (int j = 0; j < 1000000; j++)
        m[j] = 0;
    int max0 = 0;
    int maxi = 0;
    for (int i = 1; i < 1000; i++)
    {
        //  normalement on met 999999 mais ça dépasse les int32... 
        int n2 = find(i, m);
        if (n2 > max0)
        {
            max0 = n2;
            maxi = i;
        }
    }
    Console.Write(max0 + "\n" + maxi + "\n");
  }
  
}



<|start_filename|>out/pathfinding.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_char_(){
    if (current_char == null) current_char = read_char0();
    var out = current_char;
    current_char = read_char0();
    return out;
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function pathfind_aux(cache, tab, x, y, posX, posY){
    if (posX == x - 1 && posY == y - 1)
        return 0;
    else if (posX < 0 || posY < 0 || posX >= x || posY >= y)
        return x * y * 10;
    else if (tab[posY][posX] == '#')
        return x * y * 10;
    else if (cache[posY][posX] != -1)
        return cache[posY][posX];
    else
    {
        cache[posY][posX] = x * y * 10;
        var val1 = pathfind_aux(cache, tab, x, y, posX + 1, posY);
        var val2 = pathfind_aux(cache, tab, x, y, posX - 1, posY);
        var val3 = pathfind_aux(cache, tab, x, y, posX, posY - 1);
        var val4 = pathfind_aux(cache, tab, x, y, posX, posY + 1);
        var out0 = 1 + Math.min(val1, val2, val3, val4);
        cache[posY][posX] = out0;
        return out0;
    }
}
function pathfind(tab, x, y){
    var cache = new Array(y);
    for (var i = 0; i < y; i++)
    {
        var tmp = new Array(x);
        for (var j = 0; j < x; j++)
            tmp[j] = -1;
        cache[i] = tmp;
    }
    return pathfind_aux(cache, tab, x, y, 0, 0);
}
var x = read_int_();
stdinsep();
var y = read_int_();
stdinsep();
var tab = new Array(y);
for (var i = 0; i < y; i++)
{
    var tab2 = new Array(x);
    for (var j = 0; j < x; j++)
    {
        var tmp = '\x00';
        tmp = read_char_();
        tab2[j] = tmp;
    }
    stdinsep();
    tab[i] = tab2;
}
var result = pathfind(tab, x, y);
util.print(result);



<|start_filename|>out/aaa_08tuple.java<|end_filename|>
import java.util.*;

public class aaa_08tuple
{
  static Scanner scanner = new Scanner(System.in);
  static int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

  static class tuple_int_int {
    public int tuple_int_int_field_0;
    public int tuple_int_int_field_1;
  }
  static class toto {
    public tuple_int_int foo;
    public int bar;
  }
  public static void main(String args[])
  {
    int bar_ = Integer.parseInt(scanner.nextLine());
    int[] c = read_int_line();
    tuple_int_int d = new tuple_int_int();
    d.tuple_int_int_field_0 = c[0];
    d.tuple_int_int_field_1 = c[1];
    toto t = new toto();
    t.foo = d;
    t.bar = bar_;
    tuple_int_int e = t.foo;
    int a = e.tuple_int_int_field_0;
    int b = e.tuple_int_int_field_1;
    System.out.printf("%d %d %d\n", a, b, t.bar);
  }
  
}



<|start_filename|>out/aaa_04loop.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_04loop is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

function h(i : in Integer) return Boolean is
  j : Integer;
begin
  --  for j = i - 2 to i + 2 do
  --    if i % j == 5 then return true end
  --  end 
  
  j := i - 2;
  while j <= i + 2 loop
    if i rem j = 5
    then
      return TRUE;
    end if;
    j := j + 1;
  end loop;
  return FALSE;
end;

  j : Integer;
  i : Integer;
begin
  j := 0;
  for k in integer range 0..10 loop
    j := j + k;
    PInt(j);
    PString(new char_array'( To_C("" & Character'Val(10))));
  end loop;
  i := 4;
  while i < 10 loop
    PInt(i);
    i := i + 1;
    j := j + i;
  end loop;
  PInt(j);
  PInt(i);
  PString(new char_array'( To_C("FIN TEST" & Character'Val(10))));
end;


<|start_filename|>out/recordtest.java<|end_filename|>
import java.util.*;

public class recordtest
{
  static Scanner scanner = new Scanner(System.in);
  static class toto {
    public int foo;
    public int bar;
  }
  public static void main(String args[])
  {
    toto param = new toto();
    param.foo = 0;
    param.bar = 0;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      param.bar = -scanner.nextInt();
    }else{
      param.bar = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      param.foo = -scanner.nextInt();
    }else{
      param.foo = scanner.nextInt();
    }
    System.out.print(param.bar + param.foo * param.bar);
  }
  
}



<|start_filename|>out/euler05.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function primesfactors (n)
  local tab = {}
  for i = 0, n do
      tab[i + 1] = 0
  end
  local d = 2
  while n ~= 1 and d * d <= n do
      if math.fmod(n, d) == 0 then
          tab[d + 1] = tab[d + 1] + 1
          n = trunc(n / d)
      else 
          d = d + 1
      end
  end
  tab[n + 1] = tab[n + 1] + 1
  return tab
end

local lim = 20
local o = {}
for m = 0, lim do
    o[m + 1] = 0
end
for i = 1, lim do
    local t = primesfactors(i)
    for j = 1, i do
        o[j + 1] = math.max(o[j + 1], t[j + 1])
    end
end
local product = 1
for k = 1, lim do
    for l = 1, o[k + 1] do
        product = product * k
    end
end
io.write(string.format("%d\n", product))


<|start_filename|>out/aaa_read2.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

/* 
Ce test permet de vérifier si les différents backends pour les langages implémentent bien
read int, read char et skip
 */

int main(void) {
    int j, i3, d, strlen, i_, b, i, a, len;
    scanf("%d ", &len);
    printf("%d=len\n", len);
    int *tab = calloc(len, sizeof(int));
    for (a = 0; a < len; a++)
        scanf("%d ", &tab[a]);
    for (i = 0; i < len; i++)
        printf("%d=>%d ", i, tab[i]);
    printf("\n");
    int *tab2 = calloc(len, sizeof(int));
    for (b = 0; b < len; b++)
        scanf("%d ", &tab2[b]);
    for (i_ = 0; i_ < len; i_++)
        printf("%d==>%d ", i_, tab2[i_]);
    scanf("%d ", &strlen);
    printf("%d=strlen\n", strlen);
    char *tab4 = calloc(strlen, sizeof(char));
    for (d = 0; d < strlen; d++)
        scanf("%c", &tab4[d]);
    scanf(" ");
    for (i3 = 0; i3 < strlen; i3++)
    {
        char tmpc = tab4[i3];
        int c = (int)(tmpc);
        printf("%c:%d ", tmpc, c);
        if (tmpc != ' ')
            c = (c - (int)('a') + 13) % 26 + (int)('a');
        tab4[i3] = (char)(c);
    }
    for (j = 0; j < strlen; j++)
        printf("%c", tab4[j]);
    return 0;
}




<|start_filename|>out/prologin_template_2charline.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class prologin_template_2charline
{
  static int programme_candidat(char[] tableau1, int taille1, char[] tableau2, int taille2)
  {
    int out0 = 0;
    for (int i = 0; i < taille1; i++)
    {
        out0 += (int)(tableau1[i]) * i;
        Console.Write(tableau1[i]);
    }
    Console.Write("--\n");
    for (int j = 0; j < taille2; j++)
    {
        out0 += (int)(tableau2[j]) * j * 100;
        Console.Write(tableau2[j]);
    }
    Console.Write("--\n");
    return out0;
  }
  
  public static void Main(String[] args)
  {
    int taille1 = int.Parse(Console.ReadLine());
    char[] tableau1 = Console.ReadLine().ToCharArray();
    int taille2 = int.Parse(Console.ReadLine());
    char[] tableau2 = Console.ReadLine().ToCharArray();
    Console.Write(programme_candidat(tableau1, taille1, tableau2, taille2) + "\n");
  }
  
}



<|start_filename|>out/euler19.js<|end_filename|>
var util = require("util");
function is_leap(year){
    return ~~(year % 400) == 0 || ~~(year % 100) != 0 && ~~(year % 4) == 0;
}
function ndayinmonth(month, year){
    if (month == 0)
        return 31;
    else if (month == 1)
        if (is_leap(year))
            return 29;
        else
            return 28;
    else if (month == 2)
        return 31;
    else if (month == 3)
        return 30;
    else if (month == 4)
        return 31;
    else if (month == 5)
        return 30;
    else if (month == 6)
        return 31;
    else if (month == 7)
        return 31;
    else if (month == 8)
        return 30;
    else if (month == 9)
        return 31;
    else if (month == 10)
        return 30;
    else if (month == 11)
        return 31;
    return 0;
}
var month = 0;
var year = 1901;
var dayofweek = 1;
//  01-01-1901 : mardi 
var count = 0;
while (year != 2001)
{
    var ndays = ndayinmonth(month, year);
    dayofweek = ~~((dayofweek + ndays) % 7);
    month++;
    if (month == 12)
    {
        month = 0;
        year++;
    }
    if (~~(dayofweek % 7) == 6)
        count++;
}
util.print(count, "\n");



<|start_filename|>out/linkedList.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function cons(list, i){
    var out0 = {
        "head":i,
        "tail":list};
    return out0;
}
function is_empty(foo){
    return true;
}
function rev2(acc, torev){
    if (is_empty(torev))
        return acc;
    else
    {
        var acc2 = {
            "head":torev["head"],
            "tail":acc};
        return rev2(acc, torev["tail"]);
    }
}
function rev(empty, torev){
    return rev2(empty, torev);
}
function test(empty){
    var list = empty;
    var i = -1;
    while (i != 0)
    {
        i = read_int_();
        if (i != 0)
            list = cons(list, i);
    }
}




<|start_filename|>out/euler31.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
result sum t maxIndex cache =
  ifM (((/=) 0) <$> (join $ readIOA <$> (readIOA cache sum) <*> return maxIndex))
      (join $ readIOA <$> (readIOA cache sum) <*> return maxIndex)
      (if sum == 0 || maxIndex == 0
       then return 1
       else do div <- ((quot sum) <$> (readIOA t maxIndex))
               let a i b =
                     if i <= div
                     then do c <- (((+) b) <$> (join $ result <$> (((-) sum) <$> (((*) i) <$> (readIOA t maxIndex))) <*> return t <*> return (maxIndex - 1) <*> return cache))
                             a (i + 1) c
                     else do join $ writeIOA <$> (readIOA cache sum) <*> return maxIndex <*> return b
                             return b in
                     a 0 0)

main =
  do t <- array_init 8 (\ i ->
                          return 0)
     writeIOA t 0 1
     writeIOA t 1 2
     writeIOA t 2 5
     writeIOA t 3 10
     writeIOA t 4 20
     writeIOA t 5 50
     writeIOA t 6 100
     writeIOA t 7 200
     cache <- array_init 201 (\ j ->
                                array_init 8 (\ k ->
                                                return 0))
     printf "%d" =<< (result 200 t 7 cache :: IO Int)




<|start_filename|>out/vigenere.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
position_alphabet c =
  let i = (ord c)
          in return (if i <= (ord 'Z') && i >= (ord 'A')
                     then i - (ord 'A')
                     else if i <= (ord 'z') && i >= (ord 'a')
                          then i - (ord 'a')
                          else - 1)

of_position_alphabet c =
  return (chr (c + (ord 'a')))

crypte taille_cle cle taille message =
  let a i =
        if i <= taille - 1
        then do lettre <- (readIOA message i) >>= position_alphabet
                if lettre /= - 1
                then do addon <- (readIOA cle (i `rem` taille_cle)) >>= position_alphabet
                        let new0 = (addon + lettre) `rem` 26
                        writeIOA message i =<< (of_position_alphabet new0)
                        a (i + 1)
                else a (i + 1)
        else return () in
        a 0

main =
  do taille_cle <- read_int
     skip_whitespaces
     cle <- array_init taille_cle (\ index ->
                                     getChar)
     skip_whitespaces
     taille <- read_int
     skip_whitespaces
     message <- array_init taille (\ index2 ->
                                     getChar)
     crypte taille_cle cle taille message
     let b i =
           if i <= taille - 1
           then do printf "%c" =<< (readIOA message i :: IO Char)
                   b (i + 1)
           else printf "\n" :: IO () in
           b 0




<|start_filename|>out/euler12.cs<|end_filename|>
using System;

public class euler12
{
  static int eratostene(int[] t, int max0)
  {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            int j = i * i;
            n++;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
  }
  
  static int fillPrimesFactors(int[] t, int n, int[] primes, int nprimes)
  {
    for (int i = 0; i < nprimes; i++)
    {
        int d = primes[i];
        while (n % d == 0)
        {
            t[d]++;
            n /= d;
        }
        if (n == 1)
            return primes[i];
    }
    return n;
  }
  
  static int find(int ndiv2)
  {
    int maximumprimes = 110;
    int[] era = new int[maximumprimes];
    for (int j = 0; j < maximumprimes; j++)
        era[j] = j;
    int nprimes = eratostene(era, maximumprimes);
    int[] primes = new int[nprimes];
    for (int o = 0; o < nprimes; o++)
        primes[o] = 0;
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    for (int n = 1; n < 10001; n++)
    {
        int[] primesFactors = new int[n + 2];
        for (int m = 0; m <= n + 1; m++)
            primesFactors[m] = 0;
        int max0 = Math.Max(fillPrimesFactors(primesFactors, n, primes, nprimes), fillPrimesFactors(primesFactors, n + 1, primes, nprimes));
        primesFactors[2]--;
        int ndivs = 1;
        for (int i = 0; i <= max0; i++)
            if (primesFactors[i] != 0)
                ndivs *= 1 + primesFactors[i];
        if (ndivs > ndiv2)
            return n * (n + 1) / 2;
        //  print "n=" print n print "\t" print (n * (n + 1) / 2 ) print " " print ndivs print "\n" 
    }
    return 0;
  }
  
  public static void Main(String[] args)
  {
    Console.Write(find(500) + "\n");
  }
  
}



<|start_filename|>out/aaa_read.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

/*
Ce test permet de vérifier si les différents backends pour les langages implémentent bien
read int, read char et skip
*/
@Field Scanner scanner = new Scanner(System.in)
int len
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  len = scanner.nextInt()
} else {
  len = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
System.out.printf("%d=len\n", len)
len *= 2
System.out.printf("len*2=%d\n", len)
len /= 2
int[] tab = new int[len]
for (int i = 0; i < len; i++)
{
    int tmpi1
    if (scanner.hasNext("^-")) {
      scanner.next("^-")
      tmpi1 = scanner.nextInt()
    } else {
      tmpi1 = scanner.nextInt()
    }
    scanner.findWithinHorizon("[\n\r ]*", 1)
    System.out.printf("%d=>%d ", i, tmpi1)
    tab[i] = tmpi1
}
print("\n")
int[] tab2 = new int[len]
for (int i_ = 0; i_ < len; i_++)
{
    int tmpi2
    if (scanner.hasNext("^-")) {
      scanner.next("^-")
      tmpi2 = scanner.nextInt()
    } else {
      tmpi2 = scanner.nextInt()
    }
    scanner.findWithinHorizon("[\n\r ]*", 1)
    System.out.printf("%d==>%d ", i_, tmpi2)
    tab2[i_] = tmpi2
}
int strlen
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  strlen = scanner.nextInt()
} else {
  strlen = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
System.out.printf("%d=strlen\n", strlen)
char[] tab4 = new char[strlen]
for (int toto = 0; toto < strlen; toto++)
{
    char tmpc = scanner.findWithinHorizon(".", 1).charAt(0)
    int c = (0+tmpc)
    System.out.printf("%c:%d ", tmpc, c)
    if (tmpc != (char)' ')
        c = (c - (0+(char)'a') + 13) % 26 + (0+(char)'a')
    tab4[toto] = (char)(c)
}
for (int j = 0; j < strlen; j++)
    print(tab4[j])



<|start_filename|>out/affect.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

/* 
Ce test permet de vérifier que l'implémentation de l'affectation fonctionne correctement
 */

typedef struct toto {
  int foo;
    int bar;
    int blah;
} toto;

struct toto * mktoto(int v1) {
    struct toto * t = malloc(sizeof(toto));
    t->foo = v1;
    t->bar = v1;
    t->blah = v1;
    return t;
}

struct toto * mktoto2(int v1) {
    struct toto * t = malloc(sizeof(toto));
    t->foo = v1 + 3;
    t->bar = v1 + 2;
    t->blah = v1 + 1;
    return t;
}

int result(struct toto * t_, struct toto * t2_) {
    int j, i;
    struct toto * t = t_;
    struct toto * t2 = t2_;
    struct toto * t3 = malloc(sizeof(toto));
    t3->foo = 0;
    t3->bar = 0;
    t3->blah = 0;
    t3 = t2;
    t = t2;
    t2 = t3;
    t->blah++;
    int len = 1;
    int *cache0 = calloc(len, sizeof(int));
    for (i = 0; i < len; i++)
        cache0[i] = -i;
    int *cache1 = calloc(len, sizeof(int));
    for (j = 0; j < len; j++)
        cache1[j] = j;
    int* cache2 = cache0;
    cache0 = cache1;
    cache2 = cache0;
    return t->foo + t->blah * t->bar + t->bar * t->foo;
}
int main(void) {
    struct toto * t = mktoto(4);
    struct toto * t2 = mktoto(5);
    scanf("%d %d %d %d", &t->bar, &t->blah, &t2->bar, &t2->blah);
    printf("%d%d", result(t, t2), t->blah);
    return 0;
}




<|start_filename|>out/npi.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end
function readchar()
    if buffer == "" then buffer = io.read("*line") end
    local c = string.byte(buffer)
    buffer = string.sub(buffer, 2, -1)
    return c
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function is_number (c)
  return c <= 57 and c >= 48
end

--[[
Notation polonaise inversée, ce test permet d'évaluer une expression écrite en NPI
--]]

function npi0 (str, len)
  local stack = {}
  for i = 0, len - 1 do
      stack[i + 1] = 0
  end
  local ptrStack = 0
  local ptrStr = 0
  while ptrStr < len do
      if str[ptrStr + 1] == 32 then
          ptrStr = ptrStr + 1
      elseif is_number(str[ptrStr + 1]) then
          local num = 0
          while str[ptrStr + 1] ~= 32 do
              num = num * 10 + str[ptrStr + 1] - 48
              ptrStr = ptrStr + 1
          end
          stack[ptrStack + 1] = num
          ptrStack = ptrStack + 1
      elseif str[ptrStr + 1] == 43 then
          stack[ptrStack - 1] = stack[ptrStack - 1] + stack[ptrStack]
          ptrStack = ptrStack - 1
          ptrStr = ptrStr + 1
      end
  end
  return stack[1]
end

local len = 0
len = readint()
stdinsep()
local tab = {}
for i = 0, len - 1 do
    local tmp = 0
    tmp = readchar()
    tab[i + 1] = tmp
end
local result = npi0(tab, len)
io.write(result)


<|start_filename|>out/euler36.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler36 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
type e is Array (Integer range <>) of Boolean;
type e_PTR is access e;
type f is Array (Integer range <>) of Integer;
type f_PTR is access f;
function palindrome2(pow2 : in f_PTR; n : in Integer) return Boolean is
  t : e_PTR;
  nnum : Integer;
begin
  t := new e (0..19);
  for i in integer range 0..19 loop
    t(i) := n / pow2(i) rem 2 = 1;
  end loop;
  nnum := 0;
  for j in integer range 1..19 loop
    if t(j)
    then
      nnum := j;
    end if;
  end loop;
  for k in integer range 0..nnum / 2 loop
    if t(k) /= t(nnum - k)
    then
      return FALSE;
    end if;
  end loop;
  return TRUE;
end;

  sum : Integer;
  pow2 : f_PTR;
  p : Integer;
  num3 : Integer;
  num2 : Integer;
  num1 : Integer;
  num0 : Integer;
  a : Integer;
begin
  p := 1;
  pow2 := new f (0..19);
  for i in integer range 0..19 loop
    p := p * 2;
    pow2(i) := p / 2;
  end loop;
  sum := 0;
  for d in integer range 1..9 loop
    if palindrome2(pow2, d)
    then
      PInt(d);
      PString(new char_array'( To_C("" & Character'Val(10))));
      sum := sum + d;
    end if;
    if palindrome2(pow2, d * 10 + d)
    then
      PInt(d * 10 + d);
      PString(new char_array'( To_C("" & Character'Val(10))));
      sum := sum + d * 10 + d;
    end if;
  end loop;
  for a0 in integer range 0..4 loop
    a := a0 * 2 + 1;
    for b in integer range 0..9 loop
      for c in integer range 0..9 loop
        num0 := a * 100000 + b * 10000 + c * 1000 + c * 100 + b * 10 + a;
        if palindrome2(pow2, num0)
        then
          PInt(num0);
          PString(new char_array'( To_C("" & Character'Val(10))));
          sum := sum + num0;
        end if;
        num1 := a * 10000 + b * 1000 + c * 100 + b * 10 + a;
        if palindrome2(pow2, num1)
        then
          PInt(num1);
          PString(new char_array'( To_C("" & Character'Val(10))));
          sum := sum + num1;
        end if;
      end loop;
      num2 := a * 100 + b * 10 + a;
      if palindrome2(pow2, num2)
      then
        PInt(num2);
        PString(new char_array'( To_C("" & Character'Val(10))));
        sum := sum + num2;
      end if;
      num3 := a * 1000 + b * 100 + b * 10 + a;
      if palindrome2(pow2, num3)
      then
        PInt(num3);
        PString(new char_array'( To_C("" & Character'Val(10))));
        sum := sum + num3;
      end if;
    end loop;
  end loop;
  PString(new char_array'( To_C("sum=")));
  PInt(sum);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/pathfinding.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end
function readchar()
    if buffer == "" then buffer = io.read("*line") end
    local c = string.byte(buffer)
    buffer = string.sub(buffer, 2, -1)
    return c
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function pathfind_aux (cache, tab, x, y, posX, posY)
  if posX == x - 1 and posY == y - 1 then
      return 0
  elseif posX < 0 or posY < 0 or posX >= x or posY >= y then
      return x * y * 10
  elseif tab[posY + 1][posX + 1] == 35 then
      return x * y * 10
  elseif cache[posY + 1][posX + 1] ~= -1 then
      return cache[posY + 1][posX + 1]
  else 
      cache[posY + 1][posX + 1] = x * y * 10
      local val1 = pathfind_aux(cache, tab, x, y, posX + 1, posY)
      local val2 = pathfind_aux(cache, tab, x, y, posX - 1, posY)
      local val3 = pathfind_aux(cache, tab, x, y, posX, posY - 1)
      local val4 = pathfind_aux(cache, tab, x, y, posX, posY + 1)
      local out0 = 1 + math.min(val1, val2, val3, val4)
      cache[posY + 1][posX + 1] = out0
      return out0
  end
end

function pathfind (tab, x, y)
  local cache = {}
  for i = 0, y - 1 do
      local tmp = {}
      for j = 0, x - 1 do
          tmp[j + 1] = -1
      end
      cache[i + 1] = tmp
  end
  return pathfind_aux(cache, tab, x, y, 0, 0)
end

local x = readint()
stdinsep()
local y = readint()
stdinsep()
local tab = {}
for i = 0, y - 1 do
    local tab2 = {}
    for j = 0, x - 1 do
        local tmp = 0
        tmp = readchar()
        tab2[j + 1] = tmp
    end
    stdinsep()
    tab[i + 1] = tab2
end
local result = pathfind(tab, x, y)
io.write(result)


<|start_filename|>out/calc.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure calc is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;
--
--La suite de fibonaci
--

function fibo(a : in Integer; b : in Integer; i : in Integer) return Integer is
  tmp : Integer;
  out_0 : Integer;
  b2 : Integer;
  a2 : Integer;
begin
  out_0 := 0;
  a2 := a;
  b2 := b;
  for j in integer range 0..i + 1 loop
    PInt(j);
    out_0 := out_0 + a2;
    tmp := b2;
    b2 := b2 + a2;
    a2 := tmp;
  end loop;
  return out_0;
end;

begin
  PInt(fibo(1, 2, 4));
end;


<|start_filename|>out/euler27.cs<|end_filename|>
using System;

public class euler27
{
  static int eratostene(int[] t, int max0)
  {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            int j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
  }
  
  static bool isPrime(int n, int[] primes, int len)
  {
    int i = 0;
    if (n < 0)
        n = -n;
    while (primes[i] * primes[i] < n)
    {
        if (n % primes[i] == 0)
            return false;
        i++;
    }
    return true;
  }
  
  static int test(int a, int b, int[] primes, int len)
  {
    for (int n = 0; n < 201; n++)
    {
        int j = n * n + a * n + b;
        if (!isPrime(j, primes, len))
            return n;
    }
    return 200;
  }
  
  public static void Main(String[] args)
  {
    int maximumprimes = 1000;
    int[] era = new int[maximumprimes];
    for (int j = 0; j < maximumprimes; j++)
        era[j] = j;
    int result = 0;
    int max0 = 0;
    int nprimes = eratostene(era, maximumprimes);
    int[] primes = new int[nprimes];
    for (int o = 0; o < nprimes; o++)
        primes[o] = 0;
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    Console.Write(l + " == " + nprimes + "\n");
    int ma = 0;
    int mb = 0;
    for (int b = 3; b < 1000; b++)
        if (era[b] == b)
            for (int a = -999; a < 1000; a++)
            {
                int n1 = test(a, b, primes, nprimes);
                int n2 = test(a, -b, primes, nprimes);
                if (n1 > max0)
                {
                    max0 = n1;
                    result = a * b;
                    ma = a;
                    mb = b;
                }
                if (n2 > max0)
                {
                    max0 = n2;
                    result = -a * b;
                    ma = a;
                    mb = -b;
                }
            }
    Console.Write(ma + " " + mb + "\n" + max0 + "\n" + result + "\n");
  }
  
}



<|start_filename|>out/rot13.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

/*
Ce test effectue un rot13 sur une chaine lue en entrée
*/
@Field Scanner scanner = new Scanner(System.in)
int strlen
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  strlen = scanner.nextInt()
} else {
  strlen = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
char[] tab4 = new char[strlen]
for (int toto = 0; toto < strlen; toto++)
{
    char tmpc = scanner.findWithinHorizon(".", 1).charAt(0)
    int c = (0+tmpc)
    if (tmpc != (char)' ')
        c = (c - (0+(char)'a') + 13) % 26 + (0+(char)'a')
    tab4[toto] = (char)(c)
}
for (int j = 0; j < strlen; j++)
    print(tab4[j])



<|start_filename|>out/aaa_readints.cc<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    int len;
    std::cin >> len;
    std::cout << len << "=len\n";
    std::vector<int> *tab1 = new std::vector<int>( len );
    for (int a = 0; a < len; a++)
    {
        std::cin >> tab1->at(a);
    }
    for (int i = 0; i < len; i++)
        std::cout << i << "=>" << tab1->at(i) << "\n";
    std::cin >> len;
    std::vector<std::vector<int> *> *tab2 = new std::vector<std::vector<int> *>( len - 1 );
    for (int b = 0; b < len - 1; b++)
    {
        std::vector<int> *c = new std::vector<int>( len );
        for (int d = 0; d < len; d++)
        {
            std::cin >> c->at(d);
        }
        tab2->at(b) = c;
    }
    for (int i = 0; i < len - 1; i++)
    {
        for (int j = 0; j < len; j++)
            std::cout << tab2->at(i)->at(j) << " ";
        std::cout << "\n";
    }
}



<|start_filename|>out/euler01.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler01 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;


  sum : Integer;
begin
  sum := 0;
  for i in integer range 0..999 loop
    if i rem 3 = 0 or else i rem 5 = 0
    then
      sum := sum + i;
    end if;
  end loop;
  PInt(sum);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/bigints.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-char current-char next-char ;
struct
  cell% field ->bigint_sign
  cell% field ->bigint_len
  cell% field ->bigint_chiffres
end-struct bigint%


: read_bigint { len }
  HERE len cells allot { chiffres }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { j }
    read-char { c }
    c chiffres  j cells +  !
   1 + REPEAT 2DROP
  len 1 - 2 // 0 BEGIN 2dup >= WHILE DUP { i }
    chiffres  i cells +  @ { tmp }
    chiffres  len 1 - i - cells +  @ chiffres  i cells +  !
    tmp chiffres  len 1 - i - cells +  !
   1 + REPEAT 2DROP
  bigint% %allot { e }
  true e ->bigint_sign !
  len e ->bigint_len !
  chiffres e ->bigint_chiffres !
  e exit
;


: print_bigint { a }
  a ->bigint_sign @ INVERT
  IF
    45 EMIT
  THEN
  a ->bigint_len @ 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    a ->bigint_chiffres @  a ->bigint_len @ 1 - i - cells +  @ s>d 0 d.r
   1 + REPEAT 2DROP
;


: bigint_eq { a b }
  \  Renvoie vrai si a = b 
  
  a ->bigint_sign @ b ->bigint_sign @ <>
  IF
    false exit
  ELSE
    a ->bigint_len @ b ->bigint_len @ <>
    IF
      false exit
    ELSE
      a ->bigint_len @ 1 - 0 BEGIN 2dup >= WHILE DUP { i }
        a ->bigint_chiffres @  i cells +  @ b ->bigint_chiffres @  i cells +  @ <>
        IF
          DROP DROP false exit
        THEN
       1 + REPEAT 2DROP
      true exit
    THEN
  THEN
;


: bigint_gt { a b }
  \  Renvoie vrai si a > b 
  
  a ->bigint_sign @ b ->bigint_sign @ INVERT AND
  IF
    true exit
  ELSE
    a ->bigint_sign @ INVERT b ->bigint_sign @ AND
    IF
      false exit
    ELSE
      a ->bigint_len @ b ->bigint_len @ >
      IF
        a ->bigint_sign @ exit
      ELSE
        a ->bigint_len @ b ->bigint_len @ <
        IF
          a ->bigint_sign @ INVERT exit
        ELSE
          a ->bigint_len @ 1 - 0 BEGIN 2dup >= WHILE DUP { i }
            a ->bigint_len @ 1 - i - { j }
            a ->bigint_chiffres @  j cells +  @ b ->bigint_chiffres @  j cells +  @ >
            IF
              DROP DROP a ->bigint_sign @ exit
            ELSE
              a ->bigint_chiffres @  j cells +  @ b ->bigint_chiffres @  j cells +  @ <
              IF
                DROP DROP a ->bigint_sign @ INVERT exit
              THEN
            THEN
           1 + REPEAT 2DROP
        THEN
      THEN
      true exit
    THEN
  THEN
;


: bigint_lt { a b }
  a b bigint_gt INVERT exit
;


: add_bigint_positif { a b }
  \  Une addition ou on en a rien a faire des signes 
  
  a ->bigint_len @ b ->bigint_len @ max 1 + { len }
  0 { retenue }
  HERE len cells allot { chiffres }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    retenue { tmp }
    i a ->bigint_len @ <
    IF
      tmp a ->bigint_chiffres @  i cells +  @ + TO tmp
    THEN
    i b ->bigint_len @ <
    IF
      tmp b ->bigint_chiffres @  i cells +  @ + TO tmp
    THEN
    tmp 10 // TO retenue
    tmp 10 % chiffres  i cells +  !
   1 + REPEAT 2DROP
  BEGIN
    len 0 > chiffres  len 1 - cells +  @ 0 = AND
  WHILE
    len 1 - TO len
  REPEAT
  bigint% %allot { f }
  true f ->bigint_sign !
  len f ->bigint_len !
  chiffres f ->bigint_chiffres !
  f exit
;


: sub_bigint_positif { a b }
  \  Une soustraction ou on en a rien a faire des signes
  \ Pré-requis : a > b
  \ 
  
  a ->bigint_len @ { len }
  0 { retenue }
  HERE len cells allot { chiffres }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    retenue a ->bigint_chiffres @  i cells +  @ + { tmp }
    i b ->bigint_len @ <
    IF
      tmp b ->bigint_chiffres @  i cells +  @ - TO tmp
    THEN
    tmp 0 <
    IF
      tmp 10 + TO tmp
      1 NEGATE TO retenue
    ELSE
      0 TO retenue
    THEN
    tmp chiffres  i cells +  !
   1 + REPEAT 2DROP
  BEGIN
    len 0 > chiffres  len 1 - cells +  @ 0 = AND
  WHILE
    len 1 - TO len
  REPEAT
  bigint% %allot { g }
  true g ->bigint_sign !
  len g ->bigint_len !
  chiffres g ->bigint_chiffres !
  g exit
;


: neg_bigint { a }
  bigint% %allot { h }
  a ->bigint_sign @ INVERT h ->bigint_sign !
  a ->bigint_len @ h ->bigint_len !
  a ->bigint_chiffres @ h ->bigint_chiffres !
  h exit
;


: add_bigint { a b }
  a ->bigint_sign @ b ->bigint_sign @ =
  IF
    a ->bigint_sign @
    IF
      a b add_bigint_positif exit
    ELSE
      a b add_bigint_positif neg_bigint exit
    THEN
  ELSE
    a ->bigint_sign @
    IF
      \  a positif, b negatif 
      
      a b neg_bigint bigint_gt
      IF
        a b sub_bigint_positif exit
      ELSE
        b a sub_bigint_positif neg_bigint exit
      THEN
    ELSE
      \  a negatif, b positif 
      
      a neg_bigint b bigint_gt
      IF
        a b sub_bigint_positif neg_bigint exit
      ELSE
        b a sub_bigint_positif exit
      THEN
    THEN
  THEN
;


: sub_bigint { a b }
  a b neg_bigint add_bigint exit
;


: mul_bigint_cp { a b }
  \  Cet algorithm est quadratique.
  \ C'est le même que celui qu'on enseigne aux enfants en CP.
  \ D'ou le nom de la fonction. 
  
  a ->bigint_len @ b ->bigint_len @ + 1 + { len }
  HERE len cells allot { chiffres }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { k }
    0 chiffres  k cells +  !
   1 + REPEAT 2DROP
  a ->bigint_len @ 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    0 { retenue }
    b ->bigint_len @ 1 - 0 BEGIN 2dup >= WHILE DUP { j }
      chiffres  i j + cells +  @ retenue b ->bigint_chiffres @  j cells +  @ a ->bigint_chiffres @  i cells +  @ * + + chiffres  i j + cells +  !
      chiffres  i j + cells +  @ 10 // TO retenue
      chiffres  i j + cells +  @ 10 % chiffres  i j + cells +  !
     1 + REPEAT 2DROP
    chiffres  i b ->bigint_len @ + cells +  @ retenue + chiffres  i b ->bigint_len @ + cells +  !
   1 + REPEAT 2DROP
  chiffres  a ->bigint_len @ b ->bigint_len @ + 1 - cells +  @ 10 // chiffres  a ->bigint_len @ b ->bigint_len @ + cells +  !
  chiffres  a ->bigint_len @ b ->bigint_len @ + 1 - cells +  @ 10 % chiffres  a ->bigint_len @ b ->bigint_len @ + 1 - cells +  !
  2 0 BEGIN 2dup >= WHILE DUP { l }
    len 0 <> chiffres  len 1 - cells +  @ 0 = AND
    IF
      len 1 - TO len
    THEN
   1 + REPEAT 2DROP
  bigint% %allot { m }
  a ->bigint_sign @ b ->bigint_sign @ = m ->bigint_sign !
  len m ->bigint_len !
  chiffres m ->bigint_chiffres !
  m exit
;


: bigint_premiers_chiffres { a i }
  i a ->bigint_len @ min { len }
  BEGIN
    len 0 <> a ->bigint_chiffres @  len 1 - cells +  @ 0 = AND
  WHILE
    len 1 - TO len
  REPEAT
  bigint% %allot { o }
  a ->bigint_sign @ o ->bigint_sign !
  len o ->bigint_len !
  a ->bigint_chiffres @ o ->bigint_chiffres !
  o exit
;


: bigint_shift { a i }
  HERE a ->bigint_len @ i + cells allot { chiffres }
  a ->bigint_len @ i + 1 - 0 BEGIN 2dup >= WHILE DUP { k }
    k i >=
    IF
      a ->bigint_chiffres @  k i - cells +  @ chiffres  k cells +  !
    ELSE
      0 chiffres  k cells +  !
    THEN
   1 + REPEAT 2DROP
  bigint% %allot { p }
  a ->bigint_sign @ p ->bigint_sign !
  a ->bigint_len @ i + p ->bigint_len !
  chiffres p ->bigint_chiffres !
  p exit
;


: mul_bigint recursive { aa bb }
  aa ->bigint_len @ 0 =
  IF
    aa exit
  ELSE
    bb ->bigint_len @ 0 =
    IF
      bb exit
    ELSE
      aa ->bigint_len @ 3 < bb ->bigint_len @ 3 < OR
      IF
        aa bb mul_bigint_cp exit
      THEN
    THEN
  THEN
  \  Algorithme de Karatsuba 
  
  aa ->bigint_len @ bb ->bigint_len @ min 2 // { split }
  aa split NEGATE bigint_shift { a }
  aa split bigint_premiers_chiffres { b }
  bb split NEGATE bigint_shift { c }
  bb split bigint_premiers_chiffres { d }
  a b sub_bigint { amoinsb }
  c d sub_bigint { cmoinsd }
  a c mul_bigint { ac }
  b d mul_bigint { bd }
  amoinsb cmoinsd mul_bigint { amoinsbcmoinsd }
  ac 2 split * bigint_shift { acdec }
  acdec bd add_bigint ac bd add_bigint amoinsbcmoinsd sub_bigint split bigint_shift add_bigint exit
  \  ac × 102k + (ac + bd – (a – b)(c – d)) × 10k + bd 
  
;


\ 
\ Division,
\ Modulo
\ 

: log10 { a }
  1 { out0 }
  BEGIN
    a 10 >=
  WHILE
    a 10 // TO a
    out0 1 + TO out0
  REPEAT
  out0 exit
;


: bigint_of_int { i }
  i log10 { size }
  i 0 =
  IF
    0 TO size
  THEN
  HERE size cells allot { t }
  size 1 - 0 BEGIN 2dup >= WHILE DUP { j }
    0 t  j cells +  !
   1 + REPEAT 2DROP
  size 1 - 0 BEGIN 2dup >= WHILE DUP { k }
    i 10 % t  k cells +  !
    i 10 // TO i
   1 + REPEAT 2DROP
  bigint% %allot { q }
  true q ->bigint_sign !
  size q ->bigint_len !
  t q ->bigint_chiffres !
  q exit
;


: fact_bigint { a }
  1 bigint_of_int { one }
  one { out0 }
  BEGIN
    a one bigint_eq INVERT
  WHILE
    a out0 mul_bigint TO out0
    a one sub_bigint TO a
  REPEAT
  out0 exit
;


: sum_chiffres_bigint { a }
  0 { out0 }
  a ->bigint_len @ 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    out0 a ->bigint_chiffres @  i cells +  @ + TO out0
   1 + REPEAT 2DROP
  out0 exit
;


\  http://projecteuler.net/problem=20 

: euler20 {  }
  15 bigint_of_int { a }
  \  normalement c'est 100 
  
  a fact_bigint TO a
  a sum_chiffres_bigint exit
;


: bigint_exp recursive { a b }
  b 1 =
  IF
    a exit
  ELSE
    b 2 % 0 =
    IF
      a a mul_bigint b 2 // bigint_exp exit
    ELSE
      a a b 1 - bigint_exp mul_bigint exit
    THEN
  THEN
;


: bigint_exp_10chiffres recursive { a b }
  a 10 bigint_premiers_chiffres TO a
  b 1 =
  IF
    a exit
  ELSE
    b 2 % 0 =
    IF
      a a mul_bigint b 2 // bigint_exp_10chiffres exit
    ELSE
      a a b 1 - bigint_exp_10chiffres mul_bigint exit
    THEN
  THEN
;


: euler48 {  }
  0 bigint_of_int { sum }
  100 1 BEGIN 2dup >= WHILE DUP { i }
    \  1000 normalement 
    
    i bigint_of_int { ib }
    ib i bigint_exp_10chiffres { ibeib }
    sum ibeib add_bigint TO sum
    sum 10 bigint_premiers_chiffres TO sum
   1 + REPEAT 2DROP
  S" euler 48 = " TYPE
  sum print_bigint
  S\" \n" TYPE
;


: euler16 {  }
  2 bigint_of_int { a }
  a 100 bigint_exp TO a
  \  1000 normalement 
  
  a sum_chiffres_bigint exit
;


: euler25 {  }
  2 { i }
  1 bigint_of_int { a }
  1 bigint_of_int { b }
  BEGIN
    b ->bigint_len @ 100 <
  WHILE
    \  1000 normalement 
    
    a b add_bigint { c }
    b TO a
    c TO b
    i 1 + TO i
  REPEAT
  i exit
;


: euler29 {  }
  5 { maxA }
  5 { maxB }
  HERE maxA 1 + cells allot { a_bigint }
  maxA 0 BEGIN 2dup >= WHILE DUP { j }
    j j * bigint_of_int a_bigint  j cells +  !
   1 + REPEAT 2DROP
  HERE maxA 1 + cells allot { a0_bigint }
  maxA 0 BEGIN 2dup >= WHILE DUP { j2 }
    j2 bigint_of_int a0_bigint  j2 cells +  !
   1 + REPEAT 2DROP
  HERE maxA 1 + cells allot { b }
  maxA 0 BEGIN 2dup >= WHILE DUP { k }
    2 b  k cells +  !
   1 + REPEAT 2DROP
  0 { n }
  true { found }
  BEGIN
    found
  WHILE
    a0_bigint  0 cells +  @ { min0 }
    false TO found
    maxA 2 BEGIN 2dup >= WHILE DUP { i }
      b  i cells +  @ maxB <=
      IF
        found
        IF
          a_bigint  i cells +  @ min0 bigint_lt
          IF
            a_bigint  i cells +  @ TO min0
          THEN
        ELSE
          a_bigint  i cells +  @ TO min0
          true TO found
        THEN
      THEN
     1 + REPEAT 2DROP
    found
    IF
      n 1 + TO n
      maxA 2 BEGIN 2dup >= WHILE DUP { l }
        a_bigint  l cells +  @ min0 bigint_eq b  l cells +  @ maxB <= AND
        IF
          b  l cells +  @ 1 + b  l cells +  !
          a_bigint  l cells +  @ a0_bigint  l cells +  @ mul_bigint a_bigint  l cells +  !
        THEN
       1 + REPEAT 2DROP
    THEN
  REPEAT
  n exit
;

: main
   euler29 s>d 0 d.r
  S\" \n" TYPE
  50 read_bigint { sum }
  100 2 BEGIN 2dup >= WHILE DUP { i }
    skipspaces
    50 read_bigint { tmp }
    sum tmp add_bigint TO sum
   1 + REPEAT 2DROP
  S" euler13 = " TYPE
  sum print_bigint
  S\" \neuler25 = " TYPE
   euler25 s>d 0 d.r
  S\" \neuler16 = " TYPE
   euler16 s>d 0 d.r
  S\" \n" TYPE
   euler48
  S" euler20 = " TYPE
   euler20 s>d 0 d.r
  S\" \n" TYPE
  999999 bigint_of_int { a }
  9951263 bigint_of_int { b }
  a print_bigint
  S" >>1=" TYPE
  a 1 NEGATE bigint_shift print_bigint
  S\" \n" TYPE
  a print_bigint
  S" *" TYPE
  b print_bigint
  S" =" TYPE
  a b mul_bigint print_bigint
  S\" \n" TYPE
  a print_bigint
  S" *" TYPE
  b print_bigint
  S" =" TYPE
  a b mul_bigint_cp print_bigint
  S\" \n" TYPE
  a print_bigint
  S" +" TYPE
  b print_bigint
  S" =" TYPE
  a b add_bigint print_bigint
  S\" \n" TYPE
  b print_bigint
  S" -" TYPE
  a print_bigint
  S" =" TYPE
  b a sub_bigint print_bigint
  S\" \n" TYPE
  a print_bigint
  S" -" TYPE
  b print_bigint
  S" =" TYPE
  a b sub_bigint print_bigint
  S\" \n" TYPE
  a print_bigint
  S" >" TYPE
  b print_bigint
  S" =" TYPE
  a b bigint_gt
  IF
    S" True" TYPE
  ELSE
    S" False" TYPE
  THEN
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/euler45.groovy<|end_filename|>
import java.util.*

int triangle(int n)
{
  if (n % 2 == 0)
      return n.intdiv(2) * (n + 1)
  else
      return n * (n + 1).intdiv(2)
}
int penta(int n)
{
  if (n % 2 == 0)
      return n.intdiv(2) * (3 * n - 1)
  else
      return (3 * n - 1).intdiv(2) * n
}
int hexa(int n)
{
  return n * (2 * n - 1)
}
boolean findPenta2(int n, int a, int b)
{
  if (b == a + 1)
      return penta(a) == n || penta(b) == n
  int c = (a + b).intdiv(2)
  int p = penta(c)
  if (p == n)
      return true
  else if (p < n)
      return findPenta2(n, c, b)
  else
      return findPenta2(n, a, c)
}
boolean findHexa2(int n, int a, int b)
{
  if (b == a + 1)
      return hexa(a) == n || hexa(b) == n
  int c = (a + b).intdiv(2)
  int p = hexa(c)
  if (p == n)
      return true
  else if (p < n)
      return findHexa2(n, c, b)
  else
      return findHexa2(n, a, c)
}

for (int n = 285; n < 55386; n++)
{
    int t = triangle(n)
    if (findPenta2(t, n.intdiv(5), n) && findHexa2(t, n.intdiv(5), n.intdiv(2) + 10))
        System.out.printf("%d\n%d\n", n, t)
}



<|start_filename|>out/aaa_missing.lua<|end_filename|>

function readintline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), "-?%d+") do
    tab[index] = tonumber(a)
    index = index + 1
  end
  return tab
end
--[[
  Ce test a été généré par Metalang.
--]]

function result (len, tab)
  local tab2 = {}
  for i = 0, len - 1 do
      tab2[i + 1] = false
  end
  for i1 = 0, len - 1 do
      io.write(string.format("%d ", tab[i1 + 1]))
      tab2[tab[i1 + 1] + 1] = true
  end
  io.write("\n")
  for i2 = 0, len - 1 do
      if not(tab2[i2 + 1]) then
          return i2
      end
  end
  return -1
end

local len = tonumber(io.read('*l'))
io.write(string.format("%d\n", len))
local tab = readintline()
io.write(string.format("%d\n", result(len, tab)))


<|start_filename|>out/euler40.java<|end_filename|>
import java.util.*;

public class euler40
{
  
  static int exp0(int a, int e)
  {
    int o = 1;
    for (int i = 1; i <= e; i++)
        o *= a;
    return o;
  }
  static int e(int[] t, int n)
  {
    for (int i = 1; i < 9; i++)
        if (n >= t[i] * i)
            n -= t[i] * i;
        else
        {
            int nombre = exp0(10, i - 1) + n / i;
            int chiffre = i - 1 - n % i;
            return nombre / exp0(10, chiffre) % 10;
        }
    return -1;
  }
  public static void main(String args[])
  {
    int[] t = new int[9];
    for (int i = 0; i < 9; i++)
        t[i] = exp0(10, i) - exp0(10, i - 1);
    for (int i2 = 1; i2 < 9; i2++)
        System.out.printf("%d => %d\n", i2, t[i2]);
    for (int j = 0; j < 81; j++)
        System.out.print(e(t, j));
    System.out.print("\n");
    for (int k = 1; k < 51; k++)
        System.out.print(k);
    System.out.print("\n");
    for (int j2 = 169; j2 < 221; j2++)
        System.out.print(e(t, j2));
    System.out.print("\n");
    for (int k2 = 90; k2 < 111; k2++)
        System.out.print(k2);
    System.out.print("\n");
    int out0 = 1;
    for (int l = 0; l < 7; l++)
    {
        int puiss = exp0(10, l);
        int v = e(t, puiss - 1);
        out0 *= v;
        System.out.printf("10^%d=%d v=%d\n", l, puiss, v);
    }
    System.out.printf("%d\n", out0);
  }
  
}



<|start_filename|>out/aaa_10stringsarray.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
data Toto = Toto {
                    _s :: IORef String,
                    _v :: IORef Int
                    }
  deriving Eq


idstring s =
  return s

printstring s =
  printf "%s\n" =<< ((idstring s)::IO String)

print_toto t =
  join $ printf "%s = %d\n" <$> ((readIORef (_s t))::IO String) <*> ((readIORef (_v t))::IO Int)

main =
  do tab <- array_init 2 (\ i ->
                            idstring "chaine de test")
     let a j =
           if j <= 1
           then do ((readIOA tab j) >>= idstring) >>= printstring
                   a (j + 1)
           else do (Toto <$> (newIORef "one") <*> (newIORef 1)) >>= print_toto
                   return () in
           a 0




<|start_filename|>out/dichoexp.cpp<|end_filename|>
#include <iostream>
#include <vector>

int exp0(int a, int b) {
    if (b == 0)
        return 1;
    if (b % 2 == 0)
    {
        int o = exp0(a, b / 2);
        return o * o;
    }
    else
        return a * exp0(a, b - 1);
}

int main() {
    int a = 0;
    int b = 0;
    std::cin >> a >> b >> std::noskipws;
    std::cout << exp0(a, b);
}



<|start_filename|>out/euler52.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function chiffre_sort (a)
  if a < 10 then
      return a
  else 
      local b = chiffre_sort(trunc(a / 10))
      local c = math.fmod(a, 10)
      local d = math.fmod(b, 10)
      local e = trunc(b / 10)
      if c < d then
          return c + b * 10
      else 
          return d + chiffre_sort(c + e * 10) * 10
      end
  end
end

function same_numbers (a, b, c, d, e, f)
  local ca = chiffre_sort(a)
  return ca == chiffre_sort(b) and ca == chiffre_sort(c) and ca == chiffre_sort(d) and ca == chiffre_sort(e) and ca == chiffre_sort(f)
end

local num = 142857
if same_numbers(num, num * 2, num * 3, num * 4, num * 6, num * 5) then
    io.write(string.format("%d %d %d %d %d %d\n", num, num * 2, num * 3, num * 4, num * 5, num * 6))
end


<|start_filename|>out/sqrttest.cs<|end_filename|>
using System;

public class sqrttest
{
  
  public static void Main(String[] args)
  {
    Console.Write((int)Math.Sqrt(4) + " " + (int)Math.Sqrt(16) + " " + (int)Math.Sqrt(20) + " " + (int)Math.Sqrt(1000) + " " + (int)Math.Sqrt(500) + " " + (int)Math.Sqrt(10) + " ");
  }
  
}



<|start_filename|>out/plus_petit.cpp<|end_filename|>
#include <iostream>
#include <vector>

int go0(std::vector<int>& tab, int a, int b) {
    int m = (a + b) / 2;
    if (a == m)
        if (tab[a] == m)
            return b;
        else
            return a;
    int i = a;
    int j = b;
    while (i < j)
    {
        int e = tab[i];
        if (e < m)
            i++;
        else
        {
            j--;
            tab[i] = tab[j];
            tab[j] = e;
        }
    }
    if (i < m)
        return go0(tab, a, m);
    else
        return go0(tab, m, b);
}


int plus_petit0(std::vector<int>& tab, int len) {
    return go0(tab, 0, len);
}

int main() {
    int len = 0;
    std::cin >> len;
    std::vector<int> tab( len );
    for (int i = 0; i < len; i++)
    {
        int tmp = 0;
        std::cin >> tmp;
        tab[i] = tmp;
    }
    std::cout << plus_petit0(tab, len);
}



<|start_filename|>out/sumDiv.cpp<|end_filename|>
#include <iostream>
#include <vector>

void foo() {
    int a = 0;
    //  test 
    a++;
    //  test 2 
}


void foo2() {
    
}


void foo3() {
    if (1 == 1)
    {
        
    }
}


int sumdiv(int n) {
    //  On désire renvoyer la somme des diviseurs 
    int out0 = 0;
    //  On déclare un entier qui contiendra la somme 
    for (int i = 1; i <= n; i++)
        //  La boucle : i est le diviseur potentiel
        if (n % i == 0)
        {
            //  Si i divise 
            out0 += i;
            //  On incrémente 
        }
        else
        {
            //  nop 
        }
    return out0;
    // On renvoie out
}

int main() {
    //  Programme principal 
    int n = 0;
    std::cin >> n >> std::noskipws;
    //  Lecture de l'entier 
    std::cout << sumdiv(n);
}



<|start_filename|>out/rot13.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure rot13 is


type stringptr is access all char_array;
procedure PChar(c : in Character) is
begin
  Character'Write (Text_Streams.Stream (Current_Output), c);
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
--
--Ce test effectue un rot13 sur une chaine lue en entrée
--

type a is Array (Integer range <>) of Character;
type a_PTR is access a;

  tmpc : Character;
  tab4 : a_PTR;
  strlen : Integer;
  c : Integer;
begin
  Get(strlen);
  SkipSpaces;
  tab4 := new a (0..strlen - 1);
  for toto in integer range 0..strlen - 1 loop
    Get(tmpc);
    c := Character'Pos(tmpc);
    if tmpc /= ' '
    then
      c := (c - Character'Pos('a') + 13) rem 26 + Character'Pos('a');
    end if;
    tab4(toto) := Character'Val(c);
  end loop;
  for j in integer range 0..strlen - 1 loop
    PChar(tab4(j));
  end loop;
end;


<|start_filename|>out/aaa_11arrayconst.lua<|end_filename|>
function test (tab, len)
  for i = 0, len - 1 do
      io.write(string.format("%d ", tab[i + 1]))
  end
  io.write("\n")
end

local t = {}
for i = 0, 4 do
    t[i + 1] = 1
end
test(t, 5)


<|start_filename|>out/euler04.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>
/*

(a + b * 10 + c * 100) * (d + e * 10 + f * 100) =
a * d + a * e * 10 + a * f * 100 +
10 * (b * d + b * e * 10 + b * f * 100)+
100 * (c * d + c * e * 10 + c * f * 100) =

a * d       + a * e * 10   + a * f * 100 +
b * d * 10  + b * e * 100  + b * f * 1000 +
c * d * 100 + c * e * 1000 + c * f * 10000 =

a * d +
10 * ( a * e + b * d) +
100 * (a * f + b * e + c * d) +
(c * e + b * f) * 1000 +
c * f * 10000

*/

int chiffre(int c, int m) {
    if (c == 0)
        return m % 10;
    else
        return chiffre(c - 1, m / 10);
}

int main() {
    int m = 1;
    for (int a = 0; a < 10; a++)
        for (int f = 1; f < 10; f++)
            for (int d = 0; d < 10; d++)
                for (int c = 1; c < 10; c++)
                    for (int b = 0; b < 10; b++)
                        for (int e = 0; e < 10; e++)
                        {
                            int mul = a * d + 10 * (a * e + b * d) + 100 * (a * f + b * e + c * d) + 1000 * (c * e + b * f) + 10000 * c * f;
                            if (chiffre(0, mul) == chiffre(5, mul) && chiffre(1, mul) == chiffre(4, mul) && chiffre(2, mul) == chiffre(3, mul))
                                m = std::max(mul, m);
                        }
    std::cout << m << "\n";
}



<|start_filename|>out/aaa_06readcouple.lua<|end_filename|>

function readintline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), "-?%d+") do
    tab[index] = tonumber(a)
    index = index + 1
  end
  return tab
end

for i = 1, 3 do
    a, b = table.unpack(readintline())
    io.write(string.format("a = %d b = %d\n", a, b))
end
local l = readintline()
for j = 0, 9 do
    io.write(string.format("%d\n", l[j + 1]))
end


<|start_filename|>out/euler02.fs<|end_filename|>
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: main
  1 { a }
  2 { b }
  0 { sum }
  BEGIN
    a 4000000 <
  WHILE
    a 2 % 0 =
    IF
      sum a + TO sum
    THEN
    a { c }
    b TO a
    b c + TO b
  REPEAT
  sum s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/euler04.go<|end_filename|>
package main
import "fmt"
func max2_(a int, b int) int{
  if a > b {
      return a
  } else {
      return b
  }
}
/*

(a + b * 10 + c * 100) * (d + e * 10 + f * 100) =
a * d + a * e * 10 + a * f * 100 +
10 * (b * d + b * e * 10 + b * f * 100)+
100 * (c * d + c * e * 10 + c * f * 100) =

a * d       + a * e * 10   + a * f * 100 +
b * d * 10  + b * e * 100  + b * f * 1000 +
c * d * 100 + c * e * 1000 + c * f * 10000 =

a * d +
10 * ( a * e + b * d) +
100 * (a * f + b * e + c * d) +
(c * e + b * f) * 1000 +
c * f * 10000

*/
func chiffre(c int, m int) int{
  if c == 0 {
      return m % 10
  } else {
      return chiffre(c - 1, m / 10)
  }
}
func main() {
  m := 1
  for a := 0; a < 10; a++ {
      for f := 1; f < 10; f++ {
          for d := 0; d < 10; d++ {
              for c := 1; c < 10; c++ {
                  for b := 0; b < 10; b++ {
                      for e := 0; e < 10; e++ {
                          mul := a * d + 10 * (a * e + b * d) + 100 * (a * f + b * e + c * d) + 1000 * (c * e + b * f) + 10000 * c * f
                          if chiffre(0, mul) == chiffre(5, mul) && chiffre(1, mul) == chiffre(4, mul) && chiffre(2, mul) == chiffre(3, mul) {
                              m = max2_(mul, m)
                          }
                      }
                  }
              }
          }
      }
  }
  fmt.Printf("%d\n", m)
}



<|start_filename|>out/cambriolage.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func max2_(a int, b int) int{
  if a > b {
      return a
  } else {
      return b
  }
}
func nbPassePartout(n int, passepartout [][]int, m int, serrures [][]int) int{
  max_ancient := 0
  max_recent := 0
  for i := 0; i < m; i++ {
      if serrures[i][0] == -1 && serrures[i][1] > max_ancient {
          max_ancient = serrures[i][1]
      }
      if serrures[i][0] == 1 && serrures[i][1] > max_recent {
          max_recent = serrures[i][1]
      }
  }
  max_ancient_pp := 0
  max_recent_pp := 0
  for i := 0; i < n; i++ {
      var pp []int = passepartout[i]
      if pp[0] >= max_ancient && pp[1] >= max_recent {
          return 1
      }
      max_ancient_pp = max2_(max_ancient_pp, pp[0])
      max_recent_pp = max2_(max_recent_pp, pp[1])
  }
  if max_ancient_pp >= max_ancient && max_recent_pp >= max_recent {
      return 2
  } else {
      return 0
  }
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var n int
  fmt.Fscanf(reader, "%d", &n)
  skip()
  var passepartout [][]int = make([][]int, n)
  for i := 0; i < n; i++ {
      var out0 []int = make([]int, 2)
      for j := 0; j < 2; j++ {
          var out01 int
          fmt.Fscanf(reader, "%d", &out01)
          skip()
          out0[j] = out01
      }
      passepartout[i] = out0
  }
  var m int
  fmt.Fscanf(reader, "%d", &m)
  skip()
  var serrures [][]int = make([][]int, m)
  for k := 0; k < m; k++ {
      var out1 []int = make([]int, 2)
      for l := 0; l < 2; l++ {
          var out_ int
          fmt.Fscanf(reader, "%d", &out_)
          skip()
          out1[l] = out_
      }
      serrures[k] = out1
  }
  fmt.Printf("%d", nbPassePartout(n, passepartout, m, serrures))
}



<|start_filename|>out/euler03.groovy<|end_filename|>
import java.util.*



int maximum = 1
int b0 = 2
int a = 408464633
int sqrtia = (int)Math.sqrt(a)
while (a != 1)
{
    int b = b0
    boolean found = false
    while (b <= sqrtia)
    {
        if (a % b == 0)
        {
            a /= b
            b0 = b
            b = a
            sqrtia = (int)Math.sqrt(a)
            found = true
        }
        b++
    }
    if (!found)
    {
        System.out.printf("%d\n", a)
        a = 1
    }
}



<|start_filename|>out/aaa_00hello.js<|end_filename|>
var util = require("util");

util.print("Hello World\n");



<|start_filename|>out/prologin_template_2charline.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int programme_candidat(char* tableau1, int taille1, char* tableau2, int taille2) {
    int j, i;
    int out0 = 0;
    for (i = 0; i < taille1; i++)
    {
        out0 += (int)(tableau1[i]) * i;
        printf("%c", tableau1[i]);
    }
    printf("--\n");
    for (j = 0; j < taille2; j++)
    {
        out0 += (int)(tableau2[j]) * j * 100;
        printf("%c", tableau2[j]);
    }
    printf("--\n");
    return out0;
}
int main(void) {
    int b, taille2, a, taille1;
    scanf("%d ", &taille1);
    char *tableau1 = calloc(taille1, sizeof(char));
    for (a = 0; a < taille1; a++)
        scanf("%c", &tableau1[a]);
    scanf(" %d ", &taille2);
    char *tableau2 = calloc(taille2, sizeof(char));
    for (b = 0; b < taille2; b++)
        scanf("%c", &tableau2[b]);
    scanf(" ");
    printf("%d\n", programme_candidat(tableau1, taille1, tableau2, taille2));
    return 0;
}




<|start_filename|>out/carre.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

  int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }


@Field Scanner scanner = new Scanner(System.in)
int x = Integer.parseInt(scanner.nextLine())
int y = Integer.parseInt(scanner.nextLine())
int[][] tab = new int[y][]
for (int d = 0; d < y; d++)
    tab[d] = read_int_line()
for (int ix = 1; ix < x; ix++)
    for (int iy = 1; iy < y; iy++)
        if (tab[iy][ix] == 1)
            tab[iy][ix] = Math.min(Math.min(tab[iy][ix - 1], tab[iy - 1][ix]), tab[iy - 1][ix - 1]) + 1
for (int jy = 0; jy < y; jy++)
{
    for (int jx = 0; jx < x; jx++)
        System.out.printf("%d ", tab[jy][jx])
    print("\n")
}



<|start_filename|>out/euler27.cc<|end_filename|>
#include <iostream>
#include <vector>

int eratostene(std::vector<int> * t, int max0) {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t->at(i) == i)
        {
            n++;
            int j = i * i;
            while (j < max0 && j > 0)
            {
                t->at(j) = 0;
                j += i;
            }
        }
    return n;
}


bool isPrime(int n, std::vector<int> * primes, int len) {
    int i = 0;
    if (n < 0)
        n = -n;
    while (primes->at(i) * primes->at(i) < n)
    {
        if (n % primes->at(i) == 0)
            return false;
        i++;
    }
    return true;
}


int test(int a, int b, std::vector<int> * primes, int len) {
    for (int n = 0; n < 201; n++)
    {
        int j = n * n + a * n + b;
        if (!isPrime(j, primes, len))
            return n;
    }
    return 200;
}

int main() {
    int maximumprimes = 1000;
    std::vector<int> *era = new std::vector<int>( maximumprimes );
    for (int j = 0; j < maximumprimes; j++)
        era->at(j) = j;
    int result = 0;
    int max0 = 0;
    int nprimes = eratostene(era, maximumprimes);
    std::vector<int> *primes = new std::vector<int>( nprimes );
    std::fill(primes->begin(), primes->end(), 0);
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era->at(k) == k)
        {
            primes->at(l) = k;
            l++;
        }
    std::cout << l << " == " << nprimes << "\n";
    int ma = 0;
    int mb = 0;
    for (int b = 3; b < 1000; b++)
        if (era->at(b) == b)
            for (int a = -999; a < 1000; a++)
            {
                int n1 = test(a, b, primes, nprimes);
                int n2 = test(a, -b, primes, nprimes);
                if (n1 > max0)
                {
                    max0 = n1;
                    result = a * b;
                    ma = a;
                    mb = b;
                }
                if (n2 > max0)
                {
                    max0 = n2;
                    result = -a * b;
                    ma = a;
                    mb = -b;
                }
            }
    std::cout << ma << " " << mb << "\n" << max0 << "\n" << result << "\n";
}



<|start_filename|>out/test_enum.cpp<|end_filename|>
#include <iostream>
#include <vector>
typedef enum foo_t {
    Foo,
    Bar,
    Blah
} foo_t;
int main() {
    foo_t foo_val = Foo;
}



<|start_filename|>out/euler17.java<|end_filename|>
import java.util.*;

public class euler17
{
  
  
  public static void main(String args[])
  {
    System.out.printf("%d\n", 3 + 16);
    int one_to_nine = 3 + 33;
    System.out.printf("%d\n", one_to_nine);
    int one_to_ten = one_to_nine + 3;
    int one_to_twenty = one_to_ten + 73;
    int one_to_thirty = one_to_twenty + 6 * 9 + one_to_nine + 6;
    int one_to_forty = one_to_thirty + 6 * 9 + one_to_nine + 5;
    int one_to_fifty = one_to_forty + 5 * 9 + one_to_nine + 5;
    int one_to_sixty = one_to_fifty + 5 * 9 + one_to_nine + 5;
    int one_to_seventy = one_to_sixty + 5 * 9 + one_to_nine + 7;
    int one_to_eighty = one_to_seventy + 7 * 9 + one_to_nine + 6;
    int one_to_ninety = one_to_eighty + 6 * 9 + one_to_nine + 6;
    int one_to_ninety_nine = one_to_ninety + 6 * 9 + one_to_nine;
    System.out.printf("%d\n%d\n", one_to_ninety_nine, 100 * one_to_nine + one_to_ninety_nine * 10 + 10 * 9 * 99 + 7 * 9 + 11);
  }
  
}



<|start_filename|>out/euler11.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler11 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
function max2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a > b
  then
    return a;
  else
    return b;
  end if;
end;
type s is Array (Integer range <>) of Integer;
type s_PTR is access s;
type u is Array (Integer range <>) of s_PTR;
type u_PTR is access u;
function find(n : in Integer; m : in u_PTR; x : in Integer; y : in Integer; dx : in Integer; dy : in Integer) return Integer is
begin
  if ((x < 0 or else x = 20) or else y < 0) or else y = 20
  then
    return (-1);
  else
    if n = 0
    then
      return 1;
    else
      return m(y)(x) * find(n - 1, m, x + dx, y + dy, dx, dy);
    end if;
  end if;
end;
type tuple_int_int;
type tuple_int_int_PTR is access tuple_int_int;
type tuple_int_int is record
  tuple_int_int_field_0 : Integer;
  tuple_int_int_field_1 : Integer;
end record;
type v is Array (Integer range <>) of tuple_int_int_PTR;
type v_PTR is access v;

  r : tuple_int_int_PTR;
  p : s_PTR;
  max0 : Integer;
  m : u_PTR;
  l : tuple_int_int_PTR;
  k : tuple_int_int_PTR;
  h : tuple_int_int_PTR;
  g : tuple_int_int_PTR;
  f : tuple_int_int_PTR;
  e : tuple_int_int_PTR;
  dy : Integer;
  dx : Integer;
  directions : v_PTR;
  d : tuple_int_int_PTR;
  c : tuple_int_int_PTR;
begin
  directions := new v (0..7);
  for i in integer range 0..7 loop
    if i = 0
    then
      c := new tuple_int_int;
      c.tuple_int_int_field_0 := 0;
      c.tuple_int_int_field_1 := 1;
      directions(i) := c;
    else
      if i = 1
      then
        d := new tuple_int_int;
        d.tuple_int_int_field_0 := 1;
        d.tuple_int_int_field_1 := 0;
        directions(i) := d;
      else
        if i = 2
        then
          e := new tuple_int_int;
          e.tuple_int_int_field_0 := 0;
          e.tuple_int_int_field_1 := (-1);
          directions(i) := e;
        else
          if i = 3
          then
            f := new tuple_int_int;
            f.tuple_int_int_field_0 := (-1);
            f.tuple_int_int_field_1 := 0;
            directions(i) := f;
          else
            if i = 4
            then
              g := new tuple_int_int;
              g.tuple_int_int_field_0 := 1;
              g.tuple_int_int_field_1 := 1;
              directions(i) := g;
            else
              if i = 5
              then
                h := new tuple_int_int;
                h.tuple_int_int_field_0 := 1;
                h.tuple_int_int_field_1 := (-1);
                directions(i) := h;
              else
                if i = 6
                then
                  k := new tuple_int_int;
                  k.tuple_int_int_field_0 := (-1);
                  k.tuple_int_int_field_1 := 1;
                  directions(i) := k;
                else
                  l := new tuple_int_int;
                  l.tuple_int_int_field_0 := (-1);
                  l.tuple_int_int_field_1 := (-1);
                  directions(i) := l;
                end if;
              end if;
            end if;
          end if;
        end if;
      end if;
    end if;
  end loop;
  max0 := 0;
  m := new u (0..19);
  for o in integer range 0..19 loop
    p := new s (0..19);
    for q in integer range 0..19 loop
      Get(p(q));
      SkipSpaces;
    end loop;
    m(o) := p;
  end loop;
  for j in integer range 0..7 loop
    r := directions(j);
    dx := r.tuple_int_int_field_0;
    dy := r.tuple_int_int_field_1;
    for x in integer range 0..19 loop
      for y in integer range 0..19 loop
        max0 := max2_0(max0, find(4, m, x, y, dx, dy));
      end loop;
    end loop;
  end loop;
  PInt(max0);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler26.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function periode (restes, len, a, b)
  while a ~= 0 do
      local chiffre = trunc(a / b)
      local reste = math.fmod(a, b)
      for i = 0, len - 1 do
          if restes[i + 1] == reste then
              return len - i
          end
      end
      restes[len + 1] = reste
      len = len + 1
      a = reste * 10
  end
  return 0
end

local t = {}
for j = 0, 999 do
    t[j + 1] = 0
end
local m = 0
local mi = 0
for i = 1, 1000 do
    local p = periode(t, 0, 1, i)
    if p > m then
        mi = i
        m = p
    end
end
io.write(string.format("%d\n%d\n", mi, m))


<|start_filename|>out/aaa_integer.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int main(void) {
    int i = 0;
    i--;
    printf("%d\n", i);
    i += 55;
    printf("%d\n", i);
    i *= 13;
    printf("%d\n", i);
    i /= 2;
    printf("%d\n", i);
    i++;
    printf("%d\n", i);
    i /= 3;
    printf("%d\n", i);
    i--;
    printf("%d\n", i);
    /*
http://fr.wikipedia.org/wiki/Modulo_(op%C3%A9ration)#Trois_d.C3.A9finitions_de_la_fonction_modulo
*/
    printf("%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n", 117 / 17, 117 / -17, -117 / 17, -117 / -17, 117 % 17, 117 % -17, -117 % 17, -117 % -17);
    return 0;
}




<|start_filename|>out/aaa_03binding.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_03binding is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

function g(i : in Integer) return Integer is
  j : Integer;
begin
  j := i * 4;
  if j rem 2 = 1
  then
    return 0;
  end if;
  return j;
end;
procedure h(i : in Integer) is
begin
  PInt(i);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;

  b : Integer;
  a : Integer;
begin
  h(14);
  a := 4;
  b := 5;
  PInt(a + b);
  -- main 
  
  h(15);
  a := 2;
  b := 1;
  PInt(a + b);
end;


<|start_filename|>out/euler21.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
eratostene t max0 =
  let a i b =
        if i <= max0 - 1
        then ifM (((==) i) <$> (readIOA t i))
                 (do let c = b + 1
                     let j = i * i
                     let e f =
                           if f < max0 && f > 0
                           then do writeIOA t f 0
                                   let g = f + i
                                   e g
                           else a (i + 1) c in
                           e j)
                 (a (i + 1) b)
        else return b in
        a 2 0

fillPrimesFactors t n primes nprimes =
  let h i m =
        if i <= nprimes - 1
        then do d <- readIOA primes i
                let q r =
                      if (r `rem` d) == 0
                      then do writeIOA t d =<< (((+) 1) <$> (readIOA t d))
                              let s = r `quot` d
                              q s
                      else if r == 1
                           then readIOA primes i
                           else h (i + 1) r in
                      q m
        else return m in
        h 0 n

sumdivaux2 t n i =
  let u v =
        ifM ((return (v < n)) <&&> (((==) 0) <$> (readIOA t v)))
            (do let w = v + 1
                u w)
            (return v) in
        u i

sumdivaux t n i =
  if i > n
  then return 1
  else ifM (((==) 0) <$> (readIOA t i))
           (sumdivaux t n =<< (sumdivaux2 t n (i + 1)))
           (do o <- sumdivaux t n =<< (sumdivaux2 t n (i + 1))
               x <- readIOA t i
               let y j z ba =
                     if j <= x
                     then do let bb = z + ba
                             let bc = ba * i
                             y (j + 1) bb bc
                     else return ((z + 1) * o) in
                     y 1 0 i)

sumdiv nprimes primes n =
  do t <- array_init (n + 1) (\ i ->
                                return 0)
     max0 <- fillPrimesFactors t n primes nprimes
     sumdivaux t max0 0

main =
  do era <- array_init 1001 (\ j ->
                               return j)
     nprimes <- eratostene era 1001
     primes <- array_init nprimes (\ o ->
                                     return 0)
     let bd k be =
            if k <= 1001 - 1
            then ifM (((==) k) <$> (readIOA era k))
                     (do writeIOA primes be k
                         let bi = be + 1
                         bd (k + 1) bi)
                     (bd (k + 1) be)
            else do printf "%d == %d\n" (be::Int) (nprimes::Int) :: IO()
                    let bf n bg =
                           if n <= 1000
                           then do other <- ((-) <$> (sumdiv nprimes primes n) <*> (return n))
                                   if other > n
                                   then do othersum <- ((-) <$> (sumdiv nprimes primes other) <*> (return other))
                                           if othersum == n
                                           then do printf "%d & %d\n" (other::Int) (n::Int) :: IO()
                                                   let bh = bg + other + n
                                                   bf (n + 1) bh
                                           else bf (n + 1) bg
                                   else bf (n + 1) bg
                           else printf "\n%d\n" (bg::Int) :: IO() in
                           bf 2 0 in
            bd 2 0




<|start_filename|>out/prologin_template_intlist.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

  int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

int programme_candidat(int[] tableau, int taille)
{
  int out0 = 0
  for (int i = 0; i < taille; i++)
      out0 += tableau[i]
  return out0
}
@Field Scanner scanner = new Scanner(System.in)
int taille = Integer.parseInt(scanner.nextLine())
int[] tableau = read_int_line()
System.out.printf("%d\n", programme_candidat(tableau, taille))



<|start_filename|>out/euler11.java<|end_filename|>
import java.util.*;

public class euler11
{
  static Scanner scanner = new Scanner(System.in);
  static int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

  static int find(int n, int[][] m, int x, int y, int dx, int dy)
  {
    if (x < 0 || x == 20 || y < 0 || y == 20)
        return -1;
    else if (n == 0)
        return 1;
    else
        return m[y][x] * find(n - 1, m, x + dx, y + dy, dx, dy);
  }
  static class tuple_int_int {
    public int tuple_int_int_field_0;
    public int tuple_int_int_field_1;
  }
  public static void main(String args[])
  {
    tuple_int_int[] directions = new tuple_int_int[8];
    for (int i = 0; i < 8; i++)
        if (i == 0)
        {
            tuple_int_int c = new tuple_int_int();
            c.tuple_int_int_field_0 = 0;
            c.tuple_int_int_field_1 = 1;
            directions[i] = c;
        }
        else if (i == 1)
        {
            tuple_int_int d = new tuple_int_int();
            d.tuple_int_int_field_0 = 1;
            d.tuple_int_int_field_1 = 0;
            directions[i] = d;
        }
        else if (i == 2)
        {
            tuple_int_int e = new tuple_int_int();
            e.tuple_int_int_field_0 = 0;
            e.tuple_int_int_field_1 = -1;
            directions[i] = e;
        }
        else if (i == 3)
        {
            tuple_int_int f = new tuple_int_int();
            f.tuple_int_int_field_0 = -1;
            f.tuple_int_int_field_1 = 0;
            directions[i] = f;
        }
        else if (i == 4)
        {
            tuple_int_int g = new tuple_int_int();
            g.tuple_int_int_field_0 = 1;
            g.tuple_int_int_field_1 = 1;
            directions[i] = g;
        }
        else if (i == 5)
        {
            tuple_int_int h = new tuple_int_int();
            h.tuple_int_int_field_0 = 1;
            h.tuple_int_int_field_1 = -1;
            directions[i] = h;
        }
        else if (i == 6)
        {
            tuple_int_int k = new tuple_int_int();
            k.tuple_int_int_field_0 = -1;
            k.tuple_int_int_field_1 = 1;
            directions[i] = k;
        }
        else
        {
            tuple_int_int l = new tuple_int_int();
            l.tuple_int_int_field_0 = -1;
            l.tuple_int_int_field_1 = -1;
            directions[i] = l;
        }
    int max0 = 0;
    int[][] m = new int[20][];
    for (int o = 0; o < 20; o++)
        m[o] = read_int_line();
    for (int j = 0; j < 8; j++)
    {
        tuple_int_int p = directions[j];
        int dx = p.tuple_int_int_field_0;
        int dy = p.tuple_int_int_field_1;
        for (int x = 0; x < 20; x++)
            for (int y = 0; y < 20; y++)
                max0 = Math.max(max0, find(4, m, x, y, dx, dy));
    }
    System.out.printf("%d\n", max0);
  }
  
}



<|start_filename|>out/aaa_08tuple.lua<|end_filename|>

function readintline()
  local tab = {}
  local index = 1
  for a in string.gmatch(io.read("*l"), "-?%d+") do
    tab[index] = tonumber(a)
    index = index + 1
  end
  return tab
end

local bar_ = tonumber(io.read('*l'))
local t = {foo=readintline(), bar=bar_}
a, b = table.unpack(t.foo)
io.write(string.format("%d %d %d\n", a, b, t.bar))


<|start_filename|>out/cambriolage.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int nbPassePartout(int n, int[][] passepartout, int m, int[][] serrures)
{
  int max_ancient = 0
  int max_recent = 0
  for (int i = 0; i < m; i++)
  {
      if (serrures[i][0] == -1 && serrures[i][1] > max_ancient)
          max_ancient = serrures[i][1]
      if (serrures[i][0] == 1 && serrures[i][1] > max_recent)
          max_recent = serrures[i][1]
  }
  int max_ancient_pp = 0
  int max_recent_pp = 0
  for (int i = 0; i < n; i++)
  {
      int[] pp = passepartout[i]
      if (pp[0] >= max_ancient && pp[1] >= max_recent)
          return 1
      max_ancient_pp = Math.max(max_ancient_pp, pp[0])
      max_recent_pp = Math.max(max_recent_pp, pp[1])
  }
  if (max_ancient_pp >= max_ancient && max_recent_pp >= max_recent)
      return 2
  else
      return 0
}
@Field Scanner scanner = new Scanner(System.in)
int n
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  n = scanner.nextInt()
} else {
  n = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
int[][] passepartout = new int[n][]
for (int i = 0; i < n; i++)
{
    int[] out0 = new int[2]
    for (int j = 0; j < 2; j++)
    {
        int out01
        if (scanner.hasNext("^-")) {
          scanner.next("^-")
          out01 = scanner.nextInt()
        } else {
          out01 = scanner.nextInt()
        }
        scanner.findWithinHorizon("[\n\r ]*", 1)
        out0[j] = out01
    }
    passepartout[i] = out0
}
int m
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  m = scanner.nextInt()
} else {
  m = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
int[][] serrures = new int[m][]
for (int k = 0; k < m; k++)
{
    int[] out1 = new int[2]
    for (int l = 0; l < 2; l++)
    {
        int out_
        if (scanner.hasNext("^-")) {
          scanner.next("^-")
          out_ = scanner.nextInt()
        } else {
          out_ = scanner.nextInt()
        }
        scanner.findWithinHorizon("[\n\r ]*", 1)
        out1[l] = out_
    }
    serrures[k] = out1
}
print(nbPassePartout(n, passepartout, m, serrures))



<|start_filename|>out/euler17.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int main(void) {
    printf("%d\n", 3 + 16);
    int one_to_nine = 3 + 33;
    printf("%d\n", one_to_nine);
    int one_to_ten = one_to_nine + 3;
    int one_to_twenty = one_to_ten + 73;
    int one_to_thirty = one_to_twenty + 6 * 9 + one_to_nine + 6;
    int one_to_forty = one_to_thirty + 6 * 9 + one_to_nine + 5;
    int one_to_fifty = one_to_forty + 5 * 9 + one_to_nine + 5;
    int one_to_sixty = one_to_fifty + 5 * 9 + one_to_nine + 5;
    int one_to_seventy = one_to_sixty + 5 * 9 + one_to_nine + 7;
    int one_to_eighty = one_to_seventy + 7 * 9 + one_to_nine + 6;
    int one_to_ninety = one_to_eighty + 6 * 9 + one_to_nine + 6;
    int one_to_ninety_nine = one_to_ninety + 6 * 9 + one_to_nine;
    printf("%d\n%d\n", one_to_ninety_nine, 100 * one_to_nine + one_to_ninety_nine * 10 + 10 * 9 * 99 + 7 * 9 + 11);
    return 0;
}




<|start_filename|>out/euler39.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>


int main(void) {
    int k, a, b, i;
    int *t = calloc(1001, sizeof(int));
    for (i = 0; i < 1001; i++)
        t[i] = 0;
    for (a = 1; a < 1001; a++)
        for (b = 1; b < 1001; b++)
        {
            int c2 = a * a + b * b;
            int c = (int)sqrt(c2);
            if (c * c == c2)
            {
                int p = a + b + c;
                if (p < 1001)
                    t[p]++;
            }
        }
    int j = 0;
    for (k = 1; k < 1001; k++)
        if (t[k] > t[j])
            j = k;
    printf("%d", j);
    return 0;
}




<|start_filename|>out/aaa_12strings.lua<|end_filename|>

io.write("tada ' \" \n\r\t $ & todo\n\n{foo} \\${blah}\nblah\n")


<|start_filename|>out/euler01.groovy<|end_filename|>
import java.util.*



int sum = 0
for (int i = 0; i < 1000; i++)
    if (i % 3 == 0 || i % 5 == 0)
        sum += i
System.out.printf("%d\n", sum)



<|start_filename|>out/countchar.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure countchar is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type a is Array (Integer range <>) of Character;
type a_PTR is access a;
function nth(tab : in a_PTR; tofind : in Character; len : in Integer) return Integer is
  out0 : Integer;
begin
  out0 := 0;
  for i in integer range 0..len - 1 loop
    if tab(i) = tofind
    then
      out0 := out0 + 1;
    end if;
  end loop;
  return out0;
end;

  tofind : Character;
  tmp : Character;
  tab : a_PTR;
  result : Integer;
  len : Integer;
begin
  len := 0;
  Get(len);
  SkipSpaces;
  tofind := Character'Val(0);
  Get(tofind);
  SkipSpaces;
  tab := new a (0..len - 1);
  for i in integer range 0..len - 1 loop
    tmp := Character'Val(0);
    Get(tmp);
    tab(i) := tmp;
  end loop;
  result := nth(tab, tofind, len);
  PInt(result);
end;


<|start_filename|>out/aaa_02if.go<|end_filename|>
package main
import "fmt"
func f(i int) bool{
  if i == 0 {
      return true
  }
  return false
}
func main() {
  if f(4) {
      fmt.Printf("true <-\n ->\n")
  } else {
      fmt.Printf("false <-\n ->\n")
  }
  fmt.Printf("small test end\n")
}



<|start_filename|>out/pathfindList.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure pathfindList is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function pathfind_aux(cache : in a_PTR; tab : in a_PTR; len : in Integer; pos : in Integer) return Integer is
  posval : Integer;
  out0 : Integer;
  oneval : Integer;
begin
  if pos >= len - 1
  then
    return 0;
  else
    if cache(pos) /= (-1)
    then
      return cache(pos);
    else
      cache(pos) := len * 2;
      posval := pathfind_aux(cache, tab, len, tab(pos));
      oneval := pathfind_aux(cache, tab, len, pos + 1);
      out0 := 0;
      if posval < oneval
      then
        out0 := 1 + posval;
      else
        out0 := 1 + oneval;
      end if;
      cache(pos) := out0;
      return out0;
    end if;
  end if;
end;
function pathfind(tab : in a_PTR; len : in Integer) return Integer is
  cache : a_PTR;
begin
  cache := new a (0..len - 1);
  for i in integer range 0..len - 1 loop
    cache(i) := (-1);
  end loop;
  return pathfind_aux(cache, tab, len, 0);
end;

  tmp : Integer;
  tab : a_PTR;
  result : Integer;
  len : Integer;
begin
  len := 0;
  Get(len);
  SkipSpaces;
  tab := new a (0..len - 1);
  for i in integer range 0..len - 1 loop
    tmp := 0;
    Get(tmp);
    SkipSpaces;
    tab(i) := tmp;
  end loop;
  result := pathfind(tab, len);
  PInt(result);
end;


<|start_filename|>out/euler45.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
triangle n =
  return (if (n `rem` 2) == 0
          then (n `quot` 2) * (n + 1)
          else n * ((n + 1) `quot` 2))

penta n =
  return (if (n `rem` 2) == 0
          then (n `quot` 2) * (3 * n - 1)
          else ((3 * n - 1) `quot` 2) * n)

hexa n =
  return (n * (2 * n - 1))

findPenta2 n a b =
  if b == a + 1
  then ((((==) n) <$> (penta a)) <||> (((==) n) <$> (penta b)))
  else do let c = (a + b) `quot` 2
          p <- penta c
          if p == n
          then return True
          else if p < n
               then findPenta2 n c b
               else findPenta2 n a c

findHexa2 n a b =
  if b == a + 1
  then ((((==) n) <$> (hexa a)) <||> (((==) n) <$> (hexa b)))
  else do let c = (a + b) `quot` 2
          p <- hexa c
          if p == n
          then return True
          else if p < n
               then findHexa2 n c b
               else findHexa2 n a c

main =
  let d n =
        if n <= 55385
        then do t <- triangle n
                ifM ((findPenta2 t (n `quot` 5) n) <&&> (findHexa2 t (n `quot` 5) ((n `quot` 2) + 10)))
                    (do printf "%d\n%d\n" (n::Int) (t::Int) :: IO()
                        d (n + 1))
                    (d (n + 1))
        else return () in
        d 285




<|start_filename|>out/ocaml01.cpp<|end_filename|>
#include <iostream>
#include <vector>

int foo() {
    for (int i = 0; i < 11; i++)
    {
        
    }
    return 0;
}


int bar() {
    for (int i = 0; i < 11; i++)
        int a = 0;
    return 0;
}

int main() {
    
}



<|start_filename|>out/vigenere.fs<|end_filename|>
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
: read-char current-char next-char ;
: position_alphabet { c }
  c { i }
  i [char] Z <= i [char] A >= AND
  IF
    i [char] A - exit
  ELSE
    i [char] z <= i [char] a >= AND
    IF
      i [char] a - exit
    ELSE
      1 NEGATE exit
    THEN
  THEN
;


: of_position_alphabet { c }
  c [char] a + exit
;


: crypte { taille_cle cle taille message }
  taille 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    message  i cells +  @ position_alphabet { lettre }
    lettre 1 NEGATE <>
    IF
      cle  i taille_cle % cells +  @ position_alphabet { addon }
      addon lettre + 26 % { new0 }
      new0 of_position_alphabet message  i cells +  !
    THEN
   1 + REPEAT 2DROP
;

: main
  read-int { taille_cle }
  skipspaces
  HERE taille_cle cells allot { cle }
  taille_cle 1 - 0 BEGIN 2dup >= WHILE DUP { index }
    read-char { out0 }
    out0 cle  index cells +  !
   1 + REPEAT 2DROP
  skipspaces
  read-int { taille }
  skipspaces
  HERE taille cells allot { message }
  taille 1 - 0 BEGIN 2dup >= WHILE DUP { index2 }
    read-char { out2 }
    out2 message  index2 cells +  !
   1 + REPEAT 2DROP
  taille_cle cle taille message crypte
  taille 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    message  i cells +  @ EMIT
   1 + REPEAT 2DROP
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/sqrttest.go<|end_filename|>
package main
import "fmt"
import "math"

func main() {
  fmt.Printf("%d %d %d %d %d %d ", int(math.Sqrt(float64(4))), int(math.Sqrt(float64(16))), int(math.Sqrt(float64(20))), int(math.Sqrt(float64(1000))), int(math.Sqrt(float64(500))), int(math.Sqrt(float64(10))))
}



<|start_filename|>out/euler52.groovy<|end_filename|>
import java.util.*

int chiffre_sort(int a)
{
  if (a < 10)
      return a
  else
  {
      int b = chiffre_sort(a.intdiv(10))
      int c = a % 10
      int d = b % 10
      int e = b.intdiv(10)
      if (c < d)
          return c + b * 10
      else
          return d + chiffre_sort(c + e * 10) * 10
  }
}
boolean same_numbers(int a, int b, int c, int d, int e, int f)
{
  int ca = chiffre_sort(a)
  return ca == chiffre_sort(b) && ca == chiffre_sort(c) && ca == chiffre_sort(d) && ca == chiffre_sort(e) && ca == chiffre_sort(f)
}

int num = 142857
if (same_numbers(num, num * 2, num * 3, num * 4, num * 6, num * 5))
    System.out.printf("%d %d %d %d %d %d\n", num, num * 2, num * 3, num * 4, num * 5, num * 6)



<|start_filename|>out/aaa_013option.java<|end_filename|>
import java.util.*;

public class aaa_013option
{
  
  static class foo {
    public int a;
    public Integer b;
    public int[] c;
    public Integer[] d;
    public int[] e;
    public foo f;
    public foo[] g;
    public foo[] h;
  }
  static int default0(Integer a, foo b, Integer[] c, foo[] d, int[] e, foo[] f)
  {
    return 0;
  }
  static void aa(foo b)
  {
    
  }
  public static void main(String args[])
  {
    Integer a = null;
    System.out.print("___\n");
  }
  
}



<|start_filename|>out/test_enum.go<|end_filename|>
package main
type foo_t int
const (
  Foo foo_t = iota
  Bar foo_t = iota
  Blah foo_t = iota);
func main() {
  var foo_val foo_t = Foo
  _  = foo_val
}



<|start_filename|>out/carre.cc<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    int y, x;
    std::cin >> x >> y;
    std::vector<std::vector<int> *> *tab = new std::vector<std::vector<int> *>( y );
    for (int d = 0; d < y; d++)
    {
        std::vector<int> *e = new std::vector<int>( x );
        for (int f = 0; f < x; f++)
        {
            std::cin >> e->at(f);
        }
        tab->at(d) = e;
    }
    for (int ix = 1; ix < x; ix++)
        for (int iy = 1; iy < y; iy++)
            if (tab->at(iy)->at(ix) == 1)
                tab->at(iy)->at(ix) = std::min({tab->at(iy)->at(ix - 1), tab->at(iy - 1)->at(ix), tab->at(iy - 1)->at(ix - 1)}) + 1;
    for (int jy = 0; jy < y; jy++)
    {
        for (int jx = 0; jx < x; jx++)
            std::cout << tab->at(jy)->at(jx) << " ";
        std::cout << "\n";
    }
}



<|start_filename|>out/euler19.groovy<|end_filename|>
import java.util.*

boolean is_leap(int year)
{
  return year % 400 == 0 || year % 100 != 0 && year % 4 == 0
}
int ndayinmonth(int month, int year)
{
  if (month == 0)
      return 31
  else if (month == 1)
      if (is_leap(year))
          return 29
      else
          return 28
  else if (month == 2)
      return 31
  else if (month == 3)
      return 30
  else if (month == 4)
      return 31
  else if (month == 5)
      return 30
  else if (month == 6)
      return 31
  else if (month == 7)
      return 31
  else if (month == 8)
      return 30
  else if (month == 9)
      return 31
  else if (month == 10)
      return 30
  else if (month == 11)
      return 31
  return 0
}

int month = 0
int year = 1901
int dayofweek = 1
//  01-01-1901 : mardi 
int count = 0
while (year != 2001)
{
    int ndays = ndayinmonth(month, year)
    dayofweek = (dayofweek + ndays) % 7
    month++
    if (month == 12)
    {
        month = 0
        year++
    }
    if (dayofweek % 7 == 6)
        count++
}
System.out.printf("%d\n", count)



<|start_filename|>out/tuple.lua<|end_filename|>
function f (tuple0)
  a, b = table.unpack(tuple0)
  return table.pack(a + 1, b + 1)
end

local t = f(table.pack(0, 1))
a, b = table.unpack(t)
io.write(string.format("%d -- %d--\n", a, b))


<|start_filename|>out/record3.cpp<|end_filename|>
#include <iostream>
#include <vector>
struct toto {
    int foo;
    int bar;
    int blah;
};


toto mktoto(int v1) {
    toto t;
        t.foo = v1;
        t.bar = 0;
        t.blah = 0;;
    return t;
}


int result(std::vector<toto>& t, int len) {
    int out0 = 0;
    for (int j = 0; j < len; j++)
    {
        t[j].blah++;
        out0 = out0 + t[j].foo + t[j].blah * t[j].bar + t[j].bar * t[j].foo;
    }
    return out0;
}

int main() {
    std::vector<toto> t( 4 );
    for (int i = 0; i < 4; i++)
        t[i] = mktoto(i);
    std::cin >> t[0].bar >> t[1].blah >> std::noskipws;
    int titi = result(t, 4);
    std::cout << titi << t[2].blah;
}



<|start_filename|>out/euler17.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
main =
  do printf "%d\n" ((3 + 3 + 5 + 4 + 4)::Int) :: IO()
     let one_to_nine = 3 + 3 + 5 + 4 + 4 + 3 + 5 + 5 + 4
     printf "%d\n" (one_to_nine::Int) :: IO()
     let one_to_ten = one_to_nine + 3
     let one_to_twenty = one_to_ten + 6 + 6 + 8 + 8 + 7 + 7 + 9 + 8 + 8 + 6
     let one_to_thirty = one_to_twenty + 6 * 9 + one_to_nine + 6
     let one_to_forty = one_to_thirty + 6 * 9 + one_to_nine + 5
     let one_to_fifty = one_to_forty + 5 * 9 + one_to_nine + 5
     let one_to_sixty = one_to_fifty + 5 * 9 + one_to_nine + 5
     let one_to_seventy = one_to_sixty + 5 * 9 + one_to_nine + 7
     let one_to_eighty = one_to_seventy + 7 * 9 + one_to_nine + 6
     let one_to_ninety = one_to_eighty + 6 * 9 + one_to_nine + 6
     let one_to_ninety_nine = one_to_ninety + 6 * 9 + one_to_nine
     printf "%d\n%d\n" (one_to_ninety_nine::Int) ((100 * one_to_nine + one_to_ninety_nine * 10 + 10 * 9 * 99 + 7 * 9 + 3 + 8)::Int) :: IO()




<|start_filename|>out/euler09.lua<|end_filename|>

--[[
	a + b + c = 1000 && a * a + b * b = c * c
	--]]
for a = 1, 1000 do
    for b = a + 1, 1000 do
        local c = 1000 - a - b
        local a2b2 = a * a + b * b
        local cc = c * c
        if cc == a2b2 and c > a then
            io.write(string.format("%d\n%d\n%d\n%d\n", a, b, c, a * b * c))
        end
    end
end


<|start_filename|>out/euler17.cpp<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    std::cout << 3 + 16 << "\n";
    int one_to_nine = 3 + 33;
    std::cout << one_to_nine << "\n";
    int one_to_ten = one_to_nine + 3;
    int one_to_twenty = one_to_ten + 73;
    int one_to_thirty = one_to_twenty + 6 * 9 + one_to_nine + 6;
    int one_to_forty = one_to_thirty + 6 * 9 + one_to_nine + 5;
    int one_to_fifty = one_to_forty + 5 * 9 + one_to_nine + 5;
    int one_to_sixty = one_to_fifty + 5 * 9 + one_to_nine + 5;
    int one_to_seventy = one_to_sixty + 5 * 9 + one_to_nine + 7;
    int one_to_eighty = one_to_seventy + 7 * 9 + one_to_nine + 6;
    int one_to_ninety = one_to_eighty + 6 * 9 + one_to_nine + 6;
    int one_to_ninety_nine = one_to_ninety + 6 * 9 + one_to_nine;
    std::cout << one_to_ninety_nine << "\n" << 100 * one_to_nine + one_to_ninety_nine * 10 + 10 * 9 * 99 + 7 * 9 + 11 << "\n";
}



<|start_filename|>out/str2.groovy<|end_filename|>
import java.util.*



print("ma petite chaine en or")



<|start_filename|>out/euler31.cpp<|end_filename|>
#include <iostream>
#include <vector>

int result(int sum, std::vector<int>& t, int maxIndex, std::vector<std::vector<int>>& cache) {
    if (cache[sum][maxIndex] != 0)
        return cache[sum][maxIndex];
    else if (sum == 0 || maxIndex == 0)
        return 1;
    else
    {
        int out0 = 0;
        int div = sum / t[maxIndex];
        for (int i = 0; i <= div; i++)
            out0 += result(sum - i * t[maxIndex], t, maxIndex - 1, cache);
        cache[sum][maxIndex] = out0;
        return out0;
    }
}

int main() {
    std::vector<int> t( 8, 0 );
    t[0] = 1;
    t[1] = 2;
    t[2] = 5;
    t[3] = 10;
    t[4] = 20;
    t[5] = 50;
    t[6] = 100;
    t[7] = 200;
    std::vector<std::vector<int>> cache( 201 );
    for (int j = 0; j < 201; j++)
    {
        std::vector<int> o( 8, 0 );
        cache[j] = o;
    }
    std::cout << result(200, t, 7, cache);
}



<|start_filename|>out/aaa_integer.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: main
  0 { i }
  i 1 - TO i
  i s>d 0 d.r
  S\" \n" TYPE
  i 55 + TO i
  i s>d 0 d.r
  S\" \n" TYPE
  i 13 * TO i
  i s>d 0 d.r
  S\" \n" TYPE
  i 2 // TO i
  i s>d 0 d.r
  S\" \n" TYPE
  i 1 + TO i
  i s>d 0 d.r
  S\" \n" TYPE
  i 3 // TO i
  i s>d 0 d.r
  S\" \n" TYPE
  i 1 - TO i
  i s>d 0 d.r
  S\" \n" TYPE
  \ 
  \ http://fr.wikipedia.org/wiki/Modulo_(op%C3%A9ration)#Trois_d.C3.A9finitions_de_la_fonction_modulo
  \ 
  
  117 17 // s>d 0 d.r
  S\" \n" TYPE
  117 17 NEGATE // s>d 0 d.r
  S\" \n" TYPE
  117 NEGATE 17 // s>d 0 d.r
  S\" \n" TYPE
  117 NEGATE 17 NEGATE // s>d 0 d.r
  S\" \n" TYPE
  117 17 % s>d 0 d.r
  S\" \n" TYPE
  117 17 NEGATE % s>d 0 d.r
  S\" \n" TYPE
  117 NEGATE 17 % s>d 0 d.r
  S\" \n" TYPE
  117 NEGATE 17 NEGATE % s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/test_instant.lua<|end_filename|>
function foo (a, b)
  return a + b
end

io.write(10)


<|start_filename|>out/aaa_013option.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
data Foo = Foo {
                  _a :: IORef Int,
                  _b :: IORef (Maybe Int),
                  _c :: IORef (Maybe (IOArray Int Int)),
                  _d :: IORef (IOArray Int (Maybe Int)),
                  _e :: IORef (IOArray Int Int),
                  _f :: IORef (Maybe Foo),
                  _g :: IORef (IOArray Int (Maybe Foo)),
                  _h :: IORef (Maybe (IOArray Int Foo))
                  }
  deriving Eq


default0 a b c d e f =
  return 0

aa b =
  return ()

main =
  printf "___\n" :: IO ()




<|start_filename|>out/pathfinding0.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class pathfinding0
{
  static int pathfind_aux(int[][] cache, char[][] tab, int x, int y, int posX, int posY)
  {
    if (posX == x - 1 && posY == y - 1)
        return 0;
    else if (posX < 0 || posY < 0 || posX >= x || posY >= y)
        return x * y * 10;
    else if (tab[posY][posX] == (char)35)
        return x * y * 10;
    else if (cache[posY][posX] != -1)
        return cache[posY][posX];
    else
    {
        cache[posY][posX] = x * y * 10;
        int val1 = pathfind_aux(cache, tab, x, y, posX + 1, posY);
        int val2 = pathfind_aux(cache, tab, x, y, posX - 1, posY);
        int val3 = pathfind_aux(cache, tab, x, y, posX, posY - 1);
        int val4 = pathfind_aux(cache, tab, x, y, posX, posY + 1);
        int out0 = 1 + Math.Min(Math.Min(Math.Min(val1, val2), val3), val4);
        cache[posY][posX] = out0;
        return out0;
    }
  }
  
  static int pathfind(char[][] tab, int x, int y)
  {
    int[][] cache = new int[y][];
    for (int i = 0; i < y; i++)
    {
        int[] tmp = new int[x];
        for (int j = 0; j < x; j++)
        {
            Console.Write(tab[i][j]);
            tmp[j] = -1;
        }
        Console.Write("\n");
        cache[i] = tmp;
    }
    return pathfind_aux(cache, tab, x, y, 0, 0);
  }
  
  public static void Main(String[] args)
  {
    int x = int.Parse(Console.ReadLine());
    int y = int.Parse(Console.ReadLine());
    Console.Write(x + " " + y + "\n");
    char[][] e = new char[y][];
    for (int f = 0; f < y; f++)
        e[f] = Console.ReadLine().ToCharArray();
    char[][] tab = e;
    int result = pathfind(tab, x, y);
    Console.Write(result);
  }
  
}



<|start_filename|>out/euler27.cpp<|end_filename|>
#include <iostream>
#include <vector>

int eratostene(std::vector<int>& t, int max0) {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            int j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
}


bool isPrime(int n, std::vector<int>& primes, int len) {
    int i = 0;
    if (n < 0)
        n = -n;
    while (primes[i] * primes[i] < n)
    {
        if (n % primes[i] == 0)
            return false;
        i++;
    }
    return true;
}


int test(int a, int b, std::vector<int>& primes, int len) {
    for (int n = 0; n < 201; n++)
    {
        int j = n * n + a * n + b;
        if (!isPrime(j, primes, len))
            return n;
    }
    return 200;
}

int main() {
    int maximumprimes = 1000;
    std::vector<int> era( maximumprimes );
    for (int j = 0; j < maximumprimes; j++)
        era[j] = j;
    int result = 0;
    int max0 = 0;
    int nprimes = eratostene(era, maximumprimes);
    std::vector<int> primes( nprimes, 0 );
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    std::cout << l << " == " << nprimes << "\n";
    int ma = 0;
    int mb = 0;
    for (int b = 3; b < 1000; b++)
        if (era[b] == b)
            for (int a = -999; a < 1000; a++)
            {
                int n1 = test(a, b, primes, nprimes);
                int n2 = test(a, -b, primes, nprimes);
                if (n1 > max0)
                {
                    max0 = n1;
                    result = a * b;
                    ma = a;
                    mb = b;
                }
                if (n2 > max0)
                {
                    max0 = n2;
                    result = -a * b;
                    ma = a;
                    mb = -b;
                }
            }
    std::cout << ma << " " << mb << "\n" << max0 << "\n" << result << "\n";
}



<|start_filename|>out/aaa_04loop.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int h(int i) {
    /*  for j = i - 2 to i + 2 do
    if i % j == 5 then return true end
  end */
    int j = i - 2;
    while (j <= i + 2)
    {
        if (i % j == 5)
            return 1;
        j++;
    }
    return 0;
}
int main(void) {
    int k;
    int j = 0;
    for (k = 0; k < 11; k++)
    {
        j += k;
        printf("%d\n", j);
    }
    int i = 4;
    while (i < 10)
    {
        printf("%d", i);
        i++;
        j += i;
    }
    printf("%d%dFIN TEST\n", j, i);
    return 0;
}




<|start_filename|>out/euler24.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int fact(int n) {
    int i;
    int prod = 1;
    for (i = 2; i <= n; i++)
        prod *= i;
    return prod;
}

void show(int lim, int nth) {
    int m, k, l, j, i;
    int *t = calloc(lim, sizeof(int));
    for (i = 0; i < lim; i++)
        t[i] = i;
    int *pris = calloc(lim, sizeof(int));
    for (j = 0; j < lim; j++)
        pris[j] = 0;
    for (k = 1; k < lim; k++)
    {
        int n = fact(lim - k);
        int nchiffre = nth / n;
        nth = nth % n;
        for (l = 0; l < lim; l++)
            if (!pris[l])
            {
                if (nchiffre == 0)
                {
                    printf("%d", l);
                    pris[l] = 1;
                }
                nchiffre--;
            }
    }
    for (m = 0; m < lim; m++)
        if (!pris[m])
            printf("%d", m);
    printf("\n");
}
int main(void) {
    show(10, 999999);
    return 0;
}




<|start_filename|>out/euler28.cpp<|end_filename|>
#include <iostream>
#include <vector>
/*

43 44 45 46 47 48 49
42 21 22 23 24 25 26
41 20  7  8  9 10 27
40 19  6  1  2 11 28
39 18  5  4  3 12 29
38 17 16 15 14 13 30
37 36 35 34 33 32 31

1 3 5 7 9 13 17 21 25 31 37 43 49
  2 2 2 2 4  4  4  4  6   6  6  6


*/

int sumdiag(int n) {
    int nterms = n * 2 - 1;
    int un = 1;
    int sum = 1;
    for (int i = 0; i < nterms - 1; i++)
    {
        int d = 2 * (1 + i / 4);
        un += d;
        //  print int d print "=>" print un print " " 
        sum += un;
    }
    return sum;
}

int main() {
    std::cout << sumdiag(1001);
}



<|start_filename|>out/euler31.cc<|end_filename|>
#include <iostream>
#include <vector>

int result(int sum, std::vector<int> * t, int maxIndex, std::vector<std::vector<int> *> * cache) {
    if (cache->at(sum)->at(maxIndex) != 0)
        return cache->at(sum)->at(maxIndex);
    else if (sum == 0 || maxIndex == 0)
        return 1;
    else
    {
        int out0 = 0;
        int div = sum / t->at(maxIndex);
        for (int i = 0; i <= div; i++)
            out0 += result(sum - i * t->at(maxIndex), t, maxIndex - 1, cache);
        cache->at(sum)->at(maxIndex) = out0;
        return out0;
    }
}

int main() {
    std::vector<int> *t = new std::vector<int>( 8 );
    std::fill(t->begin(), t->end(), 0);
    t->at(0) = 1;
    t->at(1) = 2;
    t->at(2) = 5;
    t->at(3) = 10;
    t->at(4) = 20;
    t->at(5) = 50;
    t->at(6) = 100;
    t->at(7) = 200;
    std::vector<std::vector<int> *> *cache = new std::vector<std::vector<int> *>( 201 );
    for (int j = 0; j < 201; j++)
    {
        std::vector<int> *o = new std::vector<int>( 8 );
        std::fill(o->begin(), o->end(), 0);
        cache->at(j) = o;
    }
    std::cout << result(200, t, 7, cache);
}



<|start_filename|>out/euler12.cc<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

int eratostene(std::vector<int> * t, int max0) {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t->at(i) == i)
        {
            int j = i * i;
            n++;
            while (j < max0 && j > 0)
            {
                t->at(j) = 0;
                j += i;
            }
        }
    return n;
}


int fillPrimesFactors(std::vector<int> * t, int n, std::vector<int> * primes, int nprimes) {
    for (int i = 0; i < nprimes; i++)
    {
        int d = primes->at(i);
        while (n % d == 0)
        {
            t->at(d)++;
            n /= d;
        }
        if (n == 1)
            return primes->at(i);
    }
    return n;
}


int find(int ndiv2) {
    int maximumprimes = 110;
    std::vector<int> *era = new std::vector<int>( maximumprimes );
    for (int j = 0; j < maximumprimes; j++)
        era->at(j) = j;
    int nprimes = eratostene(era, maximumprimes);
    std::vector<int> *primes = new std::vector<int>( nprimes );
    std::fill(primes->begin(), primes->end(), 0);
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era->at(k) == k)
        {
            primes->at(l) = k;
            l++;
        }
    for (int n = 1; n < 10001; n++)
    {
        std::vector<int> *primesFactors = new std::vector<int>( n + 2 );
        std::fill(primesFactors->begin(), primesFactors->end(), 0);
        int max0 = std::max(fillPrimesFactors(primesFactors, n, primes, nprimes), fillPrimesFactors(primesFactors, n + 1, primes, nprimes));
        primesFactors->at(2)--;
        int ndivs = 1;
        for (int i = 0; i <= max0; i++)
            if (primesFactors->at(i) != 0)
                ndivs *= 1 + primesFactors->at(i);
        if (ndivs > ndiv2)
            return n * (n + 1) / 2;
        //  print "n=" print n print "\t" print (n * (n + 1) / 2 ) print " " print ndivs print "\n" 
    }
    return 0;
}

int main() {
    std::cout << find(500) << "\n";
}



<|start_filename|>out/euler21.groovy<|end_filename|>
import java.util.*

int eratostene(int[] t, int max0)
{
  int n = 0
  for (int i = 2; i < max0; i++)
      if (t[i] == i)
      {
          n++
          int j = i * i
          while (j < max0 && j > 0)
          {
              t[j] = 0
              j += i
          }
      }
  return n
}
int fillPrimesFactors(int[] t, int n, int[] primes, int nprimes)
{
  for (int i = 0; i < nprimes; i++)
  {
      int d = primes[i]
      while (n % d == 0)
      {
          t[d]++
          n /= d
      }
      if (n == 1)
          return primes[i]
  }
  return n
}
int sumdivaux2(int[] t, int n, int i)
{
  while (i < n && t[i] == 0)
      i++
  return i
}
int sumdivaux(int[] t, int n, int i)
{
  if (i > n)
      return 1
  else if (t[i] == 0)
      return sumdivaux(t, n, sumdivaux2(t, n, i + 1))
  else
  {
      int o = sumdivaux(t, n, sumdivaux2(t, n, i + 1))
      int out0 = 0
      int p = i
      for (int j = 1; j <= t[i]; j++)
      {
          out0 += p
          p *= i
      }
      return (out0 + 1) * o
  }
}
int sumdiv(int nprimes, int[] primes, int n)
{
  int[] t = new int[n + 1]
  for (int i = 0; i <= n; i++)
      t[i] = 0
  int max0 = fillPrimesFactors(t, n, primes, nprimes)
  return sumdivaux(t, max0, 0)
}

int maximumprimes = 1001
int[] era = new int[maximumprimes]
for (int j = 0; j < maximumprimes; j++)
    era[j] = j
int nprimes = eratostene(era, maximumprimes)
int[] primes = new int[nprimes]
for (int o = 0; o < nprimes; o++)
    primes[o] = 0
int l = 0
for (int k = 2; k < maximumprimes; k++)
    if (era[k] == k)
    {
        primes[l] = k
        l++
    }
System.out.printf("%d == %d\n", l, nprimes)
int sum = 0
for (int n = 2; n < 1001; n++)
{
    int other = sumdiv(nprimes, primes, n) - n
    if (other > n)
    {
        int othersum = sumdiv(nprimes, primes, other) - other
        if (othersum == n)
        {
            System.out.printf("%d & %d\n", other, n)
            sum += other + n
        }
    }
}
System.out.printf("\n%d\n", sum)



<|start_filename|>out/small_inline.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*


@Field Scanner scanner = new Scanner(System.in)
int[] t = new int[2]
for (int d = 0; d < 2; d++)
{
    if (scanner.hasNext("^-")) {
      scanner.next("^-")
      t[d] = -scanner.nextInt()
    }else{
      t[d] = scanner.nextInt()
    }
    scanner.findWithinHorizon("[\n\r ]*", 1)
}
System.out.printf("%d - %d\n", t[0], t[1])



<|start_filename|>out/aaa_read1.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function read_char_(){
    if (current_char == null) current_char = read_char0();
    var out = current_char;
    current_char = read_char0();
    return out;
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
var str = new Array(12);
for (var a = 0; a < 12; a++)
{
    str[a] = read_char_();
}
stdinsep();
for (var i = 0; i < 12; i++)
    util.print(str[i]);



<|start_filename|>out/euler40.groovy<|end_filename|>
import java.util.*

int exp0(int a, int e)
{
  int o = 1
  for (int i = 1; i <= e; i++)
      o *= a
  return o
}
int e(int[] t, int n)
{
  for (int i = 1; i < 9; i++)
      if (n >= t[i] * i)
          n -= t[i] * i
      else
      {
          int nombre = exp0(10, i - 1) + n.intdiv(i)
          int chiffre = i - 1 - n % i
          return nombre.intdiv(exp0(10, chiffre)) % 10
      }
  return -1
}

int[] t = new int[9]
for (int i = 0; i < 9; i++)
    t[i] = exp0(10, i) - exp0(10, i - 1)
for (int i2 = 1; i2 < 9; i2++)
    System.out.printf("%d => %d\n", i2, t[i2])
for (int j = 0; j < 81; j++)
    print(e(t, j))
print("\n")
for (int k = 1; k < 51; k++)
    print(k)
print("\n")
for (int j2 = 169; j2 < 221; j2++)
    print(e(t, j2))
print("\n")
for (int k2 = 90; k2 < 111; k2++)
    print(k2)
print("\n")
int out0 = 1
for (int l = 0; l < 7; l++)
{
    int puiss = exp0(10, l)
    int v = e(t, puiss - 1)
    out0 *= v
    System.out.printf("10^%d=%d v=%d\n", l, puiss, v)
}
System.out.printf("%d\n", out0)



<|start_filename|>out/euler28.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
--[[

43 44 45 46 47 48 49
42 21 22 23 24 25 26
41 20  7  8  9 10 27
40 19  6  1  2 11 28
39 18  5  4  3 12 29
38 17 16 15 14 13 30
37 36 35 34 33 32 31

1 3 5 7 9 13 17 21 25 31 37 43 49
  2 2 2 2 4  4  4  4  6   6  6  6


--]]

function sumdiag (n)
  local nterms = n * 2 - 1
  local un = 1
  local sum = 1
  for i = 0, nterms - 2 do
      local d = 2 * (1 + trunc(i / 4))
      un = un + d
      --[[ print int d print "=>" print un print " " --]]
      sum = sum + un
  end
  return sum
end

io.write(sumdiag(1001))


<|start_filename|>out/calc.lua<|end_filename|>
--[[
La suite de fibonaci
--]]

function fibo (a, b, i)
  local out_ = 0
  local a2 = a
  local b2 = b
  for j = 0, i + 1 do
      io.write(j)
      out_ = out_ + a2
      local tmp = b2
      b2 = b2 + a2
      a2 = tmp
  end
  return out_
end

io.write(fibo(1, 2, 4))


<|start_filename|>out/euler01.go<|end_filename|>
package main
import "fmt"

func main() {
  sum := 0
  for i := 0; i < 1000; i++ {
      if i % 3 == 0 || i % 5 == 0 {
          sum += i
      }
  }
  fmt.Printf("%d\n", sum)
}



<|start_filename|>out/aaa_08tuple.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
data Toto = Toto {
                    _foo :: IORef (Int, Int),
                    _bar :: IORef Int
                    }
  deriving Eq


main =
  do bar_ <- (fmap read getLine)
     t <- (Toto <$> (( (fmap read . head . reads) <$> getLine :: IO (Int, Int)) >>= newIORef) <*> (newIORef bar_))
     (readIORef (_foo t)) >>= (\ (a, b) ->
                                printf "%d %d %d\n" (a::Int) (b::Int) =<< ((readIORef (_bar t))::IO Int))




<|start_filename|>out/cambriolage.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
nbPassePartout n passepartout m serrures =
  let c i d e =
        if i <= m - 1
        then do r <- ifM ((((==) (- 1)) <$> (join $ readIOA <$> (readIOA serrures i) <*> return 0)) <&&> (((<) d) <$> (join $ readIOA <$> (readIOA serrures i) <*> return 1)))
                         (join $ readIOA <$> (readIOA serrures i) <*> return 1)
                         (return d)
                ifM ((((==) 1) <$> (join $ readIOA <$> (readIOA serrures i) <*> return 0)) <&&> (((<) e) <$> (join $ readIOA <$> (readIOA serrures i) <*> return 1)))
                    (do s <- join $ readIOA <$> (readIOA serrures i) <*> return 1
                        c (i + 1) r s)
                    (c (i + 1) r e)
        else let f g h o =
                   if g <= n - 1
                   then do pp <- readIOA passepartout g
                           ifM ((((<=) d) <$> (readIOA pp 0)) <&&> (((<=) e) <$> (readIOA pp 1)))
                               (return 1)
                               (do p <- ((max <$> (return h) <*> (readIOA pp 0)))
                                   q <- ((max <$> (return o) <*> (readIOA pp 1)))
                                   f (g + 1) p q)
                   else return (if h >= d && o >= e
                                then 2
                                else 0) in
                   f 0 0 0 in
        c 0 0 0

main =
  do n <- read_int
     skip_whitespaces
     passepartout <- array_init n (\ i ->
                                     array_init 2 (\ j ->
                                                     do out01 <- read_int
                                                        skip_whitespaces
                                                        return out01))
     m <- read_int
     skip_whitespaces
     serrures <- array_init m (\ k ->
                                 array_init 2 (\ l ->
                                                 do out_ <- read_int
                                                    skip_whitespaces
                                                    return out_))
     printf "%d" =<< (nbPassePartout n passepartout m serrures :: IO Int)




<|start_filename|>out/euler15.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler15 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
type b is Array (Integer range <>) of a_PTR;
type b_PTR is access b;

  tab2 : a_PTR;
  tab : b_PTR;
  r : Integer;
  q : Integer;
  n : Integer;
begin
  n := 10;
  -- normalement on doit mettre 20 mais là on se tape un overflow 
  
  n := n + 1;
  tab := new b (0..n - 1);
  for i in integer range 0..n - 1 loop
    tab2 := new a (0..n - 1);
    for j in integer range 0..n - 1 loop
      tab2(j) := 0;
    end loop;
    tab(i) := tab2;
  end loop;
  for l in integer range 0..n - 1 loop
    tab(n - 1)(l) := 1;
    tab(l)(n - 1) := 1;
  end loop;
  for o in integer range 2..n loop
    r := n - o;
    for p in integer range 2..n loop
      q := n - p;
      tab(r)(q) := tab(r + 1)(q) + tab(r)(q + 1);
    end loop;
  end loop;
  for m in integer range 0..n - 1 loop
    for k in integer range 0..n - 1 loop
      PInt(tab(m)(k));
      PString(new char_array'( To_C(" ")));
    end loop;
    PString(new char_array'( To_C("" & Character'Val(10))));
  end loop;
  PInt(tab(0)(0));
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/aaa_read2.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

  int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

/*
Ce test permet de vérifier si les différents backends pour les langages implémentent bien
read int, read char et skip
*/
@Field Scanner scanner = new Scanner(System.in)
int len = Integer.parseInt(scanner.nextLine())
System.out.printf("%d=len\n", len)
int[] tab = read_int_line()
for (int i = 0; i < len; i++)
    System.out.printf("%d=>%d ", i, tab[i])
print("\n")
int[] tab2 = read_int_line()
for (int i_ = 0; i_ < len; i_++)
    System.out.printf("%d==>%d ", i_, tab2[i_])
int strlen = Integer.parseInt(scanner.nextLine())
System.out.printf("%d=strlen\n", strlen)
char[] tab4 = scanner.nextLine().toCharArray()
for (int i3 = 0; i3 < strlen; i3++)
{
    char tmpc = tab4[i3]
    int c = (0+tmpc)
    System.out.printf("%c:%d ", tmpc, c)
    if (tmpc != (char)' ')
        c = (c - (0+(char)'a') + 13) % 26 + (0+(char)'a')
    tab4[i3] = (char)(c)
}
for (int j = 0; j < strlen; j++)
    print(tab4[j])



<|start_filename|>out/prologin_template_charline.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int programme_candidat(char* tableau, int taille) {
    int i;
    int out0 = 0;
    for (i = 0; i < taille; i++)
    {
        out0 += (int)(tableau[i]) * i;
        printf("%c", tableau[i]);
    }
    printf("--\n");
    return out0;
}
int main(void) {
    int a, taille;
    scanf("%d ", &taille);
    char *tableau = calloc(taille, sizeof(char));
    for (a = 0; a < taille; a++)
        scanf("%c", &tableau[a]);
    scanf(" ");
    printf("%d\n", programme_candidat(tableau, taille));
    return 0;
}




<|start_filename|>out/sumDiv.cs<|end_filename|>
using System;

public class sumDiv
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static int readInt(){
  int i = 0;
  char s = readChar_();
  int sign = 1;
  if (s == '-'){
    sign = -1;
    consommeChar();
  }
  do{
    char c = readChar_();
    if (c <= '9' && c >= '0'){
      i = i * 10 + c - '0';
      consommeChar();
    }else{
      return i * sign;
    }
  } while(true);
} 
  static void foo()
  {
    int a = 0;
    //  test 
    a++;
    //  test 2 
  }
  
  static void foo2()
  {
    
  }
  
  static void foo3()
  {
    if (1 == 1)
    {
        
    }
  }
  
  static int sumdiv(int n)
  {
    //  On désire renvoyer la somme des diviseurs 
    int out0 = 0;
    //  On déclare un entier qui contiendra la somme 
    for (int i = 1; i <= n; i++)
        //  La boucle : i est le diviseur potentiel
        if (n % i == 0)
        {
            //  Si i divise 
            out0 += i;
            //  On incrémente 
        }
        else
        {
            //  nop 
        }
    return out0;
    // On renvoie out
  }
  
  public static void Main(String[] args)
  {
    //  Programme principal 
    int n = 0;
    n = readInt();
    //  Lecture de l'entier 
    Console.Write(sumdiv(n));
  }
  
}



<|start_filename|>out/sort.java<|end_filename|>
import java.util.*;

public class sort
{
  static Scanner scanner = new Scanner(System.in);
  static int[] copytab(int[] tab, int len)
  {
    int[] o = new int[len];
    for (int i = 0; i < len; i++)
        o[i] = tab[i];
    return o;
  }
  static void bubblesort(int[] tab, int len)
  {
    for (int i = 0; i < len; i++)
        for (int j = i + 1; j < len; j++)
            if (tab[i] > tab[j])
            {
                int tmp = tab[i];
                tab[i] = tab[j];
                tab[j] = tmp;
            }
  }
  static void qsort0(int[] tab, int len, int i, int j)
  {
    if (i < j)
    {
        int i0 = i;
        int j0 = j;
        //  pivot : tab[0] 
        while (i != j)
            if (tab[i] > tab[j])
                if (i == j - 1)
                {
                    //  on inverse simplement
                    int tmp = tab[i];
                    tab[i] = tab[j];
                    tab[j] = tmp;
                    i++;
                }
                else
                {
                    //  on place tab[i+1] à la place de tab[j], tab[j] à la place de tab[i] et tab[i] à la place de tab[i+1] 
                    int tmp = tab[i];
                    tab[i] = tab[j];
                    tab[j] = tab[i + 1];
                    tab[i + 1] = tmp;
                    i++;
                }
            else
                j--;
        qsort0(tab, len, i0, i - 1);
        qsort0(tab, len, i + 1, j0);
    }
  }
  public static void main(String args[])
  {
    int len = 2;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      len = -scanner.nextInt();
    }else{
      len = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int[] tab = new int[len];
    for (int i_ = 0; i_ < len; i_++)
    {
        int tmp = 0;
        if (scanner.hasNext("^-")) {
          scanner.next("^-");
          tmp = -scanner.nextInt();
        }else{
          tmp = scanner.nextInt();
        }
        scanner.findWithinHorizon("[\n\r ]*", 1);
        tab[i_] = tmp;
    }
    int[] tab2 = copytab(tab, len);
    bubblesort(tab2, len);
    for (int i = 0; i < len; i++)
        System.out.printf("%d ", tab2[i]);
    System.out.print("\n");
    int[] tab3 = copytab(tab, len);
    qsort0(tab3, len, 0, len - 1);
    for (int i = 0; i < len; i++)
        System.out.printf("%d ", tab3[i]);
    System.out.print("\n");
  }
  
}



<|start_filename|>out/record3.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

typedef struct toto {
  int foo;
    int bar;
    int blah;
} toto;

struct toto * mktoto(int v1) {
    struct toto * t = malloc(sizeof(toto));
    t->foo = v1;
    t->bar = 0;
    t->blah = 0;
    return t;
}

int result(struct toto ** t, int len) {
    int j;
    int out0 = 0;
    for (j = 0; j < len; j++)
    {
        t[j]->blah++;
        out0 = out0 + t[j]->foo + t[j]->blah * t[j]->bar + t[j]->bar * t[j]->foo;
    }
    return out0;
}
int main(void) {
    int i;
    struct toto * *t = calloc(4, sizeof(struct toto *));
    for (i = 0; i < 4; i++)
        t[i] = mktoto(i);
    scanf("%d %d", &t[0]->bar, &t[1]->blah);
    int titi = result(t, 4);
    printf("%d%d", titi, t[2]->blah);
    return 0;
}




<|start_filename|>out/vigenere.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end
function readchar()
    if buffer == "" then buffer = io.read("*line") end
    local c = string.byte(buffer)
    buffer = string.sub(buffer, 2, -1)
    return c
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function position_alphabet (c)
  local i = c
  if i <= 90 and i >= 65 then
      return i - 65
  elseif i <= 122 and i >= 97 then
      return i - 97
  else 
      return -1
  end
end

function of_position_alphabet (c)
  return c + 97
end

function crypte (taille_cle, cle, taille, message)
  for i = 0, taille - 1 do
      local lettre = position_alphabet(message[i + 1])
      if lettre ~= -1 then
          local addon = position_alphabet(cle[math.fmod(i, taille_cle) + 1])
          local new0 = math.fmod(addon + lettre, 26)
          message[i + 1] = of_position_alphabet(new0)
      end
  end
end

local taille_cle = readint()
stdinsep()
local cle = {}
for index = 0, taille_cle - 1 do
    local out0 = readchar()
    cle[index + 1] = out0
end
stdinsep()
local taille = readint()
stdinsep()
local message = {}
for index2 = 0, taille - 1 do
    local out2 = readchar()
    message[index2 + 1] = out2
end
crypte(taille_cle, cle, taille, message)
for i = 0, taille - 1 do
    io.write(string.format("%c", message[i + 1]))
end
io.write("\n")


<|start_filename|>out/aaa_08tuple.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

  int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

class Tuple_int_int {
  int tuple_int_int_field_0
  int tuple_int_int_field_1
}
class Toto {
  Tuple_int_int foo
  int bar
}
@Field Scanner scanner = new Scanner(System.in)
int bar_ = Integer.parseInt(scanner.nextLine())
int[] c = read_int_line()
Tuple_int_int d = new Tuple_int_int()
d.tuple_int_int_field_0 = c[0]
d.tuple_int_int_field_1 = c[1]
Toto t = new Toto()
t.foo = d
t.bar = bar_
Tuple_int_int e = t.foo
int a = e.tuple_int_int_field_0
int b = e.tuple_int_int_field_1
System.out.printf("%d %d %d\n", a, b, t.bar)



<|start_filename|>out/aaa_read2.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray

main :: IO ()
main =
  do len <- (fmap read getLine)
     printf "%d=len\n" (len::Int) :: IO()
     tab <- (join (newListArray . (,) 0 . subtract 1 <$> return len <*> fmap (map read . words) getLine))
     let a i =
           if i <= len - 1
           then do printf "%d=>%d " (i::Int) =<< ((readIOA tab i)::IO Int)
                   a (i + 1)
           else do printf "\n" :: IO ()
                   tab2 <- (join (newListArray . (,) 0 . subtract 1 <$> return len <*> fmap (map read . words) getLine))
                   let b i_ =
                         if i_ <= len - 1
                         then do printf "%d==>%d " (i_::Int) =<< ((readIOA tab2 i_)::IO Int)
                                 b (i_ + 1)
                         else do strlen <- (fmap read getLine)
                                 printf "%d=strlen\n" (strlen::Int) :: IO()
                                 tab4 <- (join (newListArray <$> (fmap (\x -> (0, x-1)) (return strlen)) <*> getLine))
                                 let d i3 =
                                       if i3 <= strlen - 1
                                       then do tmpc <- readIOA tab4 i3
                                               let c = (ord tmpc)
                                               printf "%c:%d " (tmpc::Char) (c::Int) :: IO()
                                               let f = if tmpc /= ' '
                                                       then ((c - (ord 'a') + 13) `rem` 26) + (ord 'a')
                                                       else c
                                               writeIOA tab4 i3 (chr f)
                                               d (i3 + 1)
                                       else let e j =
                                                  if j <= strlen - 1
                                                  then do printf "%c" =<< (readIOA tab4 j :: IO Char)
                                                          e (j + 1)
                                                  else return () in
                                                  e 0 in
                                       d 0 in
                         b 0 in
           a 0




<|start_filename|>out/devine.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func devine0(nombre int, tab []int, len int) bool{
  min0 := tab[0]
  max0 := tab[1]
  for i := 2; i < len; i++ {
      if tab[i] > max0 || tab[i] < min0 {
          return false
      }
      if tab[i] < nombre {
          min0 = tab[i]
      }
      if tab[i] > nombre {
          max0 = tab[i]
      }
      if tab[i] == nombre && len != i + 1 {
          return false
      }
  }
  return true
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var len int
  var nombre int
  fmt.Fscanf(reader, "%d", &nombre)
  skip()
  fmt.Fscanf(reader, "%d", &len)
  skip()
  var tab []int = make([]int, len)
  for i := 0; i < len; i++ {
      var tmp int
      fmt.Fscanf(reader, "%d", &tmp)
      skip()
      tab[i] = tmp
  }
  if devine0(nombre, tab, len) {
      fmt.Printf("True")
  } else {
      fmt.Printf("False")
  }
}



<|start_filename|>out/euler23.java<|end_filename|>
import java.util.*;

public class euler23
{
  
  static int eratostene(int[] t, int max0)
  {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            int j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
  }
  static int fillPrimesFactors(int[] t, int n, int[] primes, int nprimes)
  {
    for (int i = 0; i < nprimes; i++)
    {
        int d = primes[i];
        while (n % d == 0)
        {
            t[d]++;
            n /= d;
        }
        if (n == 1)
            return primes[i];
    }
    return n;
  }
  static int sumdivaux2(int[] t, int n, int i)
  {
    while (i < n && t[i] == 0)
        i++;
    return i;
  }
  static int sumdivaux(int[] t, int n, int i)
  {
    if (i > n)
        return 1;
    else if (t[i] == 0)
        return sumdivaux(t, n, sumdivaux2(t, n, i + 1));
    else
    {
        int o = sumdivaux(t, n, sumdivaux2(t, n, i + 1));
        int out0 = 0;
        int p = i;
        for (int j = 1; j <= t[i]; j++)
        {
            out0 += p;
            p *= i;
        }
        return (out0 + 1) * o;
    }
  }
  static int sumdiv(int nprimes, int[] primes, int n)
  {
    int[] t = new int[n + 1];
    for (int i = 0; i <= n; i++)
        t[i] = 0;
    int max0 = fillPrimesFactors(t, n, primes, nprimes);
    return sumdivaux(t, max0, 0);
  }
  public static void main(String args[])
  {
    int maximumprimes = 30001;
    int[] era = new int[maximumprimes];
    for (int s = 0; s < maximumprimes; s++)
        era[s] = s;
    int nprimes = eratostene(era, maximumprimes);
    int[] primes = new int[nprimes];
    for (int t = 0; t < nprimes; t++)
        primes[t] = 0;
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    int n = 100;
    //  28124 ça prend trop de temps mais on arrive a passer le test 
    boolean[] abondant = new boolean[n + 1];
    for (int p = 0; p <= n; p++)
        abondant[p] = false;
    boolean[] summable = new boolean[n + 1];
    for (int q = 0; q <= n; q++)
        summable[q] = false;
    int sum = 0;
    for (int r = 2; r <= n; r++)
    {
        int other = sumdiv(nprimes, primes, r) - r;
        if (other > r)
            abondant[r] = true;
    }
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            if (abondant[i] && abondant[j] && i + j <= n)
                summable[i + j] = true;
    for (int o = 1; o <= n; o++)
        if (!summable[o])
            sum += o;
    System.out.printf("\n%d\n", sum);
  }
  
}



<|start_filename|>out/aaa_02if.groovy<|end_filename|>
import java.util.*

boolean f(int i)
{
  if (i == 0)
      return true
  return false
}

if (f(4))
    print("true <-\n ->\n")
else
    print("false <-\n ->\n")
print("small test end\n")



<|start_filename|>out/aaa_12strings.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_12strings is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;


begin
  PString(new char_array'( To_C("tada " & Character'Val(39) & " " & Character'Val(34) & " " & Character'Val(10) & Character'Val(13) & Character'Val(9) & " " & Character'Val(36) & " & todo" & Character'Val(10) & Character'Val(10) & "{foo} " & Character'Val(92) & Character'Val(36) & "{blah}" & Character'Val(10) & "blah" & Character'Val(10))));
end;


<|start_filename|>out/aaa_11arrayconst.go<|end_filename|>
package main
import "fmt"
func test(tab []int, len int) {
  for i := 0; i < len; i++ {
      fmt.Printf("%d ", tab[i])
  }
  fmt.Printf("\n")
}
func main() {
  var t []int = make([]int, 5)
  for i := 0; i < 5; i++ {
      t[i] = 1
  }
  test(t, 5)
}



<|start_filename|>out/euler45.cs<|end_filename|>
using System;

public class euler45
{
  static int triangle(int n)
  {
    if (n % 2 == 0)
        return (n / 2) * (n + 1);
    else
        return n * ((n + 1) / 2);
  }
  
  static int penta(int n)
  {
    if (n % 2 == 0)
        return (n / 2) * (3 * n - 1);
    else
        return ((3 * n - 1) / 2) * n;
  }
  
  static int hexa(int n)
  {
    return n * (2 * n - 1);
  }
  
  static bool findPenta2(int n, int a, int b)
  {
    if (b == a + 1)
        return penta(a) == n || penta(b) == n;
    int c = (a + b) / 2;
    int p = penta(c);
    if (p == n)
        return true;
    else if (p < n)
        return findPenta2(n, c, b);
    else
        return findPenta2(n, a, c);
  }
  
  static bool findHexa2(int n, int a, int b)
  {
    if (b == a + 1)
        return hexa(a) == n || hexa(b) == n;
    int c = (a + b) / 2;
    int p = hexa(c);
    if (p == n)
        return true;
    else if (p < n)
        return findHexa2(n, c, b);
    else
        return findHexa2(n, a, c);
  }
  
  public static void Main(String[] args)
  {
    for (int n = 285; n < 55386; n++)
    {
        int t = triangle(n);
        if (findPenta2(t, n / 5, n) && findHexa2(t, n / 5, n / 2 + 10))
            Console.Write(n + "\n" + t + "\n");
    }
  }
  
}



<|start_filename|>out/aaa_041comment.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
main =
  {-while i < 10 do -}
  do printf "%d" (4 :: Int) :: IO ()
     let a = 4 + 1
     {-  end -}
     printf "%d" (a :: Int) :: IO ()




<|start_filename|>out/euler05.js<|end_filename|>
var util = require("util");
function primesfactors(n){
    var tab = new Array(n + 1);
    for (var i = 0; i <= n; i++)
        tab[i] = 0;
    var d = 2;
    while (n != 1 && d * d <= n)
        if (~~(n % d) == 0)
        {
            tab[d]++;
            n = ~~(n / d);
        }
        else
            d++;
    tab[n]++;
    return tab;
}
var lim = 20;
var o = new Array(lim + 1);
for (var m = 0; m <= lim; m++)
    o[m] = 0;
for (var i = 1; i <= lim; i++)
{
    var t = primesfactors(i);
    for (var j = 1; j <= i; j++)
        o[j] = Math.max(o[j], t[j]);
}
var product = 1;
for (var k = 1; k <= lim; k++)
    for (var l = 1; l <= o[k]; l++)
        product *= k;
util.print(product, "\n");



<|start_filename|>out/devine.cpp<|end_filename|>
#include <iostream>
#include <vector>

bool devine0(int nombre, std::vector<int>& tab, int len) {
    int min0 = tab[0];
    int max0 = tab[1];
    for (int i = 2; i < len; i++)
    {
        if (tab[i] > max0 || tab[i] < min0)
            return false;
        if (tab[i] < nombre)
            min0 = tab[i];
        if (tab[i] > nombre)
            max0 = tab[i];
        if (tab[i] == nombre && len != i + 1)
            return false;
    }
    return true;
}

int main() {
    int tmp, len, nombre;
    std::cin >> nombre >> len;
    std::vector<int> tab( len );
    for (int i = 0; i < len; i++)
    {
        std::cin >> tmp;
        tab[i] = tmp;
    }
    if (devine0(nombre, tab, len))
        std::cout << "True";
    else
        std::cout << "False";
}



<|start_filename|>out/affect.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

/*
Ce test permet de vérifier que l'implémentation de l'affectation fonctionne correctement
*/
class Toto {
  int foo
  int bar
  int blah
}
Toto mktoto(int v1)
{
  Toto t = new Toto()
  t.foo = v1
  t.bar = v1
  t.blah = v1
  return t
}
Toto mktoto2(int v1)
{
  Toto t = new Toto()
  t.foo = v1 + 3
  t.bar = v1 + 2
  t.blah = v1 + 1
  return t
}
int result(Toto t_, Toto t2_)
{
  Toto t = t_
  Toto t2 = t2_
  Toto t3 = new Toto()
  t3.foo = 0
  t3.bar = 0
  t3.blah = 0
  t3 = t2
  t = t2
  t2 = t3
  t.blah++
  int len = 1
  int[] cache0 = new int[len]
  for (int i = 0; i < len; i++)
      cache0[i] = -i
  int[] cache1 = new int[len]
  for (int j = 0; j < len; j++)
      cache1[j] = j
  int[] cache2 = cache0
  cache0 = cache1
  cache2 = cache0
  return t.foo + t.blah * t.bar + t.bar * t.foo
}
@Field Scanner scanner = new Scanner(System.in)
Toto t = mktoto(4)
Toto t2 = mktoto(5)
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  t.bar = -scanner.nextInt()
}else{
  t.bar = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  t.blah = -scanner.nextInt()
}else{
  t.blah = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  t2.bar = -scanner.nextInt()
}else{
  t2.bar = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  t2.blah = -scanner.nextInt()
}else{
  t2.blah = scanner.nextInt()
}
System.out.printf("%d%d", result(t, t2), t.blah)



<|start_filename|>out/brainfuck_compiler.fs<|end_filename|>
\ 
\ Ce test permet de tester les macros
\ C'est un compilateur brainfuck qui lit sur l'entrée standard pendant la compilation
\ et qui produit les macros metalang correspondante
\ 
: main
  32 { input }
  500 { current_pos }
  HERE 1000 cells allot { mem }
  999 0 BEGIN 2dup >= WHILE DUP { i }
    0 mem  i cells +  !
   1 + REPEAT 2DROP
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  current_pos 1 + TO current_pos
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
  BEGIN
    mem  current_pos cells +  @ 0 <>
  WHILE
    mem  current_pos cells +  @ 1 - mem  current_pos cells +  !
    current_pos 1 - TO current_pos
    mem  current_pos cells +  @ 1 + mem  current_pos cells +  !
    mem  current_pos cells +  @ EMIT
    current_pos 1 + TO current_pos
  REPEAT
  ;
main
BYE



<|start_filename|>out/aaa_03binding.js<|end_filename|>
var util = require("util");
function g(i){
    var j = i * 4;
    if (~~(j % 2) == 1)
        return 0;
    return j;
}
function h(i){
    util.print(i, "\n");
}
h(14);
var a = 4;
var b = 5;
util.print(a + b);
//  main 
h(15);
a = 2;
b = 1;
util.print(a + b);



<|start_filename|>out/test_enum.fs<|end_filename|>
0 constant Foo
1 constant Bar
2 constant Blah
: main
  Foo { foo_val }
  ;
main
BYE



<|start_filename|>out/record3.java<|end_filename|>
import java.util.*;

public class record3
{
  static Scanner scanner = new Scanner(System.in);
  static class toto {
    public int foo;
    public int bar;
    public int blah;
  }
  static toto mktoto(int v1)
  {
    toto t = new toto();
    t.foo = v1;
    t.bar = 0;
    t.blah = 0;
    return t;
  }
  static int result(toto[] t, int len)
  {
    int out0 = 0;
    for (int j = 0; j < len; j++)
    {
        t[j].blah++;
        out0 = out0 + t[j].foo + t[j].blah * t[j].bar + t[j].bar * t[j].foo;
    }
    return out0;
  }
  public static void main(String args[])
  {
    toto[] t = new toto[4];
    for (int i = 0; i < 4; i++)
        t[i] = mktoto(i);
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      t[0].bar = -scanner.nextInt();
    }else{
      t[0].bar = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      t[1].blah = -scanner.nextInt();
    }else{
      t[1].blah = scanner.nextInt();
    }
    int titi = result(t, 4);
    System.out.printf("%d%d", titi, t[2].blah);
  }
  
}



<|start_filename|>out/test_returns.lua<|end_filename|>
function is_pair (i)
  local j = 1
  if i < 10 then
      j = 2
      if i == 0 then
          j = 4
          return true
      end
      j = 3
      if i == 2 then
          j = 4
          return true
      end
      j = 5
  end
  j = 6
  if i < 20 then
      if i == 22 then
          j = 0
      end
      j = 8
  end
  return math.fmod(i, 2) == 0
end




<|start_filename|>out/loop_unroll.cs<|end_filename|>
using System;

public class loop_unroll
{
  /*
Ce test permet de vérifier le comportement des macros
Il effectue du loop unrolling
*/
  public static void Main(String[] args)
  {
    int j = 0;
    j = 0;
    Console.Write(j + "\n");
    j = 1;
    Console.Write(j + "\n");
    j = 2;
    Console.Write(j + "\n");
    j = 3;
    Console.Write(j + "\n");
    j = 4;
    Console.Write(j + "\n");
  }
  
}



<|start_filename|>out/euler14.groovy<|end_filename|>
import java.util.*

int next0(int n)
{
  if (n % 2 == 0)
      return n.intdiv(2)
  else
      return 3 * n + 1
}
int find(int n, int[] m)
{
  if (n == 1)
      return 1
  else if (n >= 1000000)
      return 1 + find(next0(n), m)
  else if (m[n] != 0)
      return m[n]
  else
  {
      m[n] = 1 + find(next0(n), m)
      return m[n]
  }
}

int[] m = new int[1000000]
for (int j = 0; j < 1000000; j++)
    m[j] = 0
int max0 = 0
int maxi = 0
for (int i = 1; i < 1000; i++)
{
    //  normalement on met 999999 mais ça dépasse les int32... 
    int n2 = find(i, m)
    if (n2 > max0)
    {
        max0 = n2
        maxi = i
    }
}
System.out.printf("%d\n%d\n", max0, maxi)



<|start_filename|>out/aaa_read1.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class aaa_read1
{
  
  public static void Main(String[] args)
  {
    char[] str = Console.ReadLine().ToCharArray();
    for (int i = 0; i < 12; i++)
        Console.Write(str[i]);
  }
  
}



<|start_filename|>out/loop_unroll.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
main =
  do printf "%d\n" (0::Int) :: IO()
     printf "%d\n" (1::Int) :: IO()
     printf "%d\n" (2::Int) :: IO()
     printf "%d\n" (3::Int) :: IO()
     printf "%d\n" (4::Int) :: IO()




<|start_filename|>out/cambriolage.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function nbPassePartout (n, passepartout, m, serrures)
  local max_ancient = 0
  local max_recent = 0
  for i = 0, m - 1 do
      if serrures[i + 1][1] == -1 and serrures[i + 1][2] > max_ancient then
          max_ancient = serrures[i + 1][2]
      end
      if serrures[i + 1][1] == 1 and serrures[i + 1][2] > max_recent then
          max_recent = serrures[i + 1][2]
      end
  end
  local max_ancient_pp = 0
  local max_recent_pp = 0
  for i = 0, n - 1 do
      local pp = passepartout[i + 1]
      if pp[1] >= max_ancient and pp[2] >= max_recent then
          return 1
      end
      max_ancient_pp = math.max(max_ancient_pp, pp[1])
      max_recent_pp = math.max(max_recent_pp, pp[2])
  end
  if max_ancient_pp >= max_ancient and max_recent_pp >= max_recent then
      return 2
  else 
      return 0
  end
end

local n = readint()
stdinsep()
local passepartout = {}
for i = 0, n - 1 do
    local out0 = {}
    for j = 0, 1 do
        local out01 = readint()
        stdinsep()
        out0[j + 1] = out01
    end
    passepartout[i + 1] = out0
end
local m = readint()
stdinsep()
local serrures = {}
for k = 0, m - 1 do
    local out1 = {}
    for l = 0, 1 do
        local out_ = readint()
        stdinsep()
        out1[l + 1] = out_
    end
    serrures[k + 1] = out1
end
io.write(nbPassePartout(n, passepartout, m, serrures))


<|start_filename|>out/min3.java<|end_filename|>
import java.util.*;

public class min3
{
  
  
  public static void main(String args[])
  {
    System.out.printf("%d %d %d %d %d %d\n", Math.min(Math.min(2, 3), 4), Math.min(Math.min(2, 4), 3), Math.min(Math.min(3, 2), 4), Math.min(Math.min(3, 4), 2), Math.min(Math.min(4, 2), 3), Math.min(Math.min(4, 3), 2));
  }
  
}



<|start_filename|>out/aaa_01hello.go<|end_filename|>
package main
import "fmt"

func main() {
  fmt.Printf("Hello World")
  a := 5
  fmt.Printf("%d \n%dfoo", (4 + 6) * 2, a)
  if 1 + 2 * 2 * (3 + 8) / 4 - 2 == 12 && true {
      fmt.Printf("True")
  } else {
      fmt.Printf("False")
  }
  fmt.Printf("\n")
  if (3 * (4 + 11) * 2 == 45) == false {
      fmt.Printf("True")
  } else {
      fmt.Printf("False")
  }
  fmt.Printf(" ")
  if (2 == 1) == false {
      fmt.Printf("True")
  } else {
      fmt.Printf("False")
  }
  fmt.Printf(" %d%d", 5 / 3 / 3, 4 * 1 / 3 / 2 * 1)
  if !(!(a == 0) && !(a == 4)) {
      fmt.Printf("True")
  } else {
      fmt.Printf("False")
  }
  if true && !false && !(true && false) {
      fmt.Printf("True")
  } else {
      fmt.Printf("False")
  }
  fmt.Printf("\n")
}



<|start_filename|>out/longest_increasing_subsequence.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func dichofind(len int, tab []int, tofind int, a int, b int) int{
  if a >= b - 1 {
      return a
  } else {
      c := (a + b) / 2
      if tab[c] < tofind {
          return dichofind(len, tab, tofind, c, b)
      } else {
          return dichofind(len, tab, tofind, a, c)
      }
  }
}
func process(len int, tab []int) int{
  var size []int = make([]int, len)
  for j := 0; j < len; j++ {
      if j == 0 {
          size[j] = 0
      } else {
          size[j] = len * 2
      }
  }
  for i := 0; i < len; i++ {
      k := dichofind(len, size, tab[i], 0, len - 1)
      if size[k + 1] > tab[i] {
          size[k + 1] = tab[i]
      }
  }
  for l := 0; l < len; l++ {
      fmt.Printf("%d ", size[l])
  }
  for m := 0; m < len; m++ {
      k := len - 1 - m
      if size[k] != len * 2 {
          return k
      }
  }
  return 0
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var n int
  fmt.Fscanf(reader, "%d", &n)
  skip()
  for i := 1; i <= n; i++ {
      var len int
      fmt.Fscanf(reader, "%d", &len)
      skip()
      var d []int = make([]int, len)
      for e := 0; e < len; e++ {
          fmt.Fscanf(reader, "%d", &d[e])
          skip()
      }
      fmt.Printf("%d\n", process(len, d))
  }
}



<|start_filename|>out/aaa_05array.lua<|end_filename|>
function id (b)
  return b
end

function g (t, index)
  t[index + 1] = false
end

local j = 0
local a = {}
for i = 0, 4 do
    io.write(i)
    j = j + i
    a[i + 1] = math.fmod(i, 2) == 0
end
io.write(string.format("%d ", j))
if a[1] then
    io.write("True")
else 
    io.write("False")
end
io.write("\n")
g(id(a), 0)
if a[1] then
    io.write("True")
else 
    io.write("False")
end
io.write("\n")


<|start_filename|>out/tictactoe.cc<|end_filename|>
#include <iostream>
#include <vector>
/*
Tictactoe : un tictactoe avec une IA
*/
//  La structure de donnée 
struct gamestate {
    std::vector<std::vector<int> *> * cases;
    bool firstToPlay;
    int note;
    bool ended;
};

//  Un Mouvement 
struct move {
    int x;
    int y;
};

//  On affiche l'état 

void print_state(gamestate * g) {
    std::cout << "\n|";
    for (int y = 0; y < 3; y++)
    {
        for (int x = 0; x < 3; x++)
        {
            if (g->cases->at(x)->at(y) == 0)
                std::cout << " ";
            else if (g->cases->at(x)->at(y) == 1)
                std::cout << "O";
            else
                std::cout << "X";
            std::cout << "|";
        }
        if (y != 2)
            std::cout << "\n|-|-|-|\n|";
    }
    std::cout << "\n";
}

//  On dit qui gagne (info stoquées dans g.ended et g.note ) 

void eval0(gamestate * g) {
    int win = 0;
    int freecase = 0;
    for (int y = 0; y < 3; y++)
    {
        int col = -1;
        int lin = -1;
        for (int x = 0; x < 3; x++)
        {
            if (g->cases->at(x)->at(y) == 0)
                freecase++;
            int colv = g->cases->at(x)->at(y);
            int linv = g->cases->at(y)->at(x);
            if (col == -1 && colv != 0)
                col = colv;
            else if (colv != col)
                col = -2;
            if (lin == -1 && linv != 0)
                lin = linv;
            else if (linv != lin)
                lin = -2;
        }
        if (col >= 0)
            win = col;
        else if (lin >= 0)
            win = lin;
    }
    for (int x = 1; x < 3; x++)
    {
        if (g->cases->at(0)->at(0) == x && g->cases->at(1)->at(1) == x && g->cases->at(2)->at(2) == x)
            win = x;
        if (g->cases->at(0)->at(2) == x && g->cases->at(1)->at(1) == x && g->cases->at(2)->at(0) == x)
            win = x;
    }
    g->ended = win != 0 || freecase == 0;
    if (win == 1)
        g->note = 1000;
    else if (win == 2)
        g->note = -1000;
    else
        g->note = 0;
}

//  On applique un mouvement 

void apply_move_xy(int x, int y, gamestate * g) {
    int player = 2;
    if (g->firstToPlay)
        player = 1;
    g->cases->at(x)->at(y) = player;
    g->firstToPlay = !g->firstToPlay;
}


void apply_move(move * m, gamestate * g) {
    apply_move_xy(m->x, m->y, g);
}


void cancel_move_xy(int x, int y, gamestate * g) {
    g->cases->at(x)->at(y) = 0;
    g->firstToPlay = !g->firstToPlay;
    g->ended = false;
}


void cancel_move(move * m, gamestate * g) {
    cancel_move_xy(m->x, m->y, g);
}


bool can_move_xy(int x, int y, gamestate * g) {
    return g->cases->at(x)->at(y) == 0;
}


bool can_move(move * m, gamestate * g) {
    return can_move_xy(m->x, m->y, g);
}

/*
Un minimax classique, renvoie la note du plateau
*/

int minmax(gamestate * g) {
    eval0(g);
    if (g->ended)
        return g->note;
    int maxNote = -10000;
    if (!g->firstToPlay)
        maxNote = 10000;
    for (int x = 0; x < 3; x++)
        for (int y = 0; y < 3; y++)
            if (can_move_xy(x, y, g))
            {
                apply_move_xy(x, y, g);
                int currentNote = minmax(g);
                cancel_move_xy(x, y, g);
                //  Minimum ou Maximum selon le coté ou l'on joue
                if (currentNote > maxNote == g->firstToPlay)
                    maxNote = currentNote;
            }
    return maxNote;
}

/*
Renvoie le coup de l'IA
*/

move * play(gamestate * g) {
    move * minMove = new move();
        minMove->x = 0;
        minMove->y = 0;;
    int minNote = 10000;
    for (int x = 0; x < 3; x++)
        for (int y = 0; y < 3; y++)
            if (can_move_xy(x, y, g))
            {
                apply_move_xy(x, y, g);
                int currentNote = minmax(g);
                std::cout << x << ", " << y << ", " << currentNote << "\n";
                cancel_move_xy(x, y, g);
                if (currentNote < minNote)
                {
                    minNote = currentNote;
                    minMove->x = x;
                    minMove->y = y;
                }
            }
    std::cout << minMove->x << minMove->y << "\n";
    return minMove;
}


gamestate * init0() {
    std::vector<std::vector<int> *> *cases = new std::vector<std::vector<int> *>( 3 );
    for (int i = 0; i < 3; i++)
    {
        std::vector<int> *tab = new std::vector<int>( 3 );
        std::fill(tab->begin(), tab->end(), 0);
        cases->at(i) = tab;
    }
    gamestate * a = new gamestate();
        a->cases = cases;
        a->firstToPlay = true;
        a->note = 0;
        a->ended = false;;
    return a;
}


move * read_move() {
    int y, x;
    std::cin >> x >> y;
    move * b = new move();
        b->x = x;
        b->y = y;;
    return b;
}

int main() {
    for (int i = 0; i < 2; i++)
    {
        gamestate * state = init0();
        move * c = new move();
            c->x = 1;
            c->y = 1;;
        apply_move(c, state);
        move * d = new move();
            d->x = 0;
            d->y = 0;;
        apply_move(d, state);
        while (!state->ended)
        {
            print_state(state);
            apply_move(play(state), state);
            eval0(state);
            print_state(state);
            if (!state->ended)
            {
                apply_move(play(state), state);
                eval0(state);
            }
        }
        print_state(state);
        std::cout << state->note << "\n";
    }
}



<|start_filename|>out/euler22.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int score() {
    int i, len;
    char c;
    scanf(" %d ", &len);
    int sum = 0;
    for (i = 1; i <= len; i++)
    {
        scanf("%c", &c);
        sum += (int)(c) - (int)('A') + 1;
        /*		print c print " " print sum print " " */
    }
    return sum;
}
int main(void) {
    int i, n;
    int sum = 0;
    scanf("%d", &n);
    for (i = 1; i <= n; i++)
        sum += i * score();
    printf("%d\n", sum);
    return 0;
}




<|start_filename|>out/aaa_11arrayconst.js<|end_filename|>
var util = require("util");
function test(tab, len){
    for (var i = 0; i < len; i++)
        util.print(tab[i], " ");
    util.print("\n");
}
var t = new Array(5);
for (var i = 0; i < 5; i++)
    t[i] = 1;
test(t, 5);



<|start_filename|>out/euler36.cs<|end_filename|>
using System;

public class euler36
{
  static bool palindrome2(int[] pow2, int n)
  {
    bool[] t = new bool[20];
    for (int i = 0; i < 20; i++)
        t[i] = n / pow2[i] % 2 == 1;
    int nnum = 0;
    for (int j = 1; j < 20; j++)
        if (t[j])
            nnum = j;
    for (int k = 0; k <= nnum / 2; k++)
        if (t[k] != t[nnum - k])
            return false;
    return true;
  }
  
  public static void Main(String[] args)
  {
    int p = 1;
    int[] pow2 = new int[20];
    for (int i = 0; i < 20; i++)
    {
        p *= 2;
        pow2[i] = p / 2;
    }
    int sum = 0;
    for (int d = 1; d < 10; d++)
    {
        if (palindrome2(pow2, d))
        {
            Console.Write(d + "\n");
            sum += d;
        }
        if (palindrome2(pow2, d * 10 + d))
        {
            Console.Write((d * 10 + d) + "\n");
            sum += d * 10 + d;
        }
    }
    for (int a0 = 0; a0 < 5; a0++)
    {
        int a = a0 * 2 + 1;
        for (int b = 0; b < 10; b++)
        {
            for (int c = 0; c < 10; c++)
            {
                int num0 = a * 100000 + b * 10000 + c * 1000 + c * 100 + b * 10 + a;
                if (palindrome2(pow2, num0))
                {
                    Console.Write(num0 + "\n");
                    sum += num0;
                }
                int num1 = a * 10000 + b * 1000 + c * 100 + b * 10 + a;
                if (palindrome2(pow2, num1))
                {
                    Console.Write(num1 + "\n");
                    sum += num1;
                }
            }
            int num2 = a * 100 + b * 10 + a;
            if (palindrome2(pow2, num2))
            {
                Console.Write(num2 + "\n");
                sum += num2;
            }
            int num3 = a * 1000 + b * 100 + b * 10 + a;
            if (palindrome2(pow2, num3))
            {
                Console.Write(num3 + "\n");
                sum += num3;
            }
        }
    }
    Console.Write("sum=" + sum + "\n");
  }
  
}



<|start_filename|>out/prologin_template_2charline.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int programme_candidat(char[] tableau1, int taille1, char[] tableau2, int taille2)
{
  int out0 = 0
  for (int i = 0; i < taille1; i++)
  {
      out0 += (0+tableau1[i]) * i
      print(tableau1[i])
  }
  print("--\n")
  for (int j = 0; j < taille2; j++)
  {
      out0 += (0+tableau2[j]) * j * 100
      print(tableau2[j])
  }
  print("--\n")
  return out0
}
@Field Scanner scanner = new Scanner(System.in)
int taille1 = Integer.parseInt(scanner.nextLine())
char[] tableau1 = scanner.nextLine().toCharArray()
int taille2 = Integer.parseInt(scanner.nextLine())
char[] tableau2 = scanner.nextLine().toCharArray()
System.out.printf("%d\n", programme_candidat(tableau1, taille1, tableau2, taille2))



<|start_filename|>out/linkedList.cs<|end_filename|>
using System;

public class linkedList
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static int readInt(){
  int i = 0;
  char s = readChar_();
  int sign = 1;
  if (s == '-'){
    sign = -1;
    consommeChar();
  }
  do{
    char c = readChar_();
    if (c <= '9' && c >= '0'){
      i = i * 10 + c - '0';
      consommeChar();
    }else{
      return i * sign;
    }
  } while(true);
} 
  public class intlist {
    public int head;
    public intlist tail;
  }
  static intlist cons(intlist list, int i)
  {
    intlist out0 = new intlist();
    out0.head = i;
    out0.tail = list;
    return out0;
  }
  
  static bool is_empty(intlist foo)
  {
    return true;
  }
  
  static intlist rev2(intlist acc, intlist torev)
  {
    if (is_empty(torev))
        return acc;
    else
    {
        intlist acc2 = new intlist();
        acc2.head = torev.head;
        acc2.tail = acc;
        return rev2(acc, torev.tail);
    }
  }
  
  static intlist rev(intlist empty, intlist torev)
  {
    return rev2(empty, torev);
  }
  
  static void test(intlist empty)
  {
    intlist list = empty;
    int i = -1;
    while (i != 0)
    {
        i = readInt();
        if (i != 0)
            list = cons(list, i);
    }
  }
  
  public static void Main(String[] args)
  {
    
  }
  
}



<|start_filename|>out/aaa_041comment.go<|end_filename|>
package main
import "fmt"

func main() {
  i := 4
  /*while i < 10 do */
  fmt.Printf("%d", i)
  i++
  /*  end */
  fmt.Printf("%d", i)
}



<|start_filename|>out/aaa_021if.fs<|end_filename|>
: testA { a b }
  a
  IF
    b
    IF
      S" A" TYPE
    ELSE
      S" B" TYPE
    THEN
  ELSE
    b
    IF
      S" C" TYPE
    ELSE
      S" D" TYPE
    THEN
  THEN
;


: testB { a b }
  a
  IF
    S" A" TYPE
  ELSE
    b
    IF
      S" B" TYPE
    ELSE
      S" C" TYPE
    THEN
  THEN
;


: testC { a b }
  a
  IF
    b
    IF
      S" A" TYPE
    ELSE
      S" B" TYPE
    THEN
  ELSE
    S" C" TYPE
  THEN
;


: testD { a b }
  a
  IF
    b
    IF
      S" A" TYPE
    ELSE
      S" B" TYPE
    THEN
    S" C" TYPE
  ELSE
    S" D" TYPE
  THEN
;


: testE { a b }
  a
  IF
    b
    IF
      S" A" TYPE
    THEN
  ELSE
    b
    IF
      S" C" TYPE
    ELSE
      S" D" TYPE
    THEN
    S" E" TYPE
  THEN
;


: test { a b }
  a b testD
  a b testE
  S\" \n" TYPE
;

: main
  true true test
  true false test
  false true test
  false false test
  ;
main
BYE



<|start_filename|>out/ocaml01.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int foo() {
    int i;
    for (i = 0; i < 11; i++)
    {
        
    }
    return 0;
}

int bar() {
    int i;
    for (i = 0; i < 11; i++)
    {
        int a = 0;
    }
    return 0;
}
int main(void) {
    
    return 0;
}




<|start_filename|>out/testing_count.java<|end_filename|>
import java.util.*;

public class testing_count
{
  
  
  public static void main(String args[])
  {
    int[] tab = new int[40];
    for (int i = 0; i < 40; i++)
        tab[i] = i * i;
    System.out.printf("%d\n", (tab).length);
  }
  
}



<|start_filename|>out/min3.groovy<|end_filename|>
import java.util.*



System.out.printf("%d %d %d %d %d %d\n", Math.min(Math.min(2, 3), 4), Math.min(Math.min(2, 4), 3), Math.min(Math.min(3, 2), 4), Math.min(Math.min(3, 4), 2), Math.min(Math.min(4, 2), 3), Math.min(Math.min(4, 3), 2))



<|start_filename|>out/euler33.go<|end_filename|>
package main
import "fmt"
func max2_(a int, b int) int{
  if a > b {
      return a
  } else {
      return b
  }
}
func min2_(a int, b int) int{
  if a < b {
      return a
  } else {
      return b
  }
}
func pgcd(a int, b int) int{
  c := min2_(a, b)
  d := max2_(a, b)
  reste := d % c
  if reste == 0 {
      return c
  } else {
      return pgcd(c, reste)
  }
}
func main() {
  top := 1
  bottom := 1
  for i := 1; i < 10; i++ {
      for j := 1; j < 10; j++ {
          for k := 1; k < 10; k++ {
              if i != j && j != k {
                  a := i * 10 + j
                  b := j * 10 + k
                  if a * k == i * b {
                      fmt.Printf("%d/%d\n", a, b)
                      top *= a
                      bottom *= b
                  }
              }
          }
      }
  }
  fmt.Printf("%d/%d\n", top, bottom)
  p := pgcd(top, bottom)
  fmt.Printf("pgcd=%d\n%d\n", p, bottom / p)
}



<|start_filename|>out/euler15.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
main =
  {- normalement on doit mettre 20 mais là on se tape un overflow -}
  do let a = 10 + 1
     tab <- array_init a (\ i ->
                            array_init a (\ j ->
                                            return 0))
     let b l =
           if l <= a - 1
           then do join $ writeIOA <$> (readIOA tab (a - 1)) <*> return l <*> return 1
                   join $ writeIOA <$> (readIOA tab l) <*> return (a - 1) <*> return 1
                   b (l + 1)
           else let c o =
                      if o <= a
                      then do let r = a - o
                              let f p =
                                    if p <= a
                                    then do let q = a - p
                                            join $ writeIOA <$> (readIOA tab r) <*> return q <*> ((+) <$> (join $ readIOA <$> (readIOA tab (r + 1)) <*> return q) <*> (join $ readIOA <$> (readIOA tab r) <*> return (q + 1)))
                                            f (p + 1)
                                    else c (o + 1) in
                                    f 2
                      else let d m =
                                 if m <= a - 1
                                 then let e k =
                                            if k <= a - 1
                                            then do printf "%d " =<< ((join $ readIOA <$> (readIOA tab m) <*> return k)::IO Int)
                                                    e (k + 1)
                                            else do printf "\n" :: IO ()
                                                    d (m + 1) in
                                            e 0
                                 else printf "%d\n" =<< ((join $ readIOA <$> (readIOA tab 0) <*> return 0)::IO Int) in
                                 d 0 in
                      c 2 in
           b 0




<|start_filename|>out/euler08.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*


@Field Scanner scanner = new Scanner(System.in)
int i = 1
int[] last = new int[5]
for (int j = 0; j < 5; j++)
{
    char c = scanner.findWithinHorizon(".", 1).charAt(0)
    int d = (0+c) - (0+(char)'0')
    i *= d
    last[j] = d
}
int max0 = i
int index = 0
int nskipdiv = 0
for (int k = 1; k < 996; k++)
{
    char e = scanner.findWithinHorizon(".", 1).charAt(0)
    int f = (0+e) - (0+(char)'0')
    if (f == 0)
    {
        i = 1
        nskipdiv = 4
    }
    else
    {
        i *= f
        if (nskipdiv < 0)
            i /= last[index]
        nskipdiv--
    }
    last[index] = f
    index = (index + 1) % 5
    max0 = Math.max(max0, i)
}
System.out.printf("%d\n", max0)



<|start_filename|>out/euler39.groovy<|end_filename|>
import java.util.*



int[] t = new int[1001]
for (int i = 0; i < 1001; i++)
    t[i] = 0
for (int a = 1; a < 1001; a++)
    for (int b = 1; b < 1001; b++)
    {
        int c2 = a * a + b * b
        int c = (int)Math.sqrt(c2)
        if (c * c == c2)
        {
            int p = a + b + c
            if (p < 1001)
                t[p]++
        }
    }
int j = 0
for (int k = 1; k < 1001; k++)
    if (t[k] > t[j])
        j = k
print(j)



<|start_filename|>out/euler26.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: periode { restes len a b }
  BEGIN
    a 0 <>
  WHILE
    a b // { chiffre }
    a b % { reste }
    len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
      restes  i cells +  @ reste =
      IF
        DROP DROP len i - exit
      THEN
     1 + REPEAT 2DROP
    reste restes  len cells +  !
    len 1 + TO len
    reste 10 * TO a
  REPEAT
  0 exit
;

: main
  HERE 1000 cells allot { t }
  999 0 BEGIN 2dup >= WHILE DUP { j }
    0 t  j cells +  !
   1 + REPEAT 2DROP
  0 { m }
  0 { mi }
  1000 1 BEGIN 2dup >= WHILE DUP { i }
    t 0 1 i periode { p }
    p m >
    IF
      i TO mi
      p TO m
    THEN
   1 + REPEAT 2DROP
  mi s>d 0 d.r
  S\" \n" TYPE
  m s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/pathfinding.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure pathfinding is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
function min2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a < b
  then
    return a;
  else
    return b;
  end if;
end;
type e is Array (Integer range <>) of Integer;
type e_PTR is access e;
type f is Array (Integer range <>) of e_PTR;
type f_PTR is access f;
type g is Array (Integer range <>) of Character;
type g_PTR is access g;
type h is Array (Integer range <>) of g_PTR;
type h_PTR is access h;
function pathfind_aux(cache : in f_PTR; tab : in h_PTR; x : in Integer; y : in Integer; posX : in Integer; posY : in Integer) return Integer is
  val4 : Integer;
  val3 : Integer;
  val2 : Integer;
  val1 : Integer;
  out0 : Integer;
begin
  if posX = x - 1 and then posY = y - 1
  then
    return 0;
  else
    if ((posX < 0 or else posY < 0) or else posX >= x) or else posY >= y
    then
      return x * y * 10;
    else
      if tab(posY)(posX) = '#'
      then
        return x * y * 10;
      else
        if cache(posY)(posX) /= (-1)
        then
          return cache(posY)(posX);
        else
          cache(posY)(posX) := x * y * 10;
          val1 := pathfind_aux(cache, tab, x, y, posX + 1, posY);
          val2 := pathfind_aux(cache, tab, x, y, posX - 1, posY);
          val3 := pathfind_aux(cache, tab, x, y, posX, posY - 1);
          val4 := pathfind_aux(cache, tab, x, y, posX, posY + 1);
          out0 := 1 + min2_0(min2_0(min2_0(val1, val2), val3), val4);
          cache(posY)(posX) := out0;
          return out0;
        end if;
      end if;
    end if;
  end if;
end;
function pathfind(tab : in h_PTR; x : in Integer; y : in Integer) return Integer is
  tmp : e_PTR;
  cache : f_PTR;
begin
  cache := new f (0..y - 1);
  for i in integer range 0..y - 1 loop
    tmp := new e (0..x - 1);
    for j in integer range 0..x - 1 loop
      tmp(j) := (-1);
    end loop;
    cache(i) := tmp;
  end loop;
  return pathfind_aux(cache, tab, x, y, 0, 0);
end;

  y : Integer;
  x : Integer;
  tmp : Character;
  tab2 : g_PTR;
  tab : h_PTR;
  result : Integer;
begin
  Get(x);
  SkipSpaces;
  Get(y);
  SkipSpaces;
  tab := new h (0..y - 1);
  for i in integer range 0..y - 1 loop
    tab2 := new g (0..x - 1);
    for j in integer range 0..x - 1 loop
      tmp := Character'Val(0);
      Get(tmp);
      tab2(j) := tmp;
    end loop;
    SkipSpaces;
    tab(i) := tab2;
  end loop;
  result := pathfind(tab, x, y);
  PInt(result);
end;


<|start_filename|>out/euler14.go<|end_filename|>
package main
import "fmt"
func next0(n int) int{
  if n % 2 == 0 {
      return n / 2
  } else {
      return 3 * n + 1
  }
}
func find(n int, m []int) int{
  if n == 1 {
      return 1
  } else if n >= 1000000 {
      return 1 + find(next0(n), m)
  } else if m[n] != 0 {
      return m[n]
  } else {
      m[n] = 1 + find(next0(n), m)
      return m[n]
  }
}
func main() {
  var m []int = make([]int, 1000000)
  for j := 0; j < 1000000; j++ {
      m[j] = 0
  }
  max0 := 0
  maxi := 0
  for i := 1; i < 1000; i++ {
      /* normalement on met 999999 mais ça dépasse les int32... */
      n2 := find(i, m)
      if n2 > max0 {
          max0 = n2
          maxi = i
      }
  }
  fmt.Printf("%d\n%d\n", max0, maxi)
}



<|start_filename|>out/sort.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure sort is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type a is Array (Integer range <>) of Integer;
type a_PTR is access a;
function copytab(tab : in a_PTR; len : in Integer) return a_PTR is
  o : a_PTR;
begin
  o := new a (0..len - 1);
  for i in integer range 0..len - 1 loop
    o(i) := tab(i);
  end loop;
  return o;
end;
procedure bubblesort(tab : in a_PTR; len : in Integer) is
  tmp : Integer;
begin
  for i in integer range 0..len - 1 loop
    for j in integer range i + 1..len - 1 loop
      if tab(i) > tab(j)
      then
        tmp := tab(i);
        tab(i) := tab(j);
        tab(j) := tmp;
      end if;
    end loop;
  end loop;
end;
procedure qsort0(tab : in a_PTR; len : in Integer; b : in Integer; c : in Integer) is
  tmp : Integer;
  j0 : Integer;
  j : Integer;
  i0 : Integer;
  i : Integer;
begin
  i := b;
  j := c;
  if i < j
  then
    i0 := i;
    j0 := j;
    -- pivot : tab[0] 
    
    while i /= j loop
      if tab(i) > tab(j)
      then
        if i = j - 1
        then
          -- on inverse simplement
          
          tmp := tab(i);
          tab(i) := tab(j);
          tab(j) := tmp;
          i := i + 1;
        else
          -- on place tab[i+1] à la place de tab[j], tab[j] à la place de tab[i] et tab[i] à la place de tab[i+1] 
          
          tmp := tab(i);
          tab(i) := tab(j);
          tab(j) := tab(i + 1);
          tab(i + 1) := tmp;
          i := i + 1;
        end if;
      else
        j := j - 1;
      end if;
    end loop;
    qsort0(tab, len, i0, i - 1);
    qsort0(tab, len, i + 1, j0);
  end if;
end;

  tmp : Integer;
  tab3 : a_PTR;
  tab2 : a_PTR;
  tab : a_PTR;
  len : Integer;
begin
  len := 2;
  Get(len);
  SkipSpaces;
  tab := new a (0..len - 1);
  for i_0 in integer range 0..len - 1 loop
    tmp := 0;
    Get(tmp);
    SkipSpaces;
    tab(i_0) := tmp;
  end loop;
  tab2 := copytab(tab, len);
  bubblesort(tab2, len);
  for i in integer range 0..len - 1 loop
    PInt(tab2(i));
    PString(new char_array'( To_C(" ")));
  end loop;
  PString(new char_array'( To_C("" & Character'Val(10))));
  tab3 := copytab(tab, len);
  qsort0(tab3, len, 0, len - 1);
  for i in integer range 0..len - 1 loop
    PInt(tab3(i));
    PString(new char_array'( To_C(" ")));
  end loop;
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/linkedList.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

struct intlist;
typedef struct intlist {
  int head;
    struct intlist * tail;
} intlist;

struct intlist * cons(struct intlist * list, int i) {
    struct intlist * out0 = malloc(sizeof(intlist));
    out0->head = i;
    out0->tail = list;
    return out0;
}

int is_empty(struct intlist * foo) {
    return 1;
}

struct intlist * rev2(struct intlist * acc, struct intlist * torev) {
    if (is_empty(torev))
        return acc;
    else
    {
        struct intlist * acc2 = malloc(sizeof(intlist));
        acc2->head = torev->head;
        acc2->tail = acc;
        return rev2(acc, torev->tail);
    }
}

struct intlist * rev(struct intlist * empty, struct intlist * torev) {
    return rev2(empty, torev);
}

void test(struct intlist * empty) {
    struct intlist * list = empty;
    int i = -1;
    while (i != 0)
    {
        scanf("%d", &i);
        if (i != 0)
            list = cons(list, i);
    }
}
int main(void) {
    
    return 0;
}




<|start_filename|>out/fibo.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0

main :: IO ()
fibo0 a b i =
  let c j d e f =
        if j <= i + 1
        then do let g = f + d
                let h = e + d
                c (j + 1) e h g
        else return f in
        c 0 a b 0

main =
  do a <- read_int
     skip_whitespaces
     b <- read_int
     skip_whitespaces
     i <- read_int
     printf "%d" =<< (fibo0 a b i :: IO Int)




<|start_filename|>out/aaa_read2.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_read2 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PChar(c : in Character) is
begin
  Character'Write (Text_Streams.Stream (Current_Output), c);
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
--
--Ce test permet de vérifier si les différents backends pour les langages implémentent bien
--read int, read char et skip
--

type e is Array (Integer range <>) of Integer;
type e_PTR is access e;
type f is Array (Integer range <>) of Character;
type f_PTR is access f;

  tmpc : Character;
  tab4 : f_PTR;
  tab2 : e_PTR;
  tab : e_PTR;
  strlen : Integer;
  len : Integer;
  c : Integer;
begin
  Get(len);
  SkipSpaces;
  PInt(len);
  PString(new char_array'( To_C("=len" & Character'Val(10))));
  tab := new e (0..len - 1);
  for a in integer range 0..len - 1 loop
    Get(tab(a));
    SkipSpaces;
  end loop;
  for i in integer range 0..len - 1 loop
    PInt(i);
    PString(new char_array'( To_C("=>")));
    PInt(tab(i));
    PString(new char_array'( To_C(" ")));
  end loop;
  PString(new char_array'( To_C("" & Character'Val(10))));
  tab2 := new e (0..len - 1);
  for b in integer range 0..len - 1 loop
    Get(tab2(b));
    SkipSpaces;
  end loop;
  for i_0 in integer range 0..len - 1 loop
    PInt(i_0);
    PString(new char_array'( To_C("==>")));
    PInt(tab2(i_0));
    PString(new char_array'( To_C(" ")));
  end loop;
  Get(strlen);
  SkipSpaces;
  PInt(strlen);
  PString(new char_array'( To_C("=strlen" & Character'Val(10))));
  tab4 := new f (0..strlen - 1);
  for d in integer range 0..strlen - 1 loop
    Get(tab4(d));
  end loop;
  SkipSpaces;
  for i3 in integer range 0..strlen - 1 loop
    tmpc := tab4(i3);
    c := Character'Pos(tmpc);
    PChar(tmpc);
    PString(new char_array'( To_C(":")));
    PInt(c);
    PString(new char_array'( To_C(" ")));
    if tmpc /= ' '
    then
      c := (c - Character'Pos('a') + 13) rem 26 + Character'Pos('a');
    end if;
    tab4(i3) := Character'Val(c);
  end loop;
  for j in integer range 0..strlen - 1 loop
    PChar(tab4(j));
  end loop;
end;


<|start_filename|>out/aaa_041comment.fs<|end_filename|>
: main
  4 { i }
  \ while i < 10 do 
  
  i s>d 0 d.r
  i 1 + TO i
  \   end 
  
  i s>d 0 d.r
  ;
main
BYE



<|start_filename|>js/global.js<|end_filename|>

var metalang = {};
window.onload = function(){
    var err = 0;
      for (var i = 0; ; i++){
        var item = document.getElementById('exemple'+i);
        if (item == null){
            err ++;
            if (err == 5) break;
            break;
        }else{
            var d = document.createElement("div");
            d.innerHTML = caml_call_gen(metalang.colore, [item.value]);
            item.parentNode.replaceChild(d, item);
            d.setAttribute("class", "editor_content");
        }
      }
      for (var i = 0; ; i++){
        var item = document.getElementById('exemple_ml_'+i);
        if (item == null) break;
        var ed = CodeMirror.fromTextArea(item, {
          mode: 'text/x-ocaml',
        });
        ed.setOption("theme", "elegant");
      }
};


<|start_filename|>out/linkedList.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0

main :: IO ()
data Intlist = Intlist {
                          _head0 :: IORef Int,
                          _tail0 :: IORef Intlist
                          }
  deriving Eq


cons list i =
  (Intlist <$> (newIORef i) <*> (newIORef list))

is_empty foo =
  return True

rev2 acc torev =
  ifM (is_empty torev)
      (return acc)
      (do acc2 <- (Intlist <$> ((readIORef (_head0 torev)) >>= newIORef) <*> (newIORef acc))
          rev2 acc =<< (readIORef (_tail0 torev)))

rev empty torev =
  rev2 empty torev

test empty =
  do let i = - 1
     let a b c =
           if b /= 0
           then do d <- read_int
                   if d /= 0
                   then do e <- cons c d
                           a d e
                   else a d c
           else return () in
           a i empty

main =
  return ()




<|start_filename|>out/min4.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    std::cout << std::min({1, 2, 3, 4}) << " " << std::min({1, 2, 4, 3}) << " " << std::min({1, 3, 2, 4}) << " " << std::min({1, 3, 4, 2}) << " " << std::min({1, 4, 2, 3}) << " " << std::min({1, 4, 3, 2}) << "\n" << std::min({2, 1, 3, 4}) << " " << std::min({2, 1, 4, 3}) << " " << std::min({2, 3, 1, 4}) << " " << std::min({2, 3, 4, 1}) << " " << std::min({2, 4, 1, 3}) << " " << std::min({2, 4, 3, 1}) << "\n" << std::min({3, 1, 2, 4}) << " " << std::min({3, 1, 4, 2}) << " " << std::min({3, 2, 1, 4}) << " " << std::min({3, 2, 4, 1}) << " " << std::min({3, 4, 1, 2}) << " " << std::min({3, 4, 2, 1}) << "\n" << std::min({4, 1, 2, 3}) << " " << std::min({4, 1, 3, 2}) << " " << std::min({4, 2, 1, 3}) << " " << std::min({4, 2, 3, 1}) << " " << std::min({4, 3, 1, 2}) << " " << std::min({4, 3, 2, 1}) << "\n";
}



<|start_filename|>out/triangles.cs<|end_filename|>
using System;

public class triangles
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static void stdin_sep(){
  do{
    if (eof) return;
    char c = readChar_();
    if (c == ' ' || c == '\n' || c == '\t' || c == '\r'){
      consommeChar();
    }else{
      return;
    }
  } while(true);
}
static int readInt(){
  int i = 0;
  char s = readChar_();
  int sign = 1;
  if (s == '-'){
    sign = -1;
    consommeChar();
  }
  do{
    char c = readChar_();
    if (c <= '9' && c >= '0'){
      i = i * 10 + c - '0';
      consommeChar();
    }else{
      return i * sign;
    }
  } while(true);
} 
  /* Ce code a été généré par metalang
   Il gère les entrées sorties pour un programme dynamique classique
   dans les épreuves de prologin
on le retrouve ici : http://projecteuler.net/problem=18
*/
  static int find0(int len, int[][] tab, int[][] cache, int x, int y)
  {
    /*
	Cette fonction est récursive
	*/
    if (y == len - 1)
        return tab[y][x];
    else if (x > y)
        return -10000;
    else if (cache[y][x] != 0)
        return cache[y][x];
    int result = 0;
    int out0 = find0(len, tab, cache, x, y + 1);
    int out1 = find0(len, tab, cache, x + 1, y + 1);
    if (out0 > out1)
        result = out0 + tab[y][x];
    else
        result = out1 + tab[y][x];
    cache[y][x] = result;
    return result;
  }
  
  static int find(int len, int[][] tab)
  {
    int[][] tab2 = new int[len][];
    for (int i = 0; i < len; i++)
    {
        int[] tab3 = new int[i + 1];
        for (int j = 0; j <= i; j++)
            tab3[j] = 0;
        tab2[i] = tab3;
    }
    return find0(len, tab, tab2, 0, 0);
  }
  
  public static void Main(String[] args)
  {
    int len = readInt();
    stdin_sep();
    int[][] tab = new int[len][];
    for (int i = 0; i < len; i++)
    {
        int[] tab2 = new int[i + 1];
        for (int j = 0; j <= i; j++)
        {
            int tmp = readInt();
            stdin_sep();
            tab2[j] = tmp;
        }
        tab[i] = tab2;
    }
    Console.Write(find(len, tab) + "\n");
    for (int k = 0; k < len; k++)
    {
        for (int l = 0; l <= k; l++)
            Console.Write(tab[k][l] + " ");
        Console.Write("\n");
    }
  }
  
}



<|start_filename|>out/dichoexp.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
: exp0 recursive { a b }
  b 0 =
  IF
    1 exit
  THEN
  b 2 % 0 =
  IF
    a b 2 // exp0 { o }
    o o * exit
  ELSE
    a a b 1 - exp0 * exit
  THEN
;

: main
  0 { a }
  0 { b }
  read-int TO a
  skipspaces
  read-int TO b
  a b exp0 s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/prologin_template_intmatrix.java<|end_filename|>
import java.util.*;

public class prologin_template_intmatrix
{
  static Scanner scanner = new Scanner(System.in);
  static int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

  static int programme_candidat(int[][] tableau, int x, int y)
  {
    int out0 = 0;
    for (int i = 0; i < y; i++)
        for (int j = 0; j < x; j++)
            out0 += tableau[i][j] * (i * 2 + j);
    return out0;
  }
  public static void main(String args[])
  {
    int taille_x = Integer.parseInt(scanner.nextLine());
    int taille_y = Integer.parseInt(scanner.nextLine());
    int[][] tableau = new int[taille_y][];
    for (int a = 0; a < taille_y; a++)
        tableau[a] = read_int_line();
    System.out.printf("%d\n", programme_candidat(tableau, taille_x, taille_y));
  }
  
}



<|start_filename|>out/euler05.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int max2_(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}

int* primesfactors(int n) {
    int i;
    int *tab = calloc(n + 1, sizeof(int));
    for (i = 0; i <= n; i++)
        tab[i] = 0;
    int d = 2;
    while (n != 1 && d * d <= n)
        if (n % d == 0)
        {
            tab[d]++;
            n /= d;
        }
        else
            d++;
    tab[n]++;
    return tab;
}
int main(void) {
    int k, l, i, j, m;
    int lim = 20;
    int *o = calloc(lim + 1, sizeof(int));
    for (m = 0; m <= lim; m++)
        o[m] = 0;
    for (i = 1; i <= lim; i++)
    {
        int* t = primesfactors(i);
        for (j = 1; j <= i; j++)
            o[j] = max2_(o[j], t[j]);
    }
    int product = 1;
    for (k = 1; k <= lim; k++)
        for (l = 1; l <= o[k]; l++)
            product *= k;
    printf("%d\n", product);
    return 0;
}




<|start_filename|>out/euler09.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int main(void) {
    int a, b;
    /*
	a + b + c = 1000 && a * a + b * b = c * c
	*/
    for (a = 1; a < 1001; a++)
        for (b = a + 1; b < 1001; b++)
        {
            int c = 1000 - a - b;
            int a2b2 = a * a + b * b;
            int cc = c * c;
            if (cc == a2b2 && c > a)
                printf("%d\n%d\n%d\n%d\n", a, b, c, a * b * c);
        }
    return 0;
}




<|start_filename|>out/aaa_11arrayconst.cpp<|end_filename|>
#include <iostream>
#include <vector>

void test(std::vector<int>& tab, int len) {
    for (int i = 0; i < len; i++)
        std::cout << tab[i] << " ";
    std::cout << "\n";
}

int main() {
    std::vector<int> t( 5, 1 );
    test(t, 5);
}



<|start_filename|>out/euler31.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: result recursive { sum t maxIndex cache }
  cache  sum cells +  @  maxIndex cells +  @ 0 <>
  IF
    cache  sum cells +  @  maxIndex cells +  @ exit
  ELSE
    sum 0 = maxIndex 0 = OR
    IF
      1 exit
    ELSE
      0 { out0 }
      sum t  maxIndex cells +  @ // { div }
      div 0 BEGIN 2dup >= WHILE DUP { i }
        out0 sum i t  maxIndex cells +  @ * - t maxIndex 1 - cache result + TO out0
       1 + REPEAT 2DROP
      out0 cache  sum cells +  @  maxIndex cells +  !
      out0 exit
    THEN
  THEN
;

: main
  HERE 8 cells allot { t }
  7 0 BEGIN 2dup >= WHILE DUP { i }
    0 t  i cells +  !
   1 + REPEAT 2DROP
  1 t  0 cells +  !
  2 t  1 cells +  !
  5 t  2 cells +  !
  10 t  3 cells +  !
  20 t  4 cells +  !
  50 t  5 cells +  !
  100 t  6 cells +  !
  200 t  7 cells +  !
  HERE 201 cells allot { cache }
  200 0 BEGIN 2dup >= WHILE DUP { j }
    HERE 8 cells allot { o }
    7 0 BEGIN 2dup >= WHILE DUP { k }
      0 o  k cells +  !
     1 + REPEAT 2DROP
    o cache  j cells +  !
   1 + REPEAT 2DROP
  200 t 7 cache result s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/sumDiv.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure sumDiv is


type stringptr is access all char_array;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure foo is
  a : Integer;
begin
  a := 0;
  -- test 
  
  a := a + 1;
  -- test 2 
  
end;
procedure foo2 is
begin
  NULL;
  
end;
procedure foo3 is
begin
  if 1 = 1
  then
    NULL;
    
  end if;
end;
function sumdiv(n : in Integer) return Integer is
  out0 : Integer;
begin
  -- On désire renvoyer la somme des diviseurs 
  
  out0 := 0;
  -- On déclare un entier qui contiendra la somme 
  
  for i in integer range 1..n loop
    -- La boucle : i est le diviseur potentiel
    
    if n rem i = 0
    then
      -- Si i divise 
      
      out0 := out0 + i;
      -- On incrémente 
      
    else
      NULL;
      
    end if;
  end loop;
  return out0;
  --On renvoie out
  
end;

  n : Integer;
begin
  -- Programme principal 
  
  n := 0;
  Get(n);
  -- Lecture de l'entier 
  
  PInt(sumdiv(n));
end;


<|start_filename|>out/euler01.cs<|end_filename|>
using System;

public class euler01
{
  
  public static void Main(String[] args)
  {
    int sum = 0;
    for (int i = 0; i < 1000; i++)
        if (i % 3 == 0 || i % 5 == 0)
            sum += i;
    Console.Write(sum + "\n");
  }
  
}



<|start_filename|>out/tictactoe.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure tictactoe is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
--
--Tictactoe : un tictactoe avec une IA
--

-- La structure de donnée 

type gamestate;
type gamestate_PTR is access gamestate;
type e is Array (Integer range <>) of Integer;
type e_PTR is access e;
type f is Array (Integer range <>) of e_PTR;
type f_PTR is access f;
type gamestate is record
  cases : f_PTR;
  firstToPlay : Boolean;
  note : Integer;
  ended : Boolean;
end record;
-- Un Mouvement 

type move;
type move_PTR is access move;
type move is record
  x : Integer;
  y : Integer;
end record;
-- On affiche l'état 

procedure print_state(g : in gamestate_PTR) is
begin
  PString(new char_array'( To_C("" & Character'Val(10) & "|")));
  for y in integer range 0..2 loop
    for x in integer range 0..2 loop
      if g.cases(x)(y) = 0
      then
        PString(new char_array'( To_C(" ")));
      else
        if g.cases(x)(y) = 1
        then
          PString(new char_array'( To_C("O")));
        else
          PString(new char_array'( To_C("X")));
        end if;
      end if;
      PString(new char_array'( To_C("|")));
    end loop;
    if y /= 2
    then
      PString(new char_array'( To_C("" & Character'Val(10) & "|-|-|-|" & Character'Val(10) & "|")));
    end if;
  end loop;
  PString(new char_array'( To_C("" & Character'Val(10))));
end;
-- On dit qui gagne (info stoquées dans g.ended et g.note ) 

procedure eval0(g : in gamestate_PTR) is
  win : Integer;
  linv : Integer;
  lin : Integer;
  freecase : Integer;
  colv : Integer;
  col : Integer;
begin
  win := 0;
  freecase := 0;
  for y in integer range 0..2 loop
    col := (-1);
    lin := (-1);
    for x in integer range 0..2 loop
      if g.cases(x)(y) = 0
      then
        freecase := freecase + 1;
      end if;
      colv := g.cases(x)(y);
      linv := g.cases(y)(x);
      if col = (-1) and then colv /= 0
      then
        col := colv;
      else
        if colv /= col
        then
          col := (-2);
        end if;
      end if;
      if lin = (-1) and then linv /= 0
      then
        lin := linv;
      else
        if linv /= lin
        then
          lin := (-2);
        end if;
      end if;
    end loop;
    if col >= 0
    then
      win := col;
    else
      if lin >= 0
      then
        win := lin;
      end if;
    end if;
  end loop;
  for x in integer range 1..2 loop
    if (g.cases(0)(0) = x and then g.cases(1)(1) = x) and then g.cases(2)(2) = x
    then
      win := x;
    end if;
    if (g.cases(0)(2) = x and then g.cases(1)(1) = x) and then g.cases(2)(0) = x
    then
      win := x;
    end if;
  end loop;
  g.ended := win /= 0 or else freecase = 0;
  if win = 1
  then
    g.note := 1000;
  else
    if win = 2
    then
      g.note := (-1000);
    else
      g.note := 0;
    end if;
  end if;
end;
-- On applique un mouvement 

procedure apply_move_xy(x : in Integer; y : in Integer; g : in gamestate_PTR) is
  player : Integer;
begin
  player := 2;
  if g.firstToPlay
  then
    player := 1;
  end if;
  g.cases(x)(y) := player;
  g.firstToPlay := not g.firstToPlay;
end;
procedure apply_move(m : in move_PTR; g : in gamestate_PTR) is
begin
  apply_move_xy(m.x, m.y, g);
end;
procedure cancel_move_xy(x : in Integer; y : in Integer; g : in gamestate_PTR) is
begin
  g.cases(x)(y) := 0;
  g.firstToPlay := not g.firstToPlay;
  g.ended := FALSE;
end;
procedure cancel_move(m : in move_PTR; g : in gamestate_PTR) is
begin
  cancel_move_xy(m.x, m.y, g);
end;
function can_move_xy(x : in Integer; y : in Integer; g : in gamestate_PTR) return Boolean is
begin
  return g.cases(x)(y) = 0;
end;
function can_move(m : in move_PTR; g : in gamestate_PTR) return Boolean is
begin
  return can_move_xy(m.x, m.y, g);
end;
--
--Un minimax classique, renvoie la note du plateau
--

function minmax(g : in gamestate_PTR) return Integer is
  maxNote : Integer;
  currentNote : Integer;
begin
  eval0(g);
  if g.ended
  then
    return g.note;
  end if;
  maxNote := (-10000);
  if not g.firstToPlay
  then
    maxNote := 10000;
  end if;
  for x in integer range 0..2 loop
    for y in integer range 0..2 loop
      if can_move_xy(x, y, g)
      then
        apply_move_xy(x, y, g);
        currentNote := minmax(g);
        cancel_move_xy(x, y, g);
        -- Minimum ou Maximum selon le coté ou l'on joue
        
        if (currentNote > maxNote) = g.firstToPlay
        then
          maxNote := currentNote;
        end if;
      end if;
    end loop;
  end loop;
  return maxNote;
end;
--
--Renvoie le coup de l'IA
--

function play(g : in gamestate_PTR) return move_PTR is
  minNote : Integer;
  minMove : move_PTR;
  currentNote : Integer;
begin
  minMove := new move;
  minMove.x := 0;
  minMove.y := 0;
  minNote := 10000;
  for x in integer range 0..2 loop
    for y in integer range 0..2 loop
      if can_move_xy(x, y, g)
      then
        apply_move_xy(x, y, g);
        currentNote := minmax(g);
        PInt(x);
        PString(new char_array'( To_C(", ")));
        PInt(y);
        PString(new char_array'( To_C(", ")));
        PInt(currentNote);
        PString(new char_array'( To_C("" & Character'Val(10))));
        cancel_move_xy(x, y, g);
        if currentNote < minNote
        then
          minNote := currentNote;
          minMove.x := x;
          minMove.y := y;
        end if;
      end if;
    end loop;
  end loop;
  PInt(minMove.x);
  PInt(minMove.y);
  PString(new char_array'( To_C("" & Character'Val(10))));
  return minMove;
end;
function init0 return gamestate_PTR is
  tab : e_PTR;
  cases : f_PTR;
  a : gamestate_PTR;
begin
  cases := new f (0..2);
  for i in integer range 0..2 loop
    tab := new e (0..2);
    for j in integer range 0..2 loop
      tab(j) := 0;
    end loop;
    cases(i) := tab;
  end loop;
  a := new gamestate;
  a.cases := cases;
  a.firstToPlay := TRUE;
  a.note := 0;
  a.ended := FALSE;
  return a;
end;
function read_move return move_PTR is
  y : Integer;
  x : Integer;
  b : move_PTR;
begin
  Get(x);
  SkipSpaces;
  Get(y);
  SkipSpaces;
  b := new move;
  b.x := x;
  b.y := y;
  return b;
end;

  state : gamestate_PTR;
  d : move_PTR;
  c : move_PTR;
begin
  for i in integer range 0..1 loop
    state := init0;
    c := new move;
    c.x := 1;
    c.y := 1;
    apply_move(c, state);
    d := new move;
    d.x := 0;
    d.y := 0;
    apply_move(d, state);
    while not state.ended loop
      print_state(state);
      apply_move(play(state), state);
      eval0(state);
      print_state(state);
      if not state.ended
      then
        apply_move(play(state), state);
        eval0(state);
      end if;
    end loop;
    print_state(state);
    PInt(state.note);
    PString(new char_array'( To_C("" & Character'Val(10))));
  end loop;
end;


<|start_filename|>out/euler05.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: primesfactors { n }
  HERE n 1 + cells allot { tab }
  n 0 BEGIN 2dup >= WHILE DUP { i }
    0 tab  i cells +  !
   1 + REPEAT 2DROP
  2 { d }
  BEGIN
    n 1 <> d d * n <= AND
  WHILE
    n d % 0 =
    IF
      tab  d cells +  @ 1 + tab  d cells +  !
      n d // TO n
    ELSE
      d 1 + TO d
    THEN
  REPEAT
  tab  n cells +  @ 1 + tab  n cells +  !
  tab exit
;

: main
  20 { lim }
  HERE lim 1 + cells allot { o }
  lim 0 BEGIN 2dup >= WHILE DUP { m }
    0 o  m cells +  !
   1 + REPEAT 2DROP
  lim 1 BEGIN 2dup >= WHILE DUP { i }
    i primesfactors { t }
    i 1 BEGIN 2dup >= WHILE DUP { j }
      o  j cells +  @ t  j cells +  @ max o  j cells +  !
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  1 { product }
  lim 1 BEGIN 2dup >= WHILE DUP { k }
    o  k cells +  @ 1 BEGIN 2dup >= WHILE DUP { l }
      product k * TO product
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  product s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/pathfindList.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
: pathfind_aux recursive { cache tab len pos }
  pos len 1 - >=
  IF
    0 exit
  ELSE
    cache  pos cells +  @ 1 NEGATE <>
    IF
      cache  pos cells +  @ exit
    ELSE
      len 2 * cache  pos cells +  !
      cache tab len tab  pos cells +  @ pathfind_aux { posval }
      cache tab len pos 1 + pathfind_aux { oneval }
      0 { out0 }
      posval oneval <
      IF
        1 posval + TO out0
      ELSE
        1 oneval + TO out0
      THEN
      out0 cache  pos cells +  !
      out0 exit
    THEN
  THEN
;


: pathfind { tab len }
  HERE len cells allot { cache }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    1 NEGATE cache  i cells +  !
   1 + REPEAT 2DROP
  cache tab len 0 pathfind_aux exit
;

: main
  0 { len }
  read-int TO len
  skipspaces
  HERE len cells allot { tab }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    0 { tmp }
    read-int TO tmp
    skipspaces
    tmp tab  i cells +  !
   1 + REPEAT 2DROP
  tab len pathfind { result }
  result s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/aaa_readints.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

  int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }


@Field Scanner scanner = new Scanner(System.in)
int len = Integer.parseInt(scanner.nextLine())
System.out.printf("%d=len\n", len)
int[] tab1 = read_int_line()
for (int i = 0; i < len; i++)
    System.out.printf("%d=>%d\n", i, tab1[i])
len = Integer.parseInt(scanner.nextLine())
int[][] tab2 = new int[len - 1][]
for (int a = 0; a < len - 1; a++)
    tab2[a] = read_int_line()
for (int i = 0; i < len - 1; i++)
{
    for (int j = 0; j < len; j++)
        System.out.printf("%d ", tab2[i][j])
    print("\n")
}



<|start_filename|>out/euler19.lua<|end_filename|>
function is_leap (year)
  return math.fmod(year, 400) == 0 or math.fmod(year, 100) ~= 0 and math.fmod(year, 4) == 0
end

function ndayinmonth (month, year)
  if month == 0 then
      return 31
  elseif month == 1 then
      if is_leap(year) then
          return 29
      else 
          return 28
      end
  elseif month == 2 then
      return 31
  elseif month == 3 then
      return 30
  elseif month == 4 then
      return 31
  elseif month == 5 then
      return 30
  elseif month == 6 then
      return 31
  elseif month == 7 then
      return 31
  elseif month == 8 then
      return 30
  elseif month == 9 then
      return 31
  elseif month == 10 then
      return 30
  elseif month == 11 then
      return 31
  end
  return 0
end

local month = 0
local year = 1901
local dayofweek = 1
--[[ 01-01-1901 : mardi --]]
local count = 0
while year ~= 2001 do
    local ndays = ndayinmonth(month, year)
    dayofweek = math.fmod(dayofweek + ndays, 7)
    month = month + 1
    if month == 12 then
        month = 0
        year = year + 1
    end
    if math.fmod(dayofweek, 7) == 6 then
        count = count + 1
    end
end
io.write(string.format("%d\n", count))


<|start_filename|>out/euler42.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include<cmath>

bool is_triangular(int n) {
    /*
   n = k * (k + 1) / 2
	  n * 2 = k * (k + 1)
   */
    int a = (int)sqrt(n * 2);
    return a * (a + 1) == n * 2;
}


int score() {
    int len;
    char c;
    std::cin >> std::skipws >> len;
    int sum = 0;
    for (int i = 1; i <= len; i++)
    {
        std::cin >> c >> std::noskipws;
        sum += (int)(c) - (int)('A') + 1;
        // 		print c print " " print sum print " " 
    }
    if (is_triangular(sum))
        return 1;
    else
        return 0;
}

int main() {
    int n;
    for (int i = 1; i < 56; i++)
        if (is_triangular(i))
            std::cout << i << " ";
    std::cout << "\n";
    int sum = 0;
    std::cin >> n >> std::noskipws;
    for (int i = 1; i <= n; i++)
        sum += score();
    std::cout << sum << "\n";
}



<|start_filename|>out/euler07.lua<|end_filename|>
function divisible (n, t, size)
  for i = 0, size - 1 do
      if math.fmod(n, t[i + 1]) == 0 then
          return true
      end
  end
  return false
end

function find (n, t, used, nth)
  while used ~= nth do
      if divisible(n, t, used) then
          n = n + 1
      else 
          t[used + 1] = n
          n = n + 1
          used = used + 1
      end
  end
  return t[used]
end

local n = 10001
local t = {}
for i = 0, n - 1 do
    t[i + 1] = 2
end
io.write(string.format("%d\n", find(3, t, 1, n)))


<|start_filename|>out/euler31.java<|end_filename|>
import java.util.*;

public class euler31
{
  
  static int result(int sum, int[] t, int maxIndex, int[][] cache)
  {
    if (cache[sum][maxIndex] != 0)
        return cache[sum][maxIndex];
    else if (sum == 0 || maxIndex == 0)
        return 1;
    else
    {
        int out0 = 0;
        int div = sum / t[maxIndex];
        for (int i = 0; i <= div; i++)
            out0 += result(sum - i * t[maxIndex], t, maxIndex - 1, cache);
        cache[sum][maxIndex] = out0;
        return out0;
    }
  }
  public static void main(String args[])
  {
    int[] t = new int[8];
    for (int i = 0; i < 8; i++)
        t[i] = 0;
    t[0] = 1;
    t[1] = 2;
    t[2] = 5;
    t[3] = 10;
    t[4] = 20;
    t[5] = 50;
    t[6] = 100;
    t[7] = 200;
    int[][] cache = new int[201][];
    for (int j = 0; j < 201; j++)
    {
        int[] o = new int[8];
        for (int k = 0; k < 8; k++)
            o[k] = 0;
        cache[j] = o;
    }
    System.out.print(result(200, t, 7, cache));
  }
  
}



<|start_filename|>out/min4.fs<|end_filename|>
: main
  1 2 min 3 min 4 min s>d 0 d.r
  S"  " TYPE
  1 2 min 4 min 3 min s>d 0 d.r
  S"  " TYPE
  1 3 min 2 min 4 min s>d 0 d.r
  S"  " TYPE
  1 3 min 4 min 2 min s>d 0 d.r
  S"  " TYPE
  1 4 min 2 min 3 min s>d 0 d.r
  S"  " TYPE
  1 4 min 3 min 2 min s>d 0 d.r
  S\" \n" TYPE
  2 1 min 3 min 4 min s>d 0 d.r
  S"  " TYPE
  2 1 min 4 min 3 min s>d 0 d.r
  S"  " TYPE
  2 3 min 1 min 4 min s>d 0 d.r
  S"  " TYPE
  2 3 min 4 min 1 min s>d 0 d.r
  S"  " TYPE
  2 4 min 1 min 3 min s>d 0 d.r
  S"  " TYPE
  2 4 min 3 min 1 min s>d 0 d.r
  S\" \n" TYPE
  3 1 min 2 min 4 min s>d 0 d.r
  S"  " TYPE
  3 1 min 4 min 2 min s>d 0 d.r
  S"  " TYPE
  3 2 min 1 min 4 min s>d 0 d.r
  S"  " TYPE
  3 2 min 4 min 1 min s>d 0 d.r
  S"  " TYPE
  3 4 min 1 min 2 min s>d 0 d.r
  S"  " TYPE
  3 4 min 2 min 1 min s>d 0 d.r
  S\" \n" TYPE
  4 1 min 2 min 3 min s>d 0 d.r
  S"  " TYPE
  4 1 min 3 min 2 min s>d 0 d.r
  S"  " TYPE
  4 2 min 1 min 3 min s>d 0 d.r
  S"  " TYPE
  4 2 min 3 min 1 min s>d 0 d.r
  S"  " TYPE
  4 3 min 1 min 2 min s>d 0 d.r
  S"  " TYPE
  4 3 min 2 min 1 min s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/euler08.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler08 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

function max2_0(a : in Integer; b : in Integer) return Integer is
begin
  if a > b
  then
    return a;
  else
    return b;
  end if;
end;
type g is Array (Integer range <>) of Integer;
type g_PTR is access g;

  nskipdiv : Integer;
  max0 : Integer;
  last : g_PTR;
  index : Integer;
  i : Integer;
  f : Integer;
  e : Character;
  d : Integer;
  c : Character;
begin
  i := 1;
  last := new g (0..4);
  for j in integer range 0..4 loop
    Get(c);
    d := Character'Pos(c) - Character'Pos('0');
    i := i * d;
    last(j) := d;
  end loop;
  max0 := i;
  index := 0;
  nskipdiv := 0;
  for k in integer range 1..995 loop
    Get(e);
    f := Character'Pos(e) - Character'Pos('0');
    if f = 0
    then
      i := 1;
      nskipdiv := 4;
    else
      i := i * f;
      if nskipdiv < 0
      then
        i := i / last(index);
      end if;
      nskipdiv := nskipdiv - 1;
    end if;
    last(index) := f;
    index := (index + 1) rem 5;
    max0 := max2_0(max0, i);
  end loop;
  PInt(max0);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler06.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int main(void) {
    int lim = 100;
    int sum = lim * (lim + 1) / 2;
    int carressum = sum * sum;
    int sumcarres = lim * (lim + 1) * (2 * lim + 1) / 6;
    printf("%d", carressum - sumcarres);
    return 0;
}




<|start_filename|>out/aaa_missing.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}
/*
  Ce test a été généré par Metalang.
*/
function result(len, tab){
    var tab2 = new Array(len);
    for (var i = 0; i < len; i++)
        tab2[i] = false;
    for (var i1 = 0; i1 < len; i1++)
    {
        util.print(tab[i1], " ");
        tab2[tab[i1]] = true;
    }
    util.print("\n");
    for (var i2 = 0; i2 < len; i2++)
        if (!tab2[i2])
            return i2;
    return -1;
}
var len = read_int_();
stdinsep();
util.print(len, "\n");
var tab = new Array(len);
for (var a = 0; a < len; a++)
{
    tab[a] = read_int_();
    stdinsep();
}
util.print(result(len, tab), "\n");



<|start_filename|>out/aaa_05array.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int* id(int* b) {
    return b;
}

void g(int* t, int index) {
    t[index] = 0;
}
int main(void) {
    int i;
    int j = 0;
    int *a = calloc(5, sizeof(int));
    for (i = 0; i < 5; i++)
    {
        printf("%d", i);
        j += i;
        a[i] = i % 2 == 0;
    }
    printf("%d ", j);
    if (a[0])
        printf("True");
    else
        printf("False");
    printf("\n");
    g(id(a), 0);
    if (a[0])
        printf("True");
    else
        printf("False");
    printf("\n");
    return 0;
}




<|start_filename|>out/sort.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function copytab (tab, len)
  local o = {}
  for i = 0, len - 1 do
      o[i + 1] = tab[i + 1]
  end
  return o
end

function bubblesort (tab, len)
  for i = 0, len - 1 do
      for j = i + 1, len - 1 do
          if tab[i + 1] > tab[j + 1] then
              local tmp = tab[i + 1]
              tab[i + 1] = tab[j + 1]
              tab[j + 1] = tmp
          end
      end
  end
end

function qsort0 (tab, len, i, j)
  if i < j then
      local i0 = i
      local j0 = j
      --[[ pivot : tab[0] --]]
      while i ~= j do
          if tab[i + 1] > tab[j + 1] then
              if i == j - 1 then
                  --[[ on inverse simplement--]]
                  local tmp = tab[i + 1]
                  tab[i + 1] = tab[j + 1]
                  tab[j + 1] = tmp
                  i = i + 1
              else 
                  --[[ on place tab[i+1] à la place de tab[j], tab[j] à la place de tab[i] et tab[i] à la place de tab[i+1] --]]
                  local tmp = tab[i + 1]
                  tab[i + 1] = tab[j + 1]
                  tab[j + 1] = tab[i + 2]
                  tab[i + 2] = tmp
                  i = i + 1
              end
          else 
              j = j - 1
          end
      end
      qsort0(tab, len, i0, i - 1)
      qsort0(tab, len, i + 1, j0)
  end
end

local len = 2
len = readint()
stdinsep()
local tab = {}
for i_ = 0, len - 1 do
    local tmp = 0
    tmp = readint()
    stdinsep()
    tab[i_ + 1] = tmp
end
local tab2 = copytab(tab, len)
bubblesort(tab2, len)
for i = 0, len - 1 do
    io.write(string.format("%d ", tab2[i + 1]))
end
io.write("\n")
local tab3 = copytab(tab, len)
qsort0(tab3, len, 0, len - 1)
for i = 0, len - 1 do
    io.write(string.format("%d ", tab3[i + 1]))
end
io.write("\n")


<|start_filename|>out/euler14.js<|end_filename|>
var util = require("util");
function next0(n){
    if (~~(n % 2) == 0)
        return ~~(n / 2);
    else
        return 3 * n + 1;
}
function find(n, m){
    if (n == 1)
        return 1;
    else if (n >= 1000000)
        return 1 + find(next0(n), m);
    else if (m[n] != 0)
        return m[n];
    else
    {
        m[n] = 1 + find(next0(n), m);
        return m[n];
    }
}
var m = new Array(1000000);
for (var j = 0; j < 1000000; j++)
    m[j] = 0;
var max0 = 0;
var maxi = 0;
for (var i = 1; i < 1000; i++)
{
    //  normalement on met 999999 mais ça dépasse les int32... 
    var n2 = find(i, m);
    if (n2 > max0)
    {
        max0 = n2;
        maxi = i;
    }
}
util.print(max0, "\n", maxi, "\n");



<|start_filename|>out/affect.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
\ 
\ Ce test permet de vérifier que l'implémentation de l'affectation fonctionne correctement
\ 

struct
  cell% field ->foo
  cell% field ->bar
  cell% field ->blah
end-struct toto%


: mktoto { v1 }
  toto% %allot { t }
  v1 t ->foo !
  v1 t ->bar !
  v1 t ->blah !
  t exit
;


: mktoto2 { v1 }
  toto% %allot { t }
  v1 3 + t ->foo !
  v1 2 + t ->bar !
  v1 1 + t ->blah !
  t exit
;


: result { t_ t2_ }
  t_ { t }
  t2_ { t2 }
  toto% %allot { t3 }
  0 t3 ->foo !
  0 t3 ->bar !
  0 t3 ->blah !
  t2 TO t3
  t2 TO t
  t3 TO t2
  t ->blah @ 1 + t ->blah !
  1 { len }
  HERE len cells allot { cache0 }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    i NEGATE cache0  i cells +  !
   1 + REPEAT 2DROP
  HERE len cells allot { cache1 }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { j }
    j cache1  j cells +  !
   1 + REPEAT 2DROP
  cache0 { cache2 }
  cache1 TO cache0
  cache0 TO cache2
  t ->foo @ t ->blah @ t ->bar @ * + t ->bar @ t ->foo @ * + exit
;

: main
  4 mktoto { t }
  5 mktoto { t2 }
  read-int t ->bar !
  skipspaces
  read-int t ->blah !
  skipspaces
  read-int t2 ->bar !
  skipspaces
  read-int t2 ->blah !
  t t2 result s>d 0 d.r
  t ->blah @ s>d 0 d.r
  ;
main
BYE



<|start_filename|>out/euler07.fs<|end_filename|>
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: divisible { n t size }
  size 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    n t  i cells +  @ % 0 =
    IF
      DROP DROP true exit
    THEN
   1 + REPEAT 2DROP
  false exit
;


: find0 { n t used nth }
  BEGIN
    used nth <>
  WHILE
    n t used divisible
    IF
      n 1 + TO n
    ELSE
      n t  used cells +  !
      n 1 + TO n
      used 1 + TO used
    THEN
  REPEAT
  t  used 1 - cells +  @ exit
;

: main
  10001 { n }
  HERE n cells allot { t }
  n 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    2 t  i cells +  !
   1 + REPEAT 2DROP
  3 t 1 n find0 s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/euler30.groovy<|end_filename|>
import java.util.*



/*
a + b * 10 + c * 100 + d * 1000 + e * 10 000 =
  a ^ 5 +
  b ^ 5 +
  c ^ 5 +
  d ^ 5 +
  e ^ 5
*/
int[] p = new int[10]
for (int i = 0; i < 10; i++)
    p[i] = i * i * i * i * i
int sum = 0
for (int a = 0; a < 10; a++)
    for (int b = 0; b < 10; b++)
        for (int c = 0; c < 10; c++)
            for (int d = 0; d < 10; d++)
                for (int e = 0; e < 10; e++)
                    for (int f = 0; f < 10; f++)
                    {
                        int s = p[a] + p[b] + p[c] + p[d] + p[e] + p[f]
                        int r = a + b * 10 + c * 100 + d * 1000 + e * 10000 + f * 100000
                        if (s == r && r != 1)
                        {
                            System.out.printf("%d%d%d%d%d%d %d\n", f, e, d, c, b, a, r)
                            sum += r
                        }
                    }
print(sum)



<|start_filename|>out/tuple.js<|end_filename|>
var util = require("util");
function f(tuple0){
    var c = tuple0;
    var a = c["tuple_int_int_field_0"];
    var b = c["tuple_int_int_field_1"];
    var d = {
        "tuple_int_int_field_0":a + 1,
        "tuple_int_int_field_1":b + 1};
    return d;
}
var e = {
    "tuple_int_int_field_0":0,
    "tuple_int_int_field_1":1};
var t = f(e);
var g = t;
var a = g["tuple_int_int_field_0"];
var b = g["tuple_int_int_field_1"];
util.print(a, " -- ", b, "--\n");



<|start_filename|>out/affect.cc<|end_filename|>
#include <iostream>
#include <vector>
/*
Ce test permet de vérifier que l'implémentation de l'affectation fonctionne correctement
*/
struct toto {
    int foo;
    int bar;
    int blah;
};


toto * mktoto(int v1) {
    toto * t = new toto();
        t->foo = v1;
        t->bar = v1;
        t->blah = v1;;
    return t;
}


toto * mktoto2(int v1) {
    toto * t = new toto();
        t->foo = v1 + 3;
        t->bar = v1 + 2;
        t->blah = v1 + 1;;
    return t;
}


int result(toto * t_, toto * t2_) {
    toto * t = t_;
    toto * t2 = t2_;
    toto * t3 = new toto();
        t3->foo = 0;
        t3->bar = 0;
        t3->blah = 0;;
    t3 = t2;
    t = t2;
    t2 = t3;
    t->blah++;
    int len = 1;
    std::vector<int> *cache0 = new std::vector<int>( len );
    for (int i = 0; i < len; i++)
        cache0->at(i) = -i;
    std::vector<int> *cache1 = new std::vector<int>( len );
    for (int j = 0; j < len; j++)
        cache1->at(j) = j;
    std::vector<int> * cache2 = cache0;
    cache0 = cache1;
    cache2 = cache0;
    return t->foo + t->blah * t->bar + t->bar * t->foo;
}

int main() {
    toto * t = mktoto(4);
    toto * t2 = mktoto(5);
    std::cin >> t->bar >> t->blah >> t2->bar >> t2->blah >> std::noskipws;
    std::cout << result(t, t2) << t->blah;
}



<|start_filename|>out/min3.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    std::cout << std::min({2, 3, 4}) << " " << std::min({2, 4, 3}) << " " << std::min({3, 2, 4}) << " " << std::min({3, 4, 2}) << " " << std::min({4, 2, 3}) << " " << std::min({4, 3, 2}) << "\n";
}



<|start_filename|>out/euler32.go<|end_filename|>
package main
import "fmt"
/*
We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once;
for example, the 5-digit number, 15234, is 1 through 5 pandigital.

The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier,
and product is 1 through 9 pandigital.

Find the sum of all products whose multiplicand/multiplier/product identity can be written as a
1 through 9 pandigital.

HINT: Some products can be obtained in more than one way so be sure to only include it once in your sum.


(a * 10 + b) ( c * 100 + d * 10 + e) =
  a * c * 1000 +
  a * d * 100 +
  a * e * 10 +
  b * c * 100 +
  b * d * 10 +
  b * e
  => b != e != b * e % 10 ET
  a != d != (b * e / 10 + b * d + a * e ) % 10
*/
func okdigits(ok []bool, n int) bool{
  if n == 0 {
      return true
  } else {
      digit := n % 10
      if ok[digit] {
          ok[digit] = false
          var o bool = okdigits(ok, n / 10)
          ok[digit] = true
          return o
      } else {
          return false
      }
  }
}
func main() {
  count := 0
  var allowed []bool = make([]bool, 10)
  for i := 0; i < 10; i++ {
      allowed[i] = i != 0
  }
  var counted []bool = make([]bool, 100000)
  for j := 0; j < 100000; j++ {
      counted[j] = false
  }
  for e := 1; e < 10; e++ {
      allowed[e] = false
      for b := 1; b < 10; b++ {
          if allowed[b] {
              allowed[b] = false
              be := b * e % 10
              if allowed[be] {
                  allowed[be] = false
                  for a := 1; a < 10; a++ {
                      if allowed[a] {
                          allowed[a] = false
                          for c := 1; c < 10; c++ {
                              if allowed[c] {
                                  allowed[c] = false
                                  for d := 1; d < 10; d++ {
                                      if allowed[d] {
                                          allowed[d] = false
                                          /* 2 * 3 digits */
                                          product := (a * 10 + b) * (c * 100 + d * 10 + e)
                                          if !counted[product] && okdigits(allowed, product / 10) {
                                              counted[product] = true
                                              count += product
                                              fmt.Printf("%d ", product)
                                          }
                                          /* 1  * 4 digits */
                                          product2 := b * (a * 1000 + c * 100 + d * 10 + e)
                                          if !counted[product2] && okdigits(allowed, product2 / 10) {
                                              counted[product2] = true
                                              count += product2
                                              fmt.Printf("%d ", product2)
                                          }
                                          allowed[d] = true
                                      }
                                  }
                                  allowed[c] = true
                              }
                          }
                          allowed[a] = true
                      }
                  }
                  allowed[be] = true
              }
              allowed[b] = true
          }
      }
      allowed[e] = true
  }
  fmt.Printf("%d\n", count)
}



<|start_filename|>out/prologin_template_intmatrix.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

  int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

int programme_candidat(int[][] tableau, int x, int y)
{
  int out0 = 0
  for (int i = 0; i < y; i++)
      for (int j = 0; j < x; j++)
          out0 += tableau[i][j] * (i * 2 + j)
  return out0
}
@Field Scanner scanner = new Scanner(System.in)
int taille_x = Integer.parseInt(scanner.nextLine())
int taille_y = Integer.parseInt(scanner.nextLine())
int[][] tableau = new int[taille_y][]
for (int a = 0; a < taille_y; a++)
    tableau[a] = read_int_line()
System.out.printf("%d\n", programme_candidat(tableau, taille_x, taille_y))



<|start_filename|>out/aaa_01hello.groovy<|end_filename|>
import java.util.*



print("Hello World")
int a = 5
System.out.printf("%d \n%dfoo", (4 + 6) * 2, a)
if (1 + (2 * 2 * (3 + 8)).intdiv(4) - 2 == 12 && true)
    print("True")
else
    print("False")
print("\n")
if ((3 * (4 + 11) * 2 == 45) == false)
    print("True")
else
    print("False")
print(" ")
if ((2 == 1) == false)
    print("True")
else
    print("False")
System.out.printf(" %d%d", 5.intdiv(3).intdiv(3), (4 * 1).intdiv(3).intdiv(2 * 1))
if (!(!(a == 0) && !(a == 4)))
    print("True")
else
    print("False")
if (true && !false && !(true && false))
    print("True")
else
    print("False")
print("\n")



<|start_filename|>out/aaa_01hello.java<|end_filename|>
import java.util.*;

public class aaa_01hello
{
  
  
  public static void main(String args[])
  {
    System.out.print("Hello World");
    int a = 5;
    System.out.printf("%d \n%dfoo", (4 + 6) * 2, a);
    if (1 + 2 * 2 * (3 + 8) / 4 - 2 == 12 && true)
        System.out.print("True");
    else
        System.out.print("False");
    System.out.print("\n");
    if ((3 * (4 + 11) * 2 == 45) == false)
        System.out.print("True");
    else
        System.out.print("False");
    System.out.print(" ");
    if ((2 == 1) == false)
        System.out.print("True");
    else
        System.out.print("False");
    System.out.printf(" %d%d", 5 / 3 / 3, 4 * 1 / 3 / 2 * 1);
    if (!(!(a == 0) && !(a == 4)))
        System.out.print("True");
    else
        System.out.print("False");
    if (true && !false && !(true && false))
        System.out.print("True");
    else
        System.out.print("False");
    System.out.print("\n");
  }
  
}



<|start_filename|>out/min3.js<|end_filename|>
var util = require("util");

util.print(Math.min(2, 3, 4), " ", Math.min(2, 4, 3), " ", Math.min(3, 2, 4), " ", Math.min(3, 4, 2), " ", Math.min(4, 2, 3), " ", Math.min(4, 3, 2), "\n");



<|start_filename|>out/record3.lua<|end_filename|>
buffer =  ""
function readint()
    if buffer == "" then buffer = io.read("*line") end
    local num, buffer0 = string.match(buffer, '^([%-%d]*)(.*)')
    buffer = buffer0
    return tonumber(num)
end

function stdinsep()
    if buffer == "" then buffer = io.read("*line") end
    if buffer ~= nil then buffer = string.gsub(buffer, '^%s*', "") end
end
function mktoto (v1)
  local t = {foo=v1, bar=0, blah=0}
  return t
end

function result (t, len)
  local out0 = 0
  for j = 0, len - 1 do
      t[j + 1].blah = t[j + 1].blah + 1
      out0 = out0 + t[j + 1].foo + t[j + 1].blah * t[j + 1].bar + t[j + 1].bar * t[j + 1].foo
  end
  return out0
end

local t = {}
for i = 0, 3 do
    t[i + 1] = mktoto(i)
end
t[1].bar = readint()
stdinsep()
t[2].blah = readint()
local titi = result(t, 4)
io.write(string.format("%d%d", titi, t[3].blah))


<|start_filename|>out/carre.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int min2_(int a, int b) {
    if (a < b)
        return a;
    else
        return b;
}
int main(void) {
    int jy, jx, ix, iy, d, f, y, x;
    scanf("%d %d ", &x, &y);
    int* *tab = calloc(y, sizeof(int*));
    for (d = 0; d < y; d++)
    {
        int *e = calloc(x, sizeof(int));
        for (f = 0; f < x; f++)
            scanf("%d ", &e[f]);
        tab[d] = e;
    }
    for (ix = 1; ix < x; ix++)
        for (iy = 1; iy < y; iy++)
            if (tab[iy][ix] == 1)
                tab[iy][ix] = min2_(min2_(tab[iy][ix - 1], tab[iy - 1][ix]), tab[iy - 1][ix - 1]) + 1;
    for (jy = 0; jy < y; jy++)
    {
        for (jx = 0; jx < x; jx++)
            printf("%d ", tab[jy][jx]);
        printf("\n");
    }
    return 0;
}




<|start_filename|>out/loop_unroll.lua<|end_filename|>
--[[
Ce test permet de vérifier le comportement des macros
Il effectue du loop unrolling
--]]

local j = 0
j = 0
io.write(string.format("%d\n", j))
j = 1
io.write(string.format("%d\n", j))
j = 2
io.write(string.format("%d\n", j))
j = 3
io.write(string.format("%d\n", j))
j = 4
io.write(string.format("%d\n", j))


<|start_filename|>out/aaa_01hello.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_01hello is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;


  a : Integer;
begin
  PString(new char_array'( To_C("Hello World")));
  a := 5;
  PInt((4 + 6) * 2);
  PString(new char_array'( To_C(" " & Character'Val(10))));
  PInt(a);
  PString(new char_array'( To_C("foo")));
  if 1 + 2 * 2 * (3 + 8) / 4 - 2 = 12 and then TRUE
  then
    PString(new char_array'( To_C("True")));
  else
    PString(new char_array'( To_C("False")));
  end if;
  PString(new char_array'( To_C("" & Character'Val(10))));
  if (3 * (4 + 11) * 2 = 45) = FALSE
  then
    PString(new char_array'( To_C("True")));
  else
    PString(new char_array'( To_C("False")));
  end if;
  PString(new char_array'( To_C(" ")));
  if (2 = 1) = FALSE
  then
    PString(new char_array'( To_C("True")));
  else
    PString(new char_array'( To_C("False")));
  end if;
  PString(new char_array'( To_C(" ")));
  PInt(5 / 3 / 3);
  PInt(4 * 1 / 3 / 2 * 1);
  if not (not (a = 0) and then not (a = 4))
  then
    PString(new char_array'( To_C("True")));
  else
    PString(new char_array'( To_C("False")));
  end if;
  if (TRUE and then not FALSE) and then not (TRUE and then FALSE)
  then
    PString(new char_array'( To_C("True")));
  else
    PString(new char_array'( To_C("False")));
  end if;
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler04.js<|end_filename|>
var util = require("util");
/*

(a + b * 10 + c * 100) * (d + e * 10 + f * 100) =
a * d + a * e * 10 + a * f * 100 +
10 * (b * d + b * e * 10 + b * f * 100)+
100 * (c * d + c * e * 10 + c * f * 100) =

a * d       + a * e * 10   + a * f * 100 +
b * d * 10  + b * e * 100  + b * f * 1000 +
c * d * 100 + c * e * 1000 + c * f * 10000 =

a * d +
10 * ( a * e + b * d) +
100 * (a * f + b * e + c * d) +
(c * e + b * f) * 1000 +
c * f * 10000

*/
function chiffre(c, m){
    if (c == 0)
        return ~~(m % 10);
    else
        return chiffre(c - 1, ~~(m / 10));
}
var m = 1;
for (var a = 0; a < 10; a++)
    for (var f = 1; f < 10; f++)
        for (var d = 0; d < 10; d++)
            for (var c = 1; c < 10; c++)
                for (var b = 0; b < 10; b++)
                    for (var e = 0; e < 10; e++)
                    {
                        var mul = a * d + 10 * (a * e + b * d) + 100 * (a * f + b * e + c * d) + 1000 * (c * e + b * f) + 10000 * c * f;
                        if (chiffre(0, mul) == chiffre(5, mul) && chiffre(1, mul) == chiffre(4, mul) && chiffre(2, mul) == chiffre(3, mul))
                            m = Math.max(mul, m);
                    }
util.print(m, "\n");



<|start_filename|>out/aaa_integer.groovy<|end_filename|>
import java.util.*



int i = 0
i--
System.out.printf("%d\n", i)
i += 55
System.out.printf("%d\n", i)
i *= 13
System.out.printf("%d\n", i)
i /= 2
System.out.printf("%d\n", i)
i++
System.out.printf("%d\n", i)
i /= 3
System.out.printf("%d\n", i)
i--
System.out.printf("%d\n", i)
/*
http://fr.wikipedia.org/wiki/Modulo_(op%C3%A9ration)#Trois_d.C3.A9finitions_de_la_fonction_modulo
*/
System.out.printf("%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n", 117.intdiv(17), 117.intdiv(-17), (-117).intdiv(17), (-117).intdiv(-17), 117 % 17, 117 % -17, -117 % 17, -117 % -17)



<|start_filename|>out/cambriolage.cs<|end_filename|>
using System;

public class cambriolage
{
static bool eof;
static String buffer;
static char readChar_(){
  if (buffer == null || buffer.Length == 0){
    String tmp = Console.ReadLine();
    eof = tmp == null;
    buffer = tmp + "\n";
  }
  char c = buffer[0];
  return c;
}
static void consommeChar(){
       readChar_();
  buffer = buffer.Substring(1);
}
static void stdin_sep(){
  do{
    if (eof) return;
    char c = readChar_();
    if (c == ' ' || c == '\n' || c == '\t' || c == '\r'){
      consommeChar();
    }else{
      return;
    }
  } while(true);
}
static int readInt(){
  int i = 0;
  char s = readChar_();
  int sign = 1;
  if (s == '-'){
    sign = -1;
    consommeChar();
  }
  do{
    char c = readChar_();
    if (c <= '9' && c >= '0'){
      i = i * 10 + c - '0';
      consommeChar();
    }else{
      return i * sign;
    }
  } while(true);
} 
  static int nbPassePartout(int n, int[][] passepartout, int m, int[][] serrures)
  {
    int max_ancient = 0;
    int max_recent = 0;
    for (int i = 0; i < m; i++)
    {
        if (serrures[i][0] == -1 && serrures[i][1] > max_ancient)
            max_ancient = serrures[i][1];
        if (serrures[i][0] == 1 && serrures[i][1] > max_recent)
            max_recent = serrures[i][1];
    }
    int max_ancient_pp = 0;
    int max_recent_pp = 0;
    for (int i = 0; i < n; i++)
    {
        int[] pp = passepartout[i];
        if (pp[0] >= max_ancient && pp[1] >= max_recent)
            return 1;
        max_ancient_pp = Math.Max(max_ancient_pp, pp[0]);
        max_recent_pp = Math.Max(max_recent_pp, pp[1]);
    }
    if (max_ancient_pp >= max_ancient && max_recent_pp >= max_recent)
        return 2;
    else
        return 0;
  }
  
  public static void Main(String[] args)
  {
    int n = readInt();
    stdin_sep();
    int[][] passepartout = new int[n][];
    for (int i = 0; i < n; i++)
    {
        int[] out0 = new int[2];
        for (int j = 0; j < 2; j++)
        {
            int out01 = readInt();
            stdin_sep();
            out0[j] = out01;
        }
        passepartout[i] = out0;
    }
    int m = readInt();
    stdin_sep();
    int[][] serrures = new int[m][];
    for (int k = 0; k < m; k++)
    {
        int[] out1 = new int[2];
        for (int l = 0; l < 2; l++)
        {
            int out_ = readInt();
            stdin_sep();
            out1[l] = out_;
        }
        serrures[k] = out1;
    }
    Console.Write(nbPassePartout(n, passepartout, m, serrures));
  }
  
}



<|start_filename|>out/calc.java<|end_filename|>
import java.util.*;

public class calc
{
  
  /*
La suite de fibonaci
*/
  static int fibo(int a, int b, int i)
  {
    int out_ = 0;
    int a2 = a;
    int b2 = b;
    for (int j = 0; j <= i + 1; j++)
    {
        System.out.print(j);
        out_ += a2;
        int tmp = b2;
        b2 += a2;
        a2 = tmp;
    }
    return out_;
  }
  public static void main(String args[])
  {
    System.out.print(fibo(1, 2, 4));
  }
  
}



<|start_filename|>out/affect_param.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


void foo(int a) {
    a = 4;
}
int main(void) {
    int a = 0;
    foo(a);
    printf("%d\n", a);
    return 0;
}




<|start_filename|>out/euler43.lua<|end_filename|>

--[[
The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property.

Let d1 be the 1st digit, d2 be the 2nd digit, and so on. In this way, we note the following:

d2d3d4=406 is divisible by 2
d3d4d5=063 is divisible by 3
d4d5d6=635 is divisible by 5
d5d6d7=357 is divisible by 7
d6d7d8=572 is divisible by 11
d7d8d9=728 is divisible by 13
d8d9d10=289 is divisible by 17
Find the sum of all 0 to 9 pandigital numbers with this property.

d4 % 2 == 0
(d3 + d4 + d5) % 3 == 0
d6 = 5 ou d6 = 0
(d5 * 100 + d6 * 10 + d7  ) % 7 == 0
(d6 * 100 + d7 * 10 + d8  ) % 11 == 0
(d7 * 100 + d8 * 10 + d9  ) % 13 == 0
(d8 * 100 + d9 * 10 + d10 ) % 17 == 0


d4 % 2 == 0
d6 = 5 ou d6 = 0

(d3 + d4 + d5) % 3 == 0
(d5 * 2 + d6 * 3 + d7) % 7 == 0
--]]
local allowed = {}
for i = 0, 9 do
    allowed[i + 1] = true
end
for i6 = 0, 1 do
    local d6 = i6 * 5
    if allowed[d6 + 1] then
        allowed[d6 + 1] = false
        for d7 = 0, 9 do
            if allowed[d7 + 1] then
                allowed[d7 + 1] = false
                for d8 = 0, 9 do
                    if allowed[d8 + 1] then
                        allowed[d8 + 1] = false
                        for d9 = 0, 9 do
                            if allowed[d9 + 1] then
                                allowed[d9 + 1] = false
                                for d10 = 1, 9 do
                                    if allowed[d10 + 1] and math.fmod(d6 * 100 + d7 * 10 + d8, 11) == 0 and math.fmod(d7 * 100 + d8 * 10 + d9, 13) == 0 and math.fmod(d8 * 100 + d9 * 10 + d10, 17) == 0 then
                                        allowed[d10 + 1] = false
                                        for d5 = 0, 9 do
                                            if allowed[d5 + 1] then
                                                allowed[d5 + 1] = false
                                                if math.fmod(d5 * 100 + d6 * 10 + d7, 7) == 0 then
                                                    for i4 = 0, 4 do
                                                        local d4 = i4 * 2
                                                        if allowed[d4 + 1] then
                                                            allowed[d4 + 1] = false
                                                            for d3 = 0, 9 do
                                                                if allowed[d3 + 1] then
                                                                    allowed[d3 + 1] = false
                                                                    if math.fmod(d3 + d4 + d5, 3) == 0 then
                                                                        for d2 = 0, 9 do
                                                                            if allowed[d2 + 1] then
                                                                                allowed[d2 + 1] = false
                                                                                for d1 = 0, 9 do
                                                                                if allowed[d1 + 1] then
                                                                                allowed[d1 + 1] = false
                                                                                io.write(string.format("%d%d%d%d%d%d%d%d%d%d + ", d1, d2, d3, d4, d5, d6, d7, d8, d9, d10))
                                                                                allowed[d1 + 1] = true
                                                                                end
                                                                                end
                                                                                allowed[d2 + 1] = true
                                                                            end
                                                                        end
                                                                    end
                                                                    allowed[d3 + 1] = true
                                                                end
                                                            end
                                                            allowed[d4 + 1] = true
                                                        end
                                                    end
                                                end
                                                allowed[d5 + 1] = true
                                            end
                                        end
                                        allowed[d10 + 1] = true
                                    end
                                end
                                allowed[d9 + 1] = true
                            end
                        end
                        allowed[d8 + 1] = true
                    end
                end
                allowed[d7 + 1] = true
            end
        end
        allowed[d6 + 1] = true
    end
end
io.write(string.format("%d\n", 0))


<|start_filename|>out/aaa_01hello.cs<|end_filename|>
using System;

public class aaa_01hello
{
  
  public static void Main(String[] args)
  {
    Console.Write("Hello World");
    int a = 5;
    Console.Write(((4 + 6) * 2) + " \n" + a + "foo");
    if (1 + 2 * 2 * (3 + 8) / 4 - 2 == 12 && true)
        Console.Write("True");
    else
        Console.Write("False");
    Console.Write("\n");
    if ((3 * (4 + 11) * 2 == 45) == false)
        Console.Write("True");
    else
        Console.Write("False");
    Console.Write(" ");
    if ((2 == 1) == false)
        Console.Write("True");
    else
        Console.Write("False");
    Console.Write(" " + (5 / 3 / 3) + (4 * 1 / 3 / 2 * 1));
    if (!(!(a == 0) && !(a == 4)))
        Console.Write("True");
    else
        Console.Write("False");
    if (true && !false && !(true && false))
        Console.Write("True");
    else
        Console.Write("False");
    Console.Write("\n");
  }
  
}



<|start_filename|>out/euler03.cs<|end_filename|>
using System;

public class euler03
{
  
  public static void Main(String[] args)
  {
    int maximum = 1;
    int b0 = 2;
    int a = 408464633;
    int sqrtia = (int)Math.Sqrt(a);
    while (a != 1)
    {
        int b = b0;
        bool found = false;
        while (b <= sqrtia)
        {
            if (a % b == 0)
            {
                a /= b;
                b0 = b;
                b = a;
                sqrtia = (int)Math.Sqrt(a);
                found = true;
            }
            b++;
        }
        if (!found)
        {
            Console.Write(a + "\n");
            a = 1;
        }
    }
  }
  
}



<|start_filename|>out/euler17.go<|end_filename|>
package main
import "fmt"

func main() {
  fmt.Printf("%d\n", 3 + 16)
  one_to_nine := 3 + 33
  fmt.Printf("%d\n", one_to_nine)
  one_to_ten := one_to_nine + 3
  one_to_twenty := one_to_ten + 73
  one_to_thirty := one_to_twenty + 6 * 9 + one_to_nine + 6
  one_to_forty := one_to_thirty + 6 * 9 + one_to_nine + 5
  one_to_fifty := one_to_forty + 5 * 9 + one_to_nine + 5
  one_to_sixty := one_to_fifty + 5 * 9 + one_to_nine + 5
  one_to_seventy := one_to_sixty + 5 * 9 + one_to_nine + 7
  one_to_eighty := one_to_seventy + 7 * 9 + one_to_nine + 6
  one_to_ninety := one_to_eighty + 6 * 9 + one_to_nine + 6
  one_to_ninety_nine := one_to_ninety + 6 * 9 + one_to_nine
  fmt.Printf("%d\n%d\n", one_to_ninety_nine, 100 * one_to_nine + one_to_ninety_nine * 10 + 10 * 9 * 99 + 7 * 9 + 11)
}



<|start_filename|>out/euler09.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e

main :: IO ()
main =
  {-
	a + b + c = 1000 && a * a + b * b = c * c
	-}
  let d a =
        if a <= 1000
        then let e b =
                   if b <= 1000
                   then do let c = 1000 - a - b
                           let a2b2 = a * a + b * b
                           let cc = c * c
                           if cc == a2b2 && c > a
                           then do printf "%d\n%d\n%d\n%d\n" (a::Int) (b::Int) (c::Int) ((a * b * c)::Int) :: IO()
                                   e (b + 1)
                           else e (b + 1)
                   else d (a + 1) in
                   e (a + 1)
        else return () in
        d 1




<|start_filename|>out/euler45.js<|end_filename|>
var util = require("util");
function triangle(n){
    if (~~(n % 2) == 0)
        return ~~(n / 2) * (n + 1);
    else
        return n * ~~((n + 1) / 2);
}
function penta(n){
    if (~~(n % 2) == 0)
        return ~~(n / 2) * (3 * n - 1);
    else
        return ~~((3 * n - 1) / 2) * n;
}
function hexa(n){
    return n * (2 * n - 1);
}
function findPenta2(n, a, b){
    if (b == a + 1)
        return penta(a) == n || penta(b) == n;
    var c = ~~((a + b) / 2);
    var p = penta(c);
    if (p == n)
        return true;
    else if (p < n)
        return findPenta2(n, c, b);
    else
        return findPenta2(n, a, c);
}
function findHexa2(n, a, b){
    if (b == a + 1)
        return hexa(a) == n || hexa(b) == n;
    var c = ~~((a + b) / 2);
    var p = hexa(c);
    if (p == n)
        return true;
    else if (p < n)
        return findHexa2(n, c, b);
    else
        return findHexa2(n, a, c);
}
for (var n = 285; n < 55386; n++)
{
    var t = triangle(n);
    if (findPenta2(t, ~~(n / 5), n) && findHexa2(t, ~~(n / 5), ~~(n / 2) + 10))
        util.print(n, "\n", t, "\n");
}



<|start_filename|>out/euler12.cpp<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

int eratostene(std::vector<int>& t, int max0) {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            int j = i * i;
            n++;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
}


int fillPrimesFactors(std::vector<int>& t, int n, std::vector<int>& primes, int nprimes) {
    for (int i = 0; i < nprimes; i++)
    {
        int d = primes[i];
        while (n % d == 0)
        {
            t[d]++;
            n /= d;
        }
        if (n == 1)
            return primes[i];
    }
    return n;
}


int find(int ndiv2) {
    int maximumprimes = 110;
    std::vector<int> era( maximumprimes );
    for (int j = 0; j < maximumprimes; j++)
        era[j] = j;
    int nprimes = eratostene(era, maximumprimes);
    std::vector<int> primes( nprimes, 0 );
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    for (int n = 1; n < 10001; n++)
    {
        std::vector<int> primesFactors( n + 2, 0 );
        int max0 = std::max(fillPrimesFactors(primesFactors, n, primes, nprimes), fillPrimesFactors(primesFactors, n + 1, primes, nprimes));
        primesFactors[2]--;
        int ndivs = 1;
        for (int i = 0; i <= max0; i++)
            if (primesFactors[i] != 0)
                ndivs *= 1 + primesFactors[i];
        if (ndivs > ndiv2)
            return n * (n + 1) / 2;
        //  print "n=" print n print "\t" print (n * (n + 1) / 2 ) print " " print ndivs print "\n" 
    }
    return 0;
}

int main() {
    std::cout << find(500) << "\n";
}



<|start_filename|>out/euler52.js<|end_filename|>
var util = require("util");
function chiffre_sort(a){
    if (a < 10)
        return a;
    else
    {
        var b = chiffre_sort(~~(a / 10));
        var c = ~~(a % 10);
        var d = ~~(b % 10);
        var e = ~~(b / 10);
        if (c < d)
            return c + b * 10;
        else
            return d + chiffre_sort(c + e * 10) * 10;
    }
}
function same_numbers(a, b, c, d, e, f){
    var ca = chiffre_sort(a);
    return ca == chiffre_sort(b) && ca == chiffre_sort(c) && ca == chiffre_sort(d) && ca == chiffre_sort(e) && ca == chiffre_sort(f);
}
var num = 142857;
if (same_numbers(num, num * 2, num * 3, num * 4, num * 6, num * 5))
    util.print(num, " ", num * 2, " ", num * 3, " ", num * 4, " ", num * 5, " ", num * 6, "\n");



<|start_filename|>out/euler02.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler02 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;


  sum : Integer;
  c : Integer;
  b : Integer;
  a : Integer;
begin
  a := 1;
  b := 2;
  sum := 0;
  while a < 4000000 loop
    if a rem 2 = 0
    then
      sum := sum + a;
    end if;
    c := a;
    a := b;
    b := b + c;
  end loop;
  PInt(sum);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/vigenere.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure vigenere is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PChar(c : in Character) is
begin
  Character'Write (Text_Streams.Stream (Current_Output), c);
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
function position_alphabet(c : in Character) return Integer is
  i : Integer;
begin
  i := Character'Pos(c);
  if i <= Character'Pos('Z') and then i >= Character'Pos('A')
  then
    return i - Character'Pos('A');
  else
    if i <= Character'Pos('z') and then i >= Character'Pos('a')
    then
      return i - Character'Pos('a');
    else
      return (-1);
    end if;
  end if;
end;
function of_position_alphabet(c : in Integer) return Character is
begin
  return Character'Val(c + Character'Pos('a'));
end;
type a is Array (Integer range <>) of Character;
type a_PTR is access a;
procedure crypte(taille_cle : in Integer; cle : in a_PTR; taille : in Integer; message : in a_PTR) is
  new0 : Integer;
  lettre : Integer;
  addon : Integer;
begin
  for i in integer range 0..taille - 1 loop
    lettre := position_alphabet(message(i));
    if lettre /= (-1)
    then
      addon := position_alphabet(cle(i rem taille_cle));
      new0 := (addon + lettre) rem 26;
      message(i) := of_position_alphabet(new0);
    end if;
  end loop;
end;

  taille_cle : Integer;
  taille : Integer;
  out2 : Character;
  out0 : Character;
  message : a_PTR;
  cle : a_PTR;
begin
  Get(taille_cle);
  SkipSpaces;
  cle := new a (0..taille_cle - 1);
  for index in integer range 0..taille_cle - 1 loop
    Get(out0);
    cle(index) := out0;
  end loop;
  SkipSpaces;
  Get(taille);
  SkipSpaces;
  message := new a (0..taille - 1);
  for index2 in integer range 0..taille - 1 loop
    Get(out2);
    message(index2) := out2;
  end loop;
  crypte(taille_cle, cle, taille, message);
  for i in integer range 0..taille - 1 loop
    PChar(message(i));
  end loop;
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/aaa_04loop.lua<|end_filename|>
function h (i)
  --[[  for j = i - 2 to i + 2 do
    if i % j == 5 then return true end
  end --]]
  local j = i - 2
  while j <= i + 2 do
      if math.fmod(i, j) == 5 then
          return true
      end
      j = j + 1
  end
  return false
end

local j = 0
for k = 0, 10 do
    j = j + k
    io.write(string.format("%d\n", j))
end
local i = 4
while i < 10 do
    io.write(i)
    i = i + 1
    j = j + i
end
io.write(string.format("%d%dFIN TEST\n", j, i))


<|start_filename|>out/euler39.go<|end_filename|>
package main
import "fmt"
import "math"

func main() {
  var t []int = make([]int, 1001)
  for i := 0; i < 1001; i++ {
      t[i] = 0
  }
  for a := 1; a < 1001; a++ {
      for b := 1; b < 1001; b++ {
          c2 := a * a + b * b
          c := int(math.Sqrt(float64(c2)))
          if c * c == c2 {
              p := a + b + c
              if p < 1001 {
                  t[p]++
              }
          }
      }
  }
  j := 0
  for k := 1; k < 1001; k++ {
      if t[k] > t[j] {
          j = k
      }
  }
  fmt.Printf("%d", j)
}



<|start_filename|>out/aaa_read0.cs<|end_filename|>
using System;
using System.Collections.Generic;

public class aaa_read0
{
  
  public static void Main(String[] args)
  {
    int len = int.Parse(Console.ReadLine());
    Console.Write(len + "\n");
  }
  
}



<|start_filename|>out/aaa_integer.cs<|end_filename|>
using System;

public class aaa_integer
{
  
  public static void Main(String[] args)
  {
    int i = 0;
    i--;
    Console.Write(i + "\n");
    i += 55;
    Console.Write(i + "\n");
    i *= 13;
    Console.Write(i + "\n");
    i /= 2;
    Console.Write(i + "\n");
    i++;
    Console.Write(i + "\n");
    i /= 3;
    Console.Write(i + "\n");
    i--;
    Console.Write(i + "\n");
    /*
http://fr.wikipedia.org/wiki/Modulo_(op%C3%A9ration)#Trois_d.C3.A9finitions_de_la_fonction_modulo
*/
    Console.Write((117 / 17) + "\n" + (117 / -17) + "\n" + (-117 / 17) + "\n" + (-117 / -17) + "\n" + (117 % 17) + "\n" + (117 % -17) + "\n" + (-117 % 17) + "\n" + (-117 % -17) + "\n");
  }
  
}



<|start_filename|>out/carre.java<|end_filename|>
import java.util.*;

public class carre
{
  static Scanner scanner = new Scanner(System.in);
  static int[] read_int_line()
  {
    String[] s = scanner.nextLine().split(" ");
    int[] out = new int[s.length];
    for (int i = 0; i < s.length; i++)
      out[i] = Integer.parseInt(s[i]);
    return out;
  }

  
  public static void main(String args[])
  {
    int x = Integer.parseInt(scanner.nextLine());
    int y = Integer.parseInt(scanner.nextLine());
    int[][] tab = new int[y][];
    for (int d = 0; d < y; d++)
        tab[d] = read_int_line();
    for (int ix = 1; ix < x; ix++)
        for (int iy = 1; iy < y; iy++)
            if (tab[iy][ix] == 1)
                tab[iy][ix] = Math.min(Math.min(tab[iy][ix - 1], tab[iy - 1][ix]), tab[iy - 1][ix - 1]) + 1;
    for (int jy = 0; jy < y; jy++)
    {
        for (int jx = 0; jx < x; jx++)
            System.out.printf("%d ", tab[jy][jx]);
        System.out.print("\n");
    }
  }
  
}



<|start_filename|>out/euler07.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
divisible n t size =
  let a i =
        if i <= size - 1
        then ifM (((==) 0) <$> ((rem n) <$> (readIOA t i)))
                 (return True)
                 (a (i + 1))
        else return False in
        a 0

find n t used nth =
  let b c d =
        if d /= nth
        then ifM (divisible c t d)
                 (do let g = c + 1
                     b g d)
                 (do writeIOA t d c
                     let e = c + 1
                     let f = d + 1
                     b e f)
        else readIOA t (d - 1) in
        b n used

main =
  do t <- array_init 10001 (\ i ->
                              return 2)
     printf "%d\n" =<< ((find 3 t 1 10001)::IO Int)




<|start_filename|>out/pathfindList.js<|end_filename|>
var util = require("util");
var fs = require("fs");
var current_char = null;
function read_char0(){
    var buf = Buffer.alloc(1);
    fs.readSync(process.stdin.fd, buf, 0, 1)[0];
    return buf.toString();
}
function stdinsep(){
    if (current_char == null) current_char = read_char0();
    while (current_char.match(/[\n\t\s]/g))
        current_char = read_char0();
}
function read_int_(){
  if (current_char == null) current_char = read_char0();
  var sign = 1;
  if (current_char == '-'){
     current_char = read_char0();
     sign = -1;
  }
  var out = 0;
  while (true){
    if (current_char.match(/[0-9]/g)){
      out = out * 10 + current_char.charCodeAt(0) - '0'.charCodeAt(0);
      current_char = read_char0();
    }else{
      return out * sign;
    }
  }
}

function pathfind_aux(cache, tab, len, pos){
    if (pos >= len - 1)
        return 0;
    else if (cache[pos] != -1)
        return cache[pos];
    else
    {
        cache[pos] = len * 2;
        var posval = pathfind_aux(cache, tab, len, tab[pos]);
        var oneval = pathfind_aux(cache, tab, len, pos + 1);
        var out0 = 0;
        if (posval < oneval)
            out0 = 1 + posval;
        else
            out0 = 1 + oneval;
        cache[pos] = out0;
        return out0;
    }
}
function pathfind(tab, len){
    var cache = new Array(len);
    for (var i = 0; i < len; i++)
        cache[i] = -1;
    return pathfind_aux(cache, tab, len, 0);
}
var len = 0;
len = read_int_();
stdinsep();
var tab = new Array(len);
for (var i = 0; i < len; i++)
{
    var tmp = 0;
    tmp = read_int_();
    stdinsep();
    tab[i] = tmp;
}
var result = pathfind(tab, len);
util.print(result);



<|start_filename|>out/euler10.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
eratostene t max0 =
  let a i b =
        if i <= max0 - 1
        then ifM (((==) i) <$> (readIOA t i))
                 (do let c = b + i
                     if (max0 `quot` i) > i
                     then do let j = i * i
                             let d e =
                                   if e < max0 && e > 0
                                   then do writeIOA t e 0
                                           let f = e + i
                                           d f
                                   else a (i + 1) c in
                                   d j
                     else a (i + 1) c)
                 (a (i + 1) b)
        else return b in
        a 2 0

main =
  {- normalement on met 2000 000 mais là on se tape des int overflow dans plein de langages -}
  do t <- array_init 100000 (\ i ->
                               return i)
     writeIOA t 1 0
     printf "%d\n" =<< ((eratostene t 100000)::IO Int)




<|start_filename|>out/longest_increasing_subsequence.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure longest_increasing_subsequence is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

procedure SkipSpaces is
  C : Character;
  Eol : Boolean;
begin
  loop
    Look_Ahead(C, Eol);
    exit when Eol or C /= ' ';
    Get(C);
  end loop;
end;
type f is Array (Integer range <>) of Integer;
type f_PTR is access f;
function dichofind(len : in Integer; tab : in f_PTR; tofind : in Integer; a : in Integer; b : in Integer) return Integer is
  c : Integer;
begin
  if a >= b - 1
  then
    return a;
  else
    c := (a + b) / 2;
    if tab(c) < tofind
    then
      return dichofind(len, tab, tofind, c, b);
    else
      return dichofind(len, tab, tofind, a, c);
    end if;
  end if;
end;
function process(len : in Integer; tab : in f_PTR) return Integer is
  size : f_PTR;
  k : Integer;
begin
  size := new f (0..len - 1);
  for j in integer range 0..len - 1 loop
    if j = 0
    then
      size(j) := 0;
    else
      size(j) := len * 2;
    end if;
  end loop;
  for i in integer range 0..len - 1 loop
    k := dichofind(len, size, tab(i), 0, len - 1);
    if size(k + 1) > tab(i)
    then
      size(k + 1) := tab(i);
    end if;
  end loop;
  for l in integer range 0..len - 1 loop
    PInt(size(l));
    PString(new char_array'( To_C(" ")));
  end loop;
  for m in integer range 0..len - 1 loop
    k := len - 1 - m;
    if size(k) /= len * 2
    then
      return k;
    end if;
  end loop;
  return 0;
end;

  n : Integer;
  len : Integer;
  d : f_PTR;
begin
  Get(n);
  SkipSpaces;
  for i in integer range 1..n loop
    Get(len);
    SkipSpaces;
    d := new f (0..len - 1);
    for e in integer range 0..len - 1 loop
      Get(d(e));
      SkipSpaces;
    end loop;
    PInt(process(len, d));
    PString(new char_array'( To_C("" & Character'Val(10))));
  end loop;
end;


<|start_filename|>out/testing_count.cs<|end_filename|>
using System;

public class testing_count
{
  
  public static void Main(String[] args)
  {
    int[] tab = new int[40];
    for (int i = 0; i < 40; i++)
        tab[i] = i * i;
    Console.Write((tab).Length + "\n");
  }
  
}



<|start_filename|>out/euler39.cs<|end_filename|>
using System;

public class euler39
{
  
  public static void Main(String[] args)
  {
    int[] t = new int[1001];
    for (int i = 0; i < 1001; i++)
        t[i] = 0;
    for (int a = 1; a < 1001; a++)
        for (int b = 1; b < 1001; b++)
        {
            int c2 = a * a + b * b;
            int c = (int)Math.Sqrt(c2);
            if (c * c == c2)
            {
                int p = a + b + c;
                if (p < 1001)
                    t[p]++;
            }
        }
    int j = 0;
    for (int k = 1; k < 1001; k++)
        if (t[k] > t[j])
            j = k;
    Console.Write(j);
  }
  
}



<|start_filename|>out/aaa_read0.cpp<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    int len;
    std::cin >> len;
    std::cout << len << "\n";
}



<|start_filename|>out/aaa_07triplet.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray

main :: IO ()
main =
  let e i =
        if i <= 3
        then do d <- (join (newListArray . (,) 0 . subtract 1 <$> return 3 <*> fmap (map read . words) getLine))
                a <- readIOA d 0
                b <- readIOA d 1
                c <- readIOA d 2
                printf "a = %d b = %dc =%d\n" (a::Int) (b::Int) (c::Int) :: IO()
                e (i + 1)
        else do l <- (join (newListArray . (,) 0 . subtract 1 <$> return 10 <*> fmap (map read . words) getLine))
                let f j =
                      if j <= 9
                      then do printf "%d\n" =<< ((readIOA l j)::IO Int)
                              f (j + 1)
                      else return () in
                      f 0 in
        e 1




<|start_filename|>out/aaa_05array.java<|end_filename|>
import java.util.*;

public class aaa_05array
{
  
  static boolean[] id(boolean[] b)
  {
    return b;
  }
  static void g(boolean[] t, int index)
  {
    t[index] = false;
  }
  public static void main(String args[])
  {
    int j = 0;
    boolean[] a = new boolean[5];
    for (int i = 0; i < 5; i++)
    {
        System.out.print(i);
        j += i;
        a[i] = i % 2 == 0;
    }
    System.out.printf("%d ", j);
    if (a[0])
        System.out.print("True");
    else
        System.out.print("False");
    System.out.print("\n");
    g(id(a), 0);
    if (a[0])
        System.out.print("True");
    else
        System.out.print("False");
    System.out.print("\n");
  }
  
}



<|start_filename|>out/aaa_02if.cs<|end_filename|>
using System;

public class aaa_02if
{
  static bool f(int i)
  {
    if (i == 0)
        return true;
    return false;
  }
  
  public static void Main(String[] args)
  {
    if (f(4))
        Console.Write("true <-\n ->\n");
    else
        Console.Write("false <-\n ->\n");
    Console.Write("small test end\n");
  }
  
}



<|start_filename|>out/euler12.js<|end_filename|>
var util = require("util");
function eratostene(t, max0){
    var n = 0;
    for (var i = 2; i < max0; i++)
        if (t[i] == i)
        {
            var j = i * i;
            n++;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
}
function fillPrimesFactors(t, n, primes, nprimes){
    for (var i = 0; i < nprimes; i++)
    {
        var d = primes[i];
        while (~~(n % d) == 0)
        {
            t[d]++;
            n = ~~(n / d);
        }
        if (n == 1)
            return primes[i];
    }
    return n;
}
function find(ndiv2){
    var maximumprimes = 110;
    var era = new Array(maximumprimes);
    for (var j = 0; j < maximumprimes; j++)
        era[j] = j;
    var nprimes = eratostene(era, maximumprimes);
    var primes = new Array(nprimes);
    for (var o = 0; o < nprimes; o++)
        primes[o] = 0;
    var l = 0;
    for (var k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    for (var n = 1; n < 10001; n++)
    {
        var primesFactors = new Array(n + 2);
        for (var m = 0; m <= n + 1; m++)
            primesFactors[m] = 0;
        var max0 = Math.max(fillPrimesFactors(primesFactors, n, primes, nprimes), fillPrimesFactors(primesFactors, n + 1, primes, nprimes));
        primesFactors[2]--;
        var ndivs = 1;
        for (var i = 0; i <= max0; i++)
            if (primesFactors[i] != 0)
                ndivs *= 1 + primesFactors[i];
        if (ndivs > ndiv2)
            return ~~(n * (n + 1) / 2);
        //  print "n=" print n print "\t" print (n * (n + 1) / 2 ) print " " print ndivs print "\n" 
    }
    return 0;
}
util.print(find(500), "\n");



<|start_filename|>out/euler22.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0

main :: IO ()
score () =
  do skip_whitespaces
     len <- read_int
     skip_whitespaces
     let a i b =
           if i <= len
           then do c <- getChar
                   let d = b + (ord c) - (ord 'A') + 1
                   {-		print c print " " print sum print " " -}
                   a (i + 1) d
           else return b in
           a 1 0

main =
  do n <- read_int
     let e i f =
           if i <= n
           then do g <- (((+) f) <$> (((*) i) <$> (score ())))
                   e (i + 1) g
           else printf "%d\n" (f::Int) :: IO() in
           e 1 0




<|start_filename|>out/aaa_013option.cc<|end_filename|>
#include <iostream>
#include <vector>
struct foo {
    int a;
    int* b;
    std::vector<int> * c;
    std::vector<int*> * d;
    std::vector<int> * e;
    foo * f;
    std::vector<foo *> * g;
    std::vector<foo *> * h;
};


int default0(int* a, foo * b, std::vector<int*> * c, std::vector<foo *> * d, std::vector<int> * e, std::vector<foo *> * f) {
    return 0;
}


void aa(foo * b) {
    
}

int main() {
    int* a = nullptr;
    std::cout << "___\n";
}



<|start_filename|>out/euler30.java<|end_filename|>
import java.util.*;

public class euler30
{
  
  
  public static void main(String args[])
  {
    /*
a + b * 10 + c * 100 + d * 1000 + e * 10 000 =
  a ^ 5 +
  b ^ 5 +
  c ^ 5 +
  d ^ 5 +
  e ^ 5
*/
    int[] p = new int[10];
    for (int i = 0; i < 10; i++)
        p[i] = i * i * i * i * i;
    int sum = 0;
    for (int a = 0; a < 10; a++)
        for (int b = 0; b < 10; b++)
            for (int c = 0; c < 10; c++)
                for (int d = 0; d < 10; d++)
                    for (int e = 0; e < 10; e++)
                        for (int f = 0; f < 10; f++)
                        {
                            int s = p[a] + p[b] + p[c] + p[d] + p[e] + p[f];
                            int r = a + b * 10 + c * 100 + d * 1000 + e * 10000 + f * 100000;
                            if (s == r && r != 1)
                            {
                                System.out.printf("%d%d%d%d%d%d %d\n", f, e, d, c, b, a, r);
                                sum += r;
                            }
                        }
    System.out.print(sum);
  }
  
}



<|start_filename|>out/aaa_missing.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
result len tab =
  do tab2 <- array_init len (\ i ->
                               return False)
     let a i1 =
           if i1 <= len - 1
           then do printf "%d " =<< ((readIOA tab i1)::IO Int)
                   join $ writeIOA tab2 <$> (readIOA tab i1) <*> return True
                   a (i1 + 1)
           else do printf "\n" :: IO ()
                   let b i2 =
                         if i2 <= len - 1
                         then ifM (fmap not (readIOA tab2 i2))
                                  (return i2)
                                  (b (i2 + 1))
                         else return (- 1) in
                         b 0 in
           a 0

main =
  do len <- (fmap read getLine)
     printf "%d\n" (len::Int) :: IO()
     tab <- (join (newListArray . (,) 0 . subtract 1 <$> return len <*> fmap (map read . words) getLine))
     printf "%d\n" =<< ((result len tab)::IO Int)




<|start_filename|>out/euler45.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure euler45 is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;

function triangle(n : in Integer) return Integer is
begin
  if n rem 2 = 0
  then
    return (n / 2) * (n + 1);
  else
    return n * ((n + 1) / 2);
  end if;
end;
function penta(n : in Integer) return Integer is
begin
  if n rem 2 = 0
  then
    return (n / 2) * (3 * n - 1);
  else
    return ((3 * n - 1) / 2) * n;
  end if;
end;
function hexa(n : in Integer) return Integer is
begin
  return n * (2 * n - 1);
end;
function findPenta2(n : in Integer; a : in Integer; b : in Integer) return Boolean is
  p : Integer;
  c : Integer;
begin
  if b = a + 1
  then
    return penta(a) = n or else penta(b) = n;
  end if;
  c := (a + b) / 2;
  p := penta(c);
  if p = n
  then
    return TRUE;
  else
    if p < n
    then
      return findPenta2(n, c, b);
    else
      return findPenta2(n, a, c);
    end if;
  end if;
end;
function findHexa2(n : in Integer; a : in Integer; b : in Integer) return Boolean is
  p : Integer;
  c : Integer;
begin
  if b = a + 1
  then
    return hexa(a) = n or else hexa(b) = n;
  end if;
  c := (a + b) / 2;
  p := hexa(c);
  if p = n
  then
    return TRUE;
  else
    if p < n
    then
      return findHexa2(n, c, b);
    else
      return findHexa2(n, a, c);
    end if;
  end if;
end;

  t : Integer;
begin
  for n in integer range 285..55385 loop
    t := triangle(n);
    if findPenta2(t, n / 5, n) and then findHexa2(t, n / 5, n / 2 + 10)
    then
      PInt(n);
      PString(new char_array'( To_C("" & Character'Val(10))));
      PInt(t);
      PString(new char_array'( To_C("" & Character'Val(10))));
    end if;
  end loop;
end;


<|start_filename|>out/montagnes.groovy<|end_filename|>
import groovy.transform.Field
import java.util.*

int montagnes0(int[] tab, int len)
{
  int max0 = 1
  int j = 1
  int i = len - 2
  while (i >= 0)
  {
      int x = tab[i]
      while (j >= 0 && x > tab[len - j])
          j--
      j++
      tab[len - j] = x
      if (j > max0)
          max0 = j
      i--
  }
  return max0
}
@Field Scanner scanner = new Scanner(System.in)
int len = 0
if (scanner.hasNext("^-")) {
  scanner.next("^-")
  len = -scanner.nextInt()
}else{
  len = scanner.nextInt()
}
scanner.findWithinHorizon("[\n\r ]*", 1)
int[] tab = new int[len]
for (int i = 0; i < len; i++)
{
    int x = 0
    if (scanner.hasNext("^-")) {
      scanner.next("^-")
      x = -scanner.nextInt()
    }else{
      x = scanner.nextInt()
    }
    scanner.findWithinHorizon("[\n\r ]*", 1)
    tab[i] = x
}
print(montagnes0(tab, len))



<|start_filename|>out/euler19.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int is_leap(int year) {
    return year % 400 == 0 || year % 100 != 0 && year % 4 == 0;
}

int ndayinmonth(int month, int year) {
    if (month == 0)
        return 31;
    else if (month == 1)
        if (is_leap(year))
            return 29;
        else
            return 28;
    else if (month == 2)
        return 31;
    else if (month == 3)
        return 30;
    else if (month == 4)
        return 31;
    else if (month == 5)
        return 30;
    else if (month == 6)
        return 31;
    else if (month == 7)
        return 31;
    else if (month == 8)
        return 30;
    else if (month == 9)
        return 31;
    else if (month == 10)
        return 30;
    else if (month == 11)
        return 31;
    return 0;
}
int main(void) {
    int month = 0;
    int year = 1901;
    int dayofweek = 1;
    /* 01-01-1901 : mardi */
    int count = 0;
    while (year != 2001)
    {
        int ndays = ndayinmonth(month, year);
        dayofweek = (dayofweek + ndays) % 7;
        month++;
        if (month == 12)
        {
            month = 0;
            year++;
        }
        if (dayofweek % 7 == 6)
            count++;
    }
    printf("%d\n", count);
    return 0;
}




<|start_filename|>out/aaa_10stringsarray.js<|end_filename|>
var util = require("util");
function idstring(s){
    return s;
}
function printstring(s){
    util.print(idstring(s), "\n");
}
function print_toto(t){
    util.print(t["s"], " = ", t["v"], "\n");
}
var tab = new Array(2);
for (var i = 0; i < 2; i++)
    tab[i] = idstring("chaine de test");
for (var j = 0; j < 2; j++)
    printstring(idstring(tab[j]));
var a = {
    "s":"one",
    "v":1};
print_toto(a);



<|start_filename|>out/sort.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
: copytab { tab len }
  HERE len cells allot { o }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    tab  i cells +  @ o  i cells +  !
   1 + REPEAT 2DROP
  o exit
;


: bubblesort { tab len }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    len 1 - i 1 + BEGIN 2dup >= WHILE DUP { j }
      tab  i cells +  @ tab  j cells +  @ >
      IF
        tab  i cells +  @ { tmp }
        tab  j cells +  @ tab  i cells +  !
        tmp tab  j cells +  !
      THEN
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
;


: qsort0 recursive { tab len i j }
  i j <
  IF
    i { i0 }
    j { j0 }
    \  pivot : tab[0] 
    
    BEGIN
      i j <>
    WHILE
      tab  i cells +  @ tab  j cells +  @ >
      IF
        i j 1 - =
        IF
          \  on inverse simplement
          
          tab  i cells +  @ { tmp }
          tab  j cells +  @ tab  i cells +  !
          tmp tab  j cells +  !
          i 1 + TO i
        ELSE
          \  on place tab[i+1] à la place de tab[j], tab[j] à la place de tab[i] et tab[i] à la place de tab[i+1] 
          
          tab  i cells +  @ { tmp }
          tab  j cells +  @ tab  i cells +  !
          tab  i 1 + cells +  @ tab  j cells +  !
          tmp tab  i 1 + cells +  !
          i 1 + TO i
        THEN
      ELSE
        j 1 - TO j
      THEN
    REPEAT
    tab len i0 i 1 - qsort0
    tab len i 1 + j0 qsort0
  THEN
;

: main
  2 { len }
  read-int TO len
  skipspaces
  HERE len cells allot { tab }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i_ }
    0 { tmp }
    read-int TO tmp
    skipspaces
    tmp tab  i_ cells +  !
   1 + REPEAT 2DROP
  tab len copytab { tab2 }
  tab2 len bubblesort
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    tab2  i cells +  @ s>d 0 d.r
    S"  " TYPE
   1 + REPEAT 2DROP
  S\" \n" TYPE
  tab len copytab { tab3 }
  tab3 len 0 len 1 - qsort0
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    tab3  i cells +  @ s>d 0 d.r
    S"  " TYPE
   1 + REPEAT 2DROP
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/record2.java<|end_filename|>
import java.util.*;

public class record2
{
  static Scanner scanner = new Scanner(System.in);
  static class toto {
    public int foo;
    public int bar;
    public int blah;
  }
  static toto mktoto(int v1)
  {
    toto t = new toto();
    t.foo = v1;
    t.bar = 0;
    t.blah = 0;
    return t;
  }
  static int result(toto t)
  {
    t.blah++;
    return t.foo + t.blah * t.bar + t.bar * t.foo;
  }
  public static void main(String args[])
  {
    toto t = mktoto(4);
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      t.bar = -scanner.nextInt();
    }else{
      t.bar = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      t.blah = -scanner.nextInt();
    }else{
      t.blah = scanner.nextInt();
    }
    System.out.print(result(t));
  }
  
}



<|start_filename|>out/npi.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
skip_whitespaces :: IO ()
skip_whitespaces =
  ifM isEOF
      (return ())
      (do c <- hLookAhead stdin
          if c == ' ' || c == '\n' || c == '\t' || c == '\r' then
           do getChar
              skip_whitespaces
           else return ())
read_int_a :: Int -> IO Int
read_int_a b =
  ifM isEOF
      (return b)
      (do c <- hLookAhead stdin
          if isNumber c then
           do getChar
              read_int_a (b * 10 + ord c - 48)
           else return b)

read_int :: IO Int
read_int =
   do c <- hLookAhead stdin
      sign <- if c == '-'
                 then fmap (\x -> -1::Int) $ hGetChar stdin
                 else return 1
      (* sign) <$> read_int_a 0
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
is_number c =
  return ((ord c) <= (ord '9') && (ord c) >= (ord '0'))

npi0 str len =
  do stack <- array_init len (\ i ->
                                return 0)
     let a b d =
           if d < len
           then ifM (((==) ' ') <$> (readIOA str d))
                    (do let n = d + 1
                        a b n)
                    (ifM ((readIOA str d) >>= is_number)
                         (let g h j =
                                ifM (((/=) ' ') <$> (readIOA str j))
                                    (do l <- ((-) <$> (((+) (h * 10)) <$> (fmap ord (readIOA str j))) <*> (return (ord '0')))
                                        let m = j + 1
                                        g l m)
                                    (do writeIOA stack b h
                                        let k = b + 1
                                        a k j) in
                                g 0 d)
                         (ifM (((==) '+') <$> (readIOA str d))
                              (do writeIOA stack (b - 2) =<< ((+) <$> (readIOA stack (b - 2)) <*> (readIOA stack (b - 1)))
                                  let e = b - 1
                                  let f = d + 1
                                  a e f)
                              (a b d)))
           else readIOA stack 0 in
           a 0 0

main =
  do o <- read_int
     skip_whitespaces
     tab <- array_init o (\ i ->
                            getChar)
     result <- npi0 tab o
     printf "%d" (result :: Int) :: IO ()




<|start_filename|>out/euler10.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: eratostene { t max0 }
  0 { sum }
  max0 1 - 2 BEGIN 2dup >= WHILE DUP { i }
    t  i cells +  @ i =
    IF
      sum i + TO sum
      max0 i // i >
      IF
        i i * { j }
        BEGIN
          j max0 < j 0 > AND
        WHILE
          0 t  j cells +  !
          j i + TO j
        REPEAT
      THEN
    THEN
   1 + REPEAT 2DROP
  sum exit
;

: main
  100000 { n }
  \  normalement on met 2000 000 mais là on se tape des int overflow dans plein de langages 
  
  HERE n cells allot { t }
  n 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    i t  i cells +  !
   1 + REPEAT 2DROP
  0 t  1 cells +  !
  t n eratostene s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/euler15.java<|end_filename|>
import java.util.*;

public class euler15
{
  
  
  public static void main(String args[])
  {
    int n = 10;
    //  normalement on doit mettre 20 mais là on se tape un overflow 
    n++;
    int[][] tab = new int[n][];
    for (int i = 0; i < n; i++)
    {
        int[] tab2 = new int[n];
        for (int j = 0; j < n; j++)
            tab2[j] = 0;
        tab[i] = tab2;
    }
    for (int l = 0; l < n; l++)
    {
        tab[n - 1][l] = 1;
        tab[l][n - 1] = 1;
    }
    for (int o = 2; o <= n; o++)
    {
        int r = n - o;
        for (int p = 2; p <= n; p++)
        {
            int q = n - p;
            tab[r][q] = tab[r + 1][q] + tab[r][q + 1];
        }
    }
    for (int m = 0; m < n; m++)
    {
        for (int k = 0; k < n; k++)
            System.out.printf("%d ", tab[m][k]);
        System.out.print("\n");
    }
    System.out.printf("%d\n", tab[0][0]);
  }
  
}



<|start_filename|>out/euler15.fs<|end_filename|>
: main
  10 { n }
  \  normalement on doit mettre 20 mais là on se tape un overflow 
  
  n 1 + TO n
  HERE n cells allot { tab }
  n 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    HERE n cells allot { tab2 }
    n 1 - 0 BEGIN 2dup >= WHILE DUP { j }
      0 tab2  j cells +  !
     1 + REPEAT 2DROP
    tab2 tab  i cells +  !
   1 + REPEAT 2DROP
  n 1 - 0 BEGIN 2dup >= WHILE DUP { l }
    1 tab  n 1 - cells +  @  l cells +  !
    1 tab  l cells +  @  n 1 - cells +  !
   1 + REPEAT 2DROP
  n 2 BEGIN 2dup >= WHILE DUP { o }
    n o - { r }
    n 2 BEGIN 2dup >= WHILE DUP { p }
      n p - { q }
      tab  r 1 + cells +  @  q cells +  @ tab  r cells +  @  q 1 + cells +  @ + tab  r cells +  @  q cells +  !
     1 + REPEAT 2DROP
   1 + REPEAT 2DROP
  n 1 - 0 BEGIN 2dup >= WHILE DUP { m }
    n 1 - 0 BEGIN 2dup >= WHILE DUP { k }
      tab  m cells +  @  k cells +  @ s>d 0 d.r
      S"  " TYPE
     1 + REPEAT 2DROP
    S\" \n" TYPE
   1 + REPEAT 2DROP
  tab  0 cells +  @  0 cells +  @ s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/sqrttest.java<|end_filename|>
import java.util.*;

public class sqrttest
{
  
  
  public static void main(String args[])
  {
    System.out.printf("%d %d %d %d %d %d ", (int)Math.sqrt(4), (int)Math.sqrt(16), (int)Math.sqrt(20), (int)Math.sqrt(1000), (int)Math.sqrt(500), (int)Math.sqrt(10));
  }
  
}



<|start_filename|>out/aaa_041comment.cpp<|end_filename|>
#include <iostream>
#include <vector>

int main() {
    int i = 4;
    // while i < 10 do 
    std::cout << i;
    i++;
    //   end 
    std::cout << i;
}



<|start_filename|>out/aaa_00hello.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
main =
  printf "Hello World\n" :: IO ()




<|start_filename|>out/str2.go<|end_filename|>
package main
import "fmt"

func main() {
  fmt.Printf("ma petite chaine en or")
}



<|start_filename|>out/euler50.cc<|end_filename|>
#include <iostream>
#include <vector>
#include <algorithm>

int eratostene(std::vector<int> * t, int max0) {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t->at(i) == i)
        {
            n++;
            if (max0 / i > i)
            {
                int j = i * i;
                while (j < max0 && j > 0)
                {
                    t->at(j) = 0;
                    j += i;
                }
            }
        }
    return n;
}

int main() {
    int maximumprimes = 1000001;
    std::vector<int> *era = new std::vector<int>( maximumprimes );
    for (int j = 0; j < maximumprimes; j++)
        era->at(j) = j;
    int nprimes = eratostene(era, maximumprimes);
    std::vector<int> *primes = new std::vector<int>( nprimes );
    std::fill(primes->begin(), primes->end(), 0);
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era->at(k) == k)
        {
            primes->at(l) = k;
            l++;
        }
    std::cout << l << " == " << nprimes << "\n";
    std::vector<int> *sum = new std::vector<int>( nprimes );
    for (int i_ = 0; i_ < nprimes; i_++)
        sum->at(i_) = primes->at(i_);
    int maxl = 0;
    bool process = true;
    int stop = maximumprimes - 1;
    int len = 1;
    int resp = 1;
    while (process)
    {
        process = false;
        for (int i = 0; i <= stop; i++)
            if (i + len < nprimes)
            {
                sum->at(i) += primes->at(i + len);
                if (maximumprimes > sum->at(i))
                {
                    process = true;
                    if (era->at(sum->at(i)) == sum->at(i))
                    {
                        maxl = len;
                        resp = sum->at(i);
                    }
                }
                else
                    stop = std::min(stop, i);
            }
        len++;
    }
    std::cout << resp << "\n" << maxl << "\n";
}



<|start_filename|>out/aaa_013option.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

typedef struct foo {
  int a;
    int* b;
    int* c;
    int** d;
    int* e;
    struct foo * f;
    struct foo ** g;
    struct foo ** h;
} foo;

int default0(int* a, struct foo * b, int** c, struct foo ** d, int* e, struct foo ** f) {
    return 0;
}

void aa(struct foo * b) {
    
}
int main(void) {
    int* a = NULL;
    printf("___\n");
    return 0;
}




<|start_filename|>out/cambriolage.java<|end_filename|>
import java.util.*;

public class cambriolage
{
  static Scanner scanner = new Scanner(System.in);
  static int nbPassePartout(int n, int[][] passepartout, int m, int[][] serrures)
  {
    int max_ancient = 0;
    int max_recent = 0;
    for (int i = 0; i < m; i++)
    {
        if (serrures[i][0] == -1 && serrures[i][1] > max_ancient)
            max_ancient = serrures[i][1];
        if (serrures[i][0] == 1 && serrures[i][1] > max_recent)
            max_recent = serrures[i][1];
    }
    int max_ancient_pp = 0;
    int max_recent_pp = 0;
    for (int i = 0; i < n; i++)
    {
        int[] pp = passepartout[i];
        if (pp[0] >= max_ancient && pp[1] >= max_recent)
            return 1;
        max_ancient_pp = Math.max(max_ancient_pp, pp[0]);
        max_recent_pp = Math.max(max_recent_pp, pp[1]);
    }
    if (max_ancient_pp >= max_ancient && max_recent_pp >= max_recent)
        return 2;
    else
        return 0;
  }
  public static void main(String args[])
  {
    int n;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      n = scanner.nextInt();
    } else {
      n = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int[][] passepartout = new int[n][];
    for (int i = 0; i < n; i++)
    {
        int[] out0 = new int[2];
        for (int j = 0; j < 2; j++)
        {
            int out01;
            if (scanner.hasNext("^-")) {
              scanner.next("^-");
              out01 = scanner.nextInt();
            } else {
              out01 = scanner.nextInt();
            }
            scanner.findWithinHorizon("[\n\r ]*", 1);
            out0[j] = out01;
        }
        passepartout[i] = out0;
    }
    int m;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      m = scanner.nextInt();
    } else {
      m = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int[][] serrures = new int[m][];
    for (int k = 0; k < m; k++)
    {
        int[] out1 = new int[2];
        for (int l = 0; l < 2; l++)
        {
            int out_;
            if (scanner.hasNext("^-")) {
              scanner.next("^-");
              out_ = scanner.nextInt();
            } else {
              out_ = scanner.nextInt();
            }
            scanner.findWithinHorizon("[\n\r ]*", 1);
            out1[l] = out_;
        }
        serrures[k] = out1;
    }
    System.out.print(nbPassePartout(n, passepartout, m, serrures));
  }
  
}



<|start_filename|>out/longest_increasing_subsequence.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

(<&&>) a b =
	do c <- a
	   if c then b
		 else return False
(<||>) a b =
	do c <- a
	   if c then return True
		 else b
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
writeIOA :: IOArray Int a -> Int -> a -> IO ()
writeIOA = writeArray
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
dichofind len tab tofind a b =
  if a >= b - 1
  then return a
  else do let c = (a + b) `quot` 2
          ifM (((>) tofind) <$> (readIOA tab c))
              (dichofind len tab tofind c b)
              (dichofind len tab tofind a c)

process len tab =
  do size <- array_init len (\ j ->
                               return (if j == 0
                                       then 0
                                       else len * 2))
     let d i =
           if i <= len - 1
           then do k <- join $ dichofind len size <$> (readIOA tab i) <*> return 0 <*> return (len - 1)
                   ifM ((>) <$> (readIOA size (k + 1)) <*> (readIOA tab i))
                       (do writeIOA size (k + 1) =<< (readIOA tab i)
                           d (i + 1))
                       (d (i + 1))
           else let e l =
                      if l <= len - 1
                      then do printf "%d " =<< ((readIOA size l)::IO Int)
                              e (l + 1)
                      else let f m =
                                 if m <= len - 1
                                 then do let k = len - 1 - m
                                         ifM (((/=) (len * 2)) <$> (readIOA size k))
                                             (return k)
                                             (f (m + 1))
                                 else return 0 in
                                 f 0 in
                      e 0 in
           d 0

main =
  do n <- (fmap read getLine)
     let g i =
           if i <= n
           then do len <- (fmap read getLine)
                   printf "%d\n" =<< ((process len =<< (join (newListArray . (,) 0 . subtract 1 <$> return len <*> fmap (map read . words) getLine)))::IO Int)
                   g (i + 1)
           else return () in
           g 1




<|start_filename|>out/euler23.js<|end_filename|>
var util = require("util");
function eratostene(t, max0){
    var n = 0;
    for (var i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            var j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
}
function fillPrimesFactors(t, n, primes, nprimes){
    for (var i = 0; i < nprimes; i++)
    {
        var d = primes[i];
        while (~~(n % d) == 0)
        {
            t[d]++;
            n = ~~(n / d);
        }
        if (n == 1)
            return primes[i];
    }
    return n;
}
function sumdivaux2(t, n, i){
    while (i < n && t[i] == 0)
        i++;
    return i;
}
function sumdivaux(t, n, i){
    if (i > n)
        return 1;
    else if (t[i] == 0)
        return sumdivaux(t, n, sumdivaux2(t, n, i + 1));
    else
    {
        var o = sumdivaux(t, n, sumdivaux2(t, n, i + 1));
        var out0 = 0;
        var p = i;
        for (var j = 1; j <= t[i]; j++)
        {
            out0 += p;
            p *= i;
        }
        return (out0 + 1) * o;
    }
}
function sumdiv(nprimes, primes, n){
    var t = new Array(n + 1);
    for (var i = 0; i <= n; i++)
        t[i] = 0;
    var max0 = fillPrimesFactors(t, n, primes, nprimes);
    return sumdivaux(t, max0, 0);
}
var maximumprimes = 30001;
var era = new Array(maximumprimes);
for (var s = 0; s < maximumprimes; s++)
    era[s] = s;
var nprimes = eratostene(era, maximumprimes);
var primes = new Array(nprimes);
for (var t = 0; t < nprimes; t++)
    primes[t] = 0;
var l = 0;
for (var k = 2; k < maximumprimes; k++)
    if (era[k] == k)
    {
        primes[l] = k;
        l++;
    }
var n = 100;
//  28124 ça prend trop de temps mais on arrive a passer le test 
var abondant = new Array(n + 1);
for (var p = 0; p <= n; p++)
    abondant[p] = false;
var summable = new Array(n + 1);
for (var q = 0; q <= n; q++)
    summable[q] = false;
var sum = 0;
for (var r = 2; r <= n; r++)
{
    var other = sumdiv(nprimes, primes, r) - r;
    if (other > r)
        abondant[r] = true;
}
for (var i = 1; i <= n; i++)
    for (var j = 1; j <= n; j++)
        if (abondant[i] && abondant[j] && i + j <= n)
            summable[i + j] = true;
for (var o = 1; o <= n; o++)
    if (!summable[o])
        sum += o;
util.print("\n", sum, "\n");



<|start_filename|>out/recordtest.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>

typedef struct toto {
  int foo;
    int bar;
} toto;
int main(void) {
    struct toto * param = malloc(sizeof(toto));
    param->foo = 0;
    param->bar = 0;
    scanf("%d %d", &param->bar, &param->foo);
    printf("%d", param->bar + param->foo * param->bar);
    return 0;
}




<|start_filename|>out/abstest.cpp<|end_filename|>
#include <iostream>
#include <vector>

int abs_(int n) {
    if (n > 0)
        return n;
    else
        return -n;
}

int main() {
    std::cout << abs_(5 + 2) * 3 << 3 * abs_(5 + 2);
}



<|start_filename|>out/aaa_integer.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_integer is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;


  i : Integer;
begin
  i := 0;
  i := i - 1;
  PInt(i);
  PString(new char_array'( To_C("" & Character'Val(10))));
  i := i + 55;
  PInt(i);
  PString(new char_array'( To_C("" & Character'Val(10))));
  i := i * 13;
  PInt(i);
  PString(new char_array'( To_C("" & Character'Val(10))));
  i := i / 2;
  PInt(i);
  PString(new char_array'( To_C("" & Character'Val(10))));
  i := i + 1;
  PInt(i);
  PString(new char_array'( To_C("" & Character'Val(10))));
  i := i / 3;
  PInt(i);
  PString(new char_array'( To_C("" & Character'Val(10))));
  i := i - 1;
  PInt(i);
  PString(new char_array'( To_C("" & Character'Val(10))));
  --
  --http://fr.wikipedia.org/wiki/Modulo_(op%C3%A9ration)#Trois_d.C3.A9finitions_de_la_fonction_modulo
  --
  
  PInt(117 / 17);
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(117 / (-17));
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt((-117) / 17);
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt((-117) / (-17));
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(117 rem 17);
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt(117 rem (-17));
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt((-117) rem 17);
  PString(new char_array'( To_C("" & Character'Val(10))));
  PInt((-117) rem (-17));
  PString(new char_array'( To_C("" & Character'Val(10))));
end;


<|start_filename|>out/euler33.js<|end_filename|>
var util = require("util");
function pgcd(a, b){
    var c = Math.min(a, b);
    var d = Math.max(a, b);
    var reste = ~~(d % c);
    if (reste == 0)
        return c;
    else
        return pgcd(c, reste);
}
var top = 1;
var bottom = 1;
for (var i = 1; i < 10; i++)
    for (var j = 1; j < 10; j++)
        for (var k = 1; k < 10; k++)
            if (i != j && j != k)
            {
                var a = i * 10 + j;
                var b = j * 10 + k;
                if (a * k == i * b)
                {
                    util.print(a, "/", b, "\n");
                    top *= a;
                    bottom *= b;
                }
            }
util.print(top, "/", bottom, "\n");
var p = pgcd(top, bottom);
util.print("pgcd=", p, "\n", ~~(bottom / p), "\n");



<|start_filename|>out/aaa_missing.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
/*
  Ce test a été généré par Metalang.
*/
func result(len int, tab []int) int{
  var tab2 []bool = make([]bool, len)
  for i := 0; i < len; i++ {
      tab2[i] = false
  }
  for i1 := 0; i1 < len; i1++ {
      fmt.Printf("%d ", tab[i1])
      tab2[tab[i1]] = true
  }
  fmt.Printf("\n")
  for i2 := 0; i2 < len; i2++ {
      if !tab2[i2] {
          return i2
      }
  }
  return -1
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  var len int
  fmt.Fscanf(reader, "%d", &len)
  skip()
  fmt.Printf("%d\n", len)
  var tab []int = make([]int, len)
  for a := 0; a < len; a++ {
      fmt.Fscanf(reader, "%d", &tab[a])
      skip()
  }
  fmt.Printf("%d\n", result(len, tab))
}



<|start_filename|>out/rot13.java<|end_filename|>
import java.util.*;

public class rot13
{
  static Scanner scanner = new Scanner(System.in);
  /*
Ce test effectue un rot13 sur une chaine lue en entrée
*/
  public static void main(String args[])
  {
    int strlen;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      strlen = scanner.nextInt();
    } else {
      strlen = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    char[] tab4 = new char[strlen];
    for (int toto = 0; toto < strlen; toto++)
    {
        char tmpc = scanner.findWithinHorizon(".", 1).charAt(0);
        int c = (int)(tmpc);
        if (tmpc != ' ')
            c = (c - (int)('a') + 13) % 26 + (int)('a');
        tab4[toto] = (char)(c);
    }
    for (int j = 0; j < strlen; j++)
        System.out.print(tab4[j]);
  }
  
}



<|start_filename|>out/sqrttest.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;
with Ada.Numerics.Elementary_Functions;
procedure sqrttest is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;
procedure PInt(i : in Integer) is
begin
  String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left));
end;


begin
  PInt(Integer(Float'Truncation(Ada.Numerics.Elementary_Functions.Sqrt(Float(4)))));
  PString(new char_array'( To_C(" ")));
  PInt(Integer(Float'Truncation(Ada.Numerics.Elementary_Functions.Sqrt(Float(16)))));
  PString(new char_array'( To_C(" ")));
  PInt(Integer(Float'Truncation(Ada.Numerics.Elementary_Functions.Sqrt(Float(20)))));
  PString(new char_array'( To_C(" ")));
  PInt(Integer(Float'Truncation(Ada.Numerics.Elementary_Functions.Sqrt(Float(1000)))));
  PString(new char_array'( To_C(" ")));
  PInt(Integer(Float'Truncation(Ada.Numerics.Elementary_Functions.Sqrt(Float(500)))));
  PString(new char_array'( To_C(" ")));
  PInt(Integer(Float'Truncation(Ada.Numerics.Elementary_Functions.Sqrt(Float(10)))));
  PString(new char_array'( To_C(" ")));
end;


<|start_filename|>out/aaa_12strings.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int main(void) {
    printf("tada ' \" \n\r\t $ & todo\n\n{foo} \\${blah}\nblah\n");
    return 0;
}




<|start_filename|>out/aaa_readints.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef
ifM :: IO Bool -> IO a -> IO a -> IO a
ifM c i e =
  do b <- c
     if b then i else e
readIOA :: IOArray Int a -> Int -> IO a
readIOA = readArray
array_init :: Int -> ( Int -> IO out ) -> IO (IOArray Int out)
array_init len f = newListArray (0, len - 1) =<< g 0
  where g i =
           if i == len
           then return []
           else fmap (:) (f i) <*> g (i + 1)

main :: IO ()
main =
  do len <- (fmap read getLine)
     printf "%d=len\n" (len::Int) :: IO()
     tab1 <- (join (newListArray . (,) 0 . subtract 1 <$> return len <*> fmap (map read . words) getLine))
     let b i =
           if i <= len - 1
           then do printf "%d=>%d\n" (i::Int) =<< ((readIOA tab1 i)::IO Int)
                   b (i + 1)
           else do c <- (fmap read getLine)
                   tab2 <- array_init (c - 1) (\ a ->
                                                 (join (newListArray . (,) 0 . subtract 1 <$> return c <*> fmap (map read . words) getLine)))
                   let d e =
                         if e <= c - 2
                         then let f j =
                                    if j <= c - 1
                                    then do printf "%d " =<< ((join $ readIOA <$> (readIOA tab2 e) <*> return j)::IO Int)
                                            f (j + 1)
                                    else do printf "\n" :: IO ()
                                            d (e + 1) in
                                    f 0
                         else return () in
                         d 0 in
           b 0




<|start_filename|>out/euler23.lua<|end_filename|>

function trunc(x)
  return x>=0 and math.floor(x) or math.ceil(x)
end
function eratostene (t, max0)
  local n = 0
  for i = 2, max0 - 1 do
      if t[i + 1] == i then
          n = n + 1
          local j = i * i
          while j < max0 and j > 0 do
              t[j + 1] = 0
              j = j + i
          end
      end
  end
  return n
end

function fillPrimesFactors (t, n, primes, nprimes)
  for i = 0, nprimes - 1 do
      local d = primes[i + 1]
      while math.fmod(n, d) == 0 do
          t[d + 1] = t[d + 1] + 1
          n = trunc(n / d)
      end
      if n == 1 then
          return primes[i + 1]
      end
  end
  return n
end

function sumdivaux2 (t, n, i)
  while i < n and t[i + 1] == 0 do
      i = i + 1
  end
  return i
end

function sumdivaux (t, n, i)
  if i > n then
      return 1
  elseif t[i + 1] == 0 then
      return sumdivaux(t, n, sumdivaux2(t, n, i + 1))
  else 
      local o = sumdivaux(t, n, sumdivaux2(t, n, i + 1))
      local out0 = 0
      local p = i
      for j = 1, t[i + 1] do
          out0 = out0 + p
          p = p * i
      end
      return (out0 + 1) * o
  end
end

function sumdiv (nprimes, primes, n)
  local t = {}
  for i = 0, n do
      t[i + 1] = 0
  end
  local max0 = fillPrimesFactors(t, n, primes, nprimes)
  return sumdivaux(t, max0, 0)
end

local maximumprimes = 30001
local era = {}
for s = 0, maximumprimes - 1 do
    era[s + 1] = s
end
local nprimes = eratostene(era, maximumprimes)
local primes = {}
for t = 0, nprimes - 1 do
    primes[t + 1] = 0
end
local l = 0
for k = 2, maximumprimes - 1 do
    if era[k + 1] == k then
        primes[l + 1] = k
        l = l + 1
    end
end
local n = 100
--[[ 28124 ça prend trop de temps mais on arrive a passer le test --]]
local abondant = {}
for p = 0, n do
    abondant[p + 1] = false
end
local summable = {}
for q = 0, n do
    summable[q + 1] = false
end
local sum = 0
for r = 2, n do
    local other = sumdiv(nprimes, primes, r) - r
    if other > r then
        abondant[r + 1] = true
    end
end
for i = 1, n do
    for j = 1, n do
        if abondant[i + 1] and abondant[j + 1] and i + j <= n then
            summable[i + j + 1] = true
        end
    end
end
for o = 1, n do
    if not(summable[o + 1]) then
        sum = sum + o
    end
end
io.write(string.format("\n%d\n", sum))


<|start_filename|>out/pathfinding0.c<|end_filename|>
#include <stdio.h>
#include <stdlib.h>


int min2_(int a, int b) {
    if (a < b)
        return a;
    else
        return b;
}

int pathfind_aux(int** cache, char** tab, int x, int y, int posX, int posY) {
    if (posX == x - 1 && posY == y - 1)
        return 0;
    else if (posX < 0 || posY < 0 || posX >= x || posY >= y)
        return x * y * 10;
    else if (tab[posY][posX] == '#')
        return x * y * 10;
    else if (cache[posY][posX] != -1)
        return cache[posY][posX];
    else
    {
        cache[posY][posX] = x * y * 10;
        int val1 = pathfind_aux(cache, tab, x, y, posX + 1, posY);
        int val2 = pathfind_aux(cache, tab, x, y, posX - 1, posY);
        int val3 = pathfind_aux(cache, tab, x, y, posX, posY - 1);
        int val4 = pathfind_aux(cache, tab, x, y, posX, posY + 1);
        int out0 = 1 + min2_(min2_(min2_(val1, val2), val3), val4);
        cache[posY][posX] = out0;
        return out0;
    }
}

int pathfind(char** tab, int x, int y) {
    int i, j;
    int* *cache = calloc(y, sizeof(int*));
    for (i = 0; i < y; i++)
    {
        int *tmp = calloc(x, sizeof(int));
        for (j = 0; j < x; j++)
        {
            printf("%c", tab[i][j]);
            tmp[j] = -1;
        }
        printf("\n");
        cache[i] = tmp;
    }
    return pathfind_aux(cache, tab, x, y, 0, 0);
}
int main(void) {
    int f, h, y, x;
    scanf("%d %d ", &x, &y);
    printf("%d %d\n", x, y);
    char* *e = calloc(y, sizeof(char*));
    for (f = 0; f < y; f++)
    {
        char *g = calloc(x, sizeof(char));
        for (h = 0; h < x; h++)
            scanf("%c", &g[h]);
        scanf(" ");
        e[f] = g;
    }
    char** tab = e;
    int result = pathfind(tab, x, y);
    printf("%d", result);
    return 0;
}




<|start_filename|>out/aaa_00hello.java<|end_filename|>
import java.util.*;

public class aaa_00hello
{
  
  
  public static void main(String args[])
  {
    System.out.print("Hello World\n");
  }
  
}



<|start_filename|>out/euler22.go<|end_filename|>
package main
import "fmt"
import "os"
import "bufio"
var reader *bufio.Reader

func skip() {
  var c byte
  fmt.Fscanf(reader, "%c", &c)
  if c == '\n' || c == ' ' {
    skip()
  } else {
    reader.UnreadByte()
  }
}
func score() int{
  var len int
  skip()
  fmt.Fscanf(reader, "%d", &len)
  skip()
  sum := 0
  for i := 1; i <= len; i++ {
      var c byte
      fmt.Fscanf(reader, "%c", &c)
      sum += (int)(c) - (int)('A') + 1
      /*		print c print " " print sum print " " */
  }
  return sum
}
func main() {
  reader = bufio.NewReader(os.Stdin)
  sum := 0
  var n int
  fmt.Fscanf(reader, "%d", &n)
  for i := 1; i <= n; i++ {
      sum += i * score()
  }
  fmt.Printf("%d\n", sum)
}



<|start_filename|>out/aaa_021if.adb<|end_filename|>

with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C;
use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C;

procedure aaa_021if is


type stringptr is access all char_array;
procedure PString(s : stringptr) is
begin
  String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all));
end;

procedure testA(a : in Boolean; b : in Boolean) is
begin
  if a
  then
    if b
    then
      PString(new char_array'( To_C("A")));
    else
      PString(new char_array'( To_C("B")));
    end if;
  else
    if b
    then
      PString(new char_array'( To_C("C")));
    else
      PString(new char_array'( To_C("D")));
    end if;
  end if;
end;
procedure testB(a : in Boolean; b : in Boolean) is
begin
  if a
  then
    PString(new char_array'( To_C("A")));
  else
    if b
    then
      PString(new char_array'( To_C("B")));
    else
      PString(new char_array'( To_C("C")));
    end if;
  end if;
end;
procedure testC(a : in Boolean; b : in Boolean) is
begin
  if a
  then
    if b
    then
      PString(new char_array'( To_C("A")));
    else
      PString(new char_array'( To_C("B")));
    end if;
  else
    PString(new char_array'( To_C("C")));
  end if;
end;
procedure testD(a : in Boolean; b : in Boolean) is
begin
  if a
  then
    if b
    then
      PString(new char_array'( To_C("A")));
    else
      PString(new char_array'( To_C("B")));
    end if;
    PString(new char_array'( To_C("C")));
  else
    PString(new char_array'( To_C("D")));
  end if;
end;
procedure testE(a : in Boolean; b : in Boolean) is
begin
  if a
  then
    if b
    then
      PString(new char_array'( To_C("A")));
    end if;
  else
    if b
    then
      PString(new char_array'( To_C("C")));
    else
      PString(new char_array'( To_C("D")));
    end if;
    PString(new char_array'( To_C("E")));
  end if;
end;
procedure test(a : in Boolean; b : in Boolean) is
begin
  testD(a, b);
  testE(a, b);
  PString(new char_array'( To_C("" & Character'Val(10))));
end;

begin
  test(TRUE, TRUE);
  test(TRUE, FALSE);
  test(FALSE, TRUE);
  test(FALSE, FALSE);
end;


<|start_filename|>out/test_instant.cpp<|end_filename|>
#include <iostream>
#include <vector>

int foo(int a, int b) {
    return a + b;
}

int main() {
    std::cout << 10;
}



<|start_filename|>out/euler03.fs<|end_filename|>
: // { a b } a b / a 0 < b 0 < XOR IF 1 + THEN ;
: % { a b } a b MOD a 0 < b 0 < XOR IF b - THEN ;
: main
  1 { maximum }
  2 { b0 }
  408464633 { a }
  a s>f fsqrt f>s { sqrtia }
  BEGIN
    a 1 <>
  WHILE
    b0 { b }
    false { found }
    BEGIN
      b sqrtia <=
    WHILE
      a b % 0 =
      IF
        a b // TO a
        b TO b0
        a TO b
        a s>f fsqrt f>s TO sqrtia
        true TO found
      THEN
      b 1 + TO b
    REPEAT
    found INVERT
    IF
      a s>d 0 d.r
      S\" \n" TYPE
      1 TO a
    THEN
  REPEAT
  ;
main
BYE



<|start_filename|>js/index.html<|end_filename|>
<html>
  <head>
    <title>métalang</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="CodeMirror-2.33/theme/elegant.css">
    <link rel="stylesheet" href="CodeMirror-2.33/theme/cobalt.css">
    <link rel="stylesheet" href="CodeMirror-2.33/theme/blackboard.css">
    <script language="javascript" src="meta.js"></script>
    <script src="CodeMirror-2.33/lib/codemirror.js"></script>
    <script src="CodeMirror-2.33/mode/clike/clike.js"></script>
    <script src="CodeMirror-2.33/mode/ocaml/ocaml.js"></script>
    <script src="CodeMirror-2.33/mode/pascal/pascal.js"></script>
    <script src="CodeMirror-2.33/mode/php/php.js"></script>
    <script src="CodeMirror-2.33/mode/python/python.js"></script>
    <script src="CodeMirror-2.33/mode/ruby/ruby.js"></script>

    <script language="javascript" src="syntax-metalang.js"></script>
    <link rel="stylesheet" href="CodeMirror-2.33/lib/codemirror.css">

    <style type="text/css">

      body {
font-family: monospace;

      margin-left:20%; margin-right:20%; background: #777; color: #FFF;
      }
#main { background: #333; }
textarea { background-color: #222;; color: #FFF;}
h1 {text-align: center; border-bottom:1px solid #FFF; font-size: 2.5em;}
#left {
  width: 50%;
  float: left;
  height: 50%;
  overflow:auto;
}
#right {
  margin-left: 50%;
  width: 50%;
  height: 50%;
  overflow:auto;
}

#footer2 {
  padding-right : 1em;
  text-align:center;
}

a{
  color: #7AF;
  font-size: 1.2em;
}
h2 { font-size: 1.3em; padding-right: 1em;padding-left: 1em;}
h1, h2 {
  font-weight: normal;
}
#footer1_left { width : 50%; float:left; overflow:auto;}
#stdout_box { margin-left: 50%;  overflow:auto; }
input, select { font-size: 1.5em; padding-left: 1em;}
.CodeMirror-scroll {
  height: auto;
    overflow-y: hidden;
      overflow-x: auto;
      }
.CodeMirror-lines { padding-left: 0em }
#stderr { color:#ff1111;}
ul {
list-style-type : none;
}

    </style>
  </head>
  <body>
    <textarea id="stdlib" style="display:none">
macro int random(int c)
  ml do "(Random.int ($c))"
  js do "(Math.floor(Math.random() * ($c)))"
  php do "mt_rand(0, $c - 1)"
  *  do "$c"
end

macro int sqrt_(int c)
  ml do "(int_of_float (sqrt (float_of_int ( $c))))"
  js do "Math.floor(Math.sqrt($c))"
  csharp do "(int)Math.Sqrt($c)"
  fsharp do "(int (sqrt (float ($c))))"
  py do "math.floor(math.sqrt($c))"
  ruby do "Math.sqrt($c).to_i"
  pas do "Floor(Sqrt($c))"
  java do "(int)Math.sqrt($c)"
  groovy do "(int)Math.sqrt($c)"
  clisp do "(isqrt $c)"
  go do "int(math.Sqrt(float64($c)))"
  php do "intval(sqrt($c))"
  rkt do "integer-sqrt $c"
  pl do "int(sqrt($c))"
  c do "(int)sqrt($c)"
  cpp do "(int)sqrt($c)"
  objc do "(int)sqrt($c)"
  ada do "Integer(Float'Truncation(Ada.Numerics.Elementary_Functions.Sqrt(Float($c))))"
  vb do "Int(Math.Sqrt($c))"
  hs do "fmap (floor . sqrt . fromIntegral) ($c)"
  hs_pure do "(floor . sqrt . fromIntegral) $c"
  lua do "math.floor(math.sqrt($c))"
  scala do "math.sqrt($c).toInt"
  st do "(($c) sqrt floor)"
  fs do "$c s>f fsqrt f>s"
  * do "sqrt($c)"
end

tag macro_sqrt__pure

def inline int isqrt(int c)
  tag use_math
  return sqrt_(c)
end

macro char char_of_int(int c)
  ml do "char_of_int ($c)"
  pas do "chr($c)"
  java do "(char)($c)"
  groovy do "(char)($c)"
  js do "String.fromCharCode($c)"
  csharp do "(char)($c)"
  php do "chr($c)"
  go do "(byte)($c)"
  clisp do "(code-char $c)"
  cpp do "(char)($c)"
  rkt do "integer->char $c"
  pl do "chr($c)"
  c do "(char)($c)"
  cpp do "(char)($c)"
  objc do "(char)($c)"
  ada do "Character'Val($c)"
  vb do "Chr($c)"
  hs do "fmap chr ($c)"
  hs_pure do "chr $c"
  scala do "($c).toChar"
  lua  do "$c"
  ruby do "($c).chr"
  st do "(($c) asCharacter)"
  fsharp do "char ($c)"
  *  do "$c"
end
tag macro_char_of_int_pure

macro int int_of_char(char c)
  ml do "int_of_char ($c)"
  py do "ord($c)"
  clisp do "(char-code $c)"
  ruby do "$c.ord"
  pas do "ord($c)"
  php do "ord($c)"
  go do "(int)($c)"
  js do "$c.charCodeAt(0)"
  rkt do "char->integer $c"
  pl do "ord($c)"
  c do "(int)($c)"
  cpp do "(int)($c)"
  objc do "(int)($c)"
  ada do "Character'Pos($c)"
  vb do "Asc($c)"
  hs do "fmap ord ($c)"
  hs_pure do "ord $c"
  scala do "($c).toInt"
  lua  do "$c"
  st do "(($c) asciiValue)"
  java do "(int)($c)"
  csharp do "(int)($c)"
  groovy do "(0+$c)"
  fsharp do "int ($c)"
  *  do "$c"
end
tag macro_int_of_char_pure

def bool is_number(char c)
	return int_of_char(c) <= int_of_char('9') &&
  int_of_char(c) >= int_of_char('0')
end

macro int native_macro_abs(int n)
  ml do "abs ($n)"
  adb do "abs $n"
  js do "Math.abs($n)"
  java do "Math.abs($n)"
  vb do "Math.Abs($n)"
  php do "abs($n)"
  py do "abs($n)"
  lua do "math.abs($n)"
  hs do "(abs <$> ($n))"
  hs_pure do "abs $n"
  * do "abs($n)"
end
tag macro_native_macro_abs_pure

def int abs_(int n)
 if n > 0 then return n else return -n end
end

def lexems macro_abs(lexems n)
  if current_language() == LANG_Java ||
  current_language() == LANG_Js ||
  current_language() == LANG_Php ||
  current_language() == LANG_Vb ||
  current_language() == LANG_Ml ||
  current_language() == LANG_Fun_ml ||
  current_language() == LANG_Py ||
  current_language() == LANG_Lua ||
  current_language() == LANG_Adb ||
  current_language() == LANG_Hs
  then
    return {
    return native_macro_abs(${n}) }
  else
    return  { return abs_(${n}) }
  end
end

def inline int abs(int n)
	${ macro_abs( {n} ) }
end

macro int native_macro_max2(int a, int b)
  ml do "max ($a) ($b)"
  js do "Math.max($a, $b)"
  java do "Math.max($a, $b)"
  groovy do "Math.max($a, $b)"
  csharp do "Math.Max($a, $b)"
  vb do "Math.Max($a, $b)"
  php do "max($a, $b)"
  py do "max($a, $b)"
  pl do "max($a, $b)"
  rkt do "max $a $b"
  clisp do "(max $a $b)"
  ruby do "[$a, $b].max"
  lua do "math.max($a, $b)"
  pas do "Max($a, $b)"
  hs do "(max <$> ($a) <*> ($b))"
  hs_pure do "max $a $b"
  fs do "$a $b max"
  st do "(($a) max: ($b))"
  cpp do "std::max($a, $b)"
  * do "max($a, $b)"
end
tag macro_native_macro_max2_pure

def int max2_(int a, int b)
 if a > b then return a else return b end
end

def lexems macro_max2(lexems a, lexems b)
  if current_language() == LANG_Java ||
  current_language() == LANG_Groovy ||
  current_language() == LANG_Js ||
  current_language() == LANG_Php ||
  current_language() == LANG_Cs ||
  current_language() == LANG_Cc ||
  current_language() == LANG_Cpp ||
  current_language() == LANG_Vb ||
  current_language() == LANG_Rkt ||
  current_language() == LANG_Ml ||
  current_language() == LANG_Fun_ml ||
  current_language() == LANG_Py ||
  current_language() == LANG_Pl ||
  current_language() == LANG_Lua ||
  current_language() == LANG_Pas ||
  current_language() == LANG_Hs ||
  current_language() == LANG_Rb ||
  current_language() == LANG_St ||
  current_language() == LANG_Fs
  then
    return { 
    tag use_cpp_algorithm
    tag use_pascal_math
    tag perl_use_list_min
    return native_macro_max2( ${a}, ${b}) }
  else
    return  { return max2_(${a}, ${b}) }
  end
end

def inline int max2(int a, int b)
	${ macro_max2( {a}, {b} ) }
end

macro int native_macro_min2(int a, int b)
  ml do "min ($a) ($b)"
  js do "Math.min($a, $b)"
  java do "Math.min($a, $b)"
  groovy do "Math.min($a, $b)"
  csharp do "Math.Min($a, $b)"
  vb do  "Math.Min($a, $b)"
  php do "min($a, $b)"
  py do "min($a, $b)"
  rkt do "min $a $b"
  clisp do "(min $a $b)"
  ruby do "[$a, $b].min"
  pl do "min($a, $b)"
  lua do "math.min($a, $b)"
  pas do "Min($a, $b)"
  hs do "(min <$> ($a) <*> ($b))"
  hs_pure do "min $a $b"
  fs do "$a $b min"
  st do "(($a) min: ($b))"
  cpp do "std::min($a, $b)"
  * do "min($a, $b)"
end

tag macro_native_macro_min2_pure

macro int native_macro_min3(int a, int b, int c)
  js do "Math.min($a, $b, $c)"
  php do "min($a, $b, $c)"
  py do "min($a, $b, $c)"
  rkt do "min $a $b $c"
  clisp do "(min $a $b $c)"
  ruby do "[$a, $b, $c].min"
  pl do "min($a, $b, $c)"
  lua do "math.min($a, $b, $c)"
  cpp do "std::min({$a, $b, $c})"
  * do "min($a, $b, $c)"
end

macro int native_macro_min4(int a, int b, int c, int d)
  js do "Math.min($a, $b, $c, $d)"
  php do "min($a, $b, $c, $d)"
  py do "min($a, $b, $c, $d)"
  rkt do "min $a $b $c $d"
  clisp do "(min $a $b $c $d)"
  ruby do "[$a, $b, $c, $d].min"
  pl do "min($a, $b, $c, $d)"
  lua do "math.min($a, $b, $c, $d)"
  cpp do "std::min({$a, $b, $c, $d})"
  * do "min($a, $b, $c, $d)"
end

def int min2_(int a, int b)
  if a < b then return a else return b end 
end

def lexems macro_min2(lexems a, lexems b)
  if current_language() == LANG_Java ||
  current_language() == LANG_Groovy ||
  current_language() == LANG_Js ||
  current_language() == LANG_Php ||
  current_language() == LANG_Cs ||
  current_language() == LANG_Cc ||
  current_language() == LANG_Cpp ||
  current_language() == LANG_Vb ||
  current_language() == LANG_Ml ||
  current_language() == LANG_Fun_ml ||
  current_language() == LANG_Py ||
  current_language() == LANG_Rkt ||
  current_language() == LANG_Cl ||
  current_language() == LANG_Rb ||
  current_language() == LANG_Fs ||
  current_language() == LANG_Vb ||
  current_language() == LANG_Pl ||
  current_language() == LANG_Pas ||
  current_language() == LANG_Lua ||
  current_language() == LANG_St ||
  current_language() == LANG_Hs
  then
    return {
    tag use_cpp_algorithm
    tag use_pascal_math
    tag perl_use_list_min
    return native_macro_min2( ${a}, ${b}) }
  else
    return  { return min2_(${a}, ${b})}
  end
end

def inline int min2(int a, int b)
	${ macro_min2( {a}, {b} ) }
end

def lexems macro_min3(lexems a, lexems b, lexems c)
  if current_language() == LANG_Js ||
  current_language() == LANG_Php ||
  current_language() == LANG_Py ||
  current_language() == LANG_Rkt ||
  current_language() == LANG_Cl ||
  current_language() == LANG_Cc ||
  current_language() == LANG_Cpp ||
  current_language() == LANG_Rb ||
  current_language() == LANG_Pl ||
  current_language() == LANG_Pl ||
  current_language() == LANG_Lua
  then
    return {
      tag use_cpp_algorithm
      tag perl_use_list_min
      return native_macro_min3( ${a}, ${b}, ${c})
     }
  else
    return { return min2(min2( ${a}, ${b}), ${c}) }
  end
end

def inline int min3(int a, int b, int c)
	${ macro_min3( {a}, {b}, {c} )}
end

def lexems macro_min4(lexems a, lexems b, lexems c, lexems d)
  if current_language() == LANG_Js ||
  current_language() == LANG_Php ||
  current_language() == LANG_Py  ||
  current_language() == LANG_Rkt ||
  current_language() == LANG_Cl ||
  current_language() == LANG_Cc ||
  current_language() == LANG_Cpp ||
  current_language() == LANG_Rb ||
  current_language() == LANG_Pl ||
  current_language() == LANG_Lua
  then
    return {
      tag use_cpp_algorithm
      tag perl_use_list_min
      return native_macro_min4( ${a}, ${b}, ${c}, ${d})
  }
  else
    return { 	return min3(min2(a, b), c, d) }
  end
end

def inline int min4(int a, int b, int c, int d)
	${ macro_min4( {a}, {b}, {c}, {d} )}
end

def int pgcd(int a, int b)
	def c = min2(a, b)
	def d = max2(a, b)
	def reste = d % c
	if reste == 0 then
		return c
	else
		return pgcd(c, reste)
	end
end

macro array<int> native_expand_read_int_line(int c)
  py do "list(map(int, input().split()))"
  php do "array_map(\"intval\", explode(\" \", fgets(STDIN)))"
  fsharp do "(Console.ReadLine ()).Split [|' '|] |> Array.map Int32.Parse"
  csharp do "new List<string>(Console.ReadLine().Split(\" \".ToCharArray())).ConvertAll(int.Parse).ToArray()"
  vb do "Array(Of String).ConvertAll(Of String, Integer)(Console.ReadLine().Split(\" \".ToCharArray()), New Converter(Of String, Integer)(AddressOf Integer.Parse))"
  rkt do "list->vector (map string->number (regexp-split \" \" (read-line)))"
  ruby do "STDIN.readline.split(\" \").map{ |x| x.to_i(10) }"
  pl do "[ map { int($_) } split(/\\s+/, <STDIN>) ]"
  java do "read_int_line()"
  groovy do "read_int_line()"
  lua do "readintline()"
  hs do "join (newListArray . (,) 0 . subtract 1 <$> $c <*> fmap (map read . words) getLine)"
  scala do "readLine().split(\" \").map(_.toInt)"
  *  do "E R R O R"
end

macro array<char> native_expand_read_char_line(int c)
  py do "list(input())"
  php do "fgets(STDIN)"
  csharp do "Console.ReadLine().ToCharArray()"
  fsharp do "(Console.ReadLine ()).ToCharArray ()"
  vb do "Console.ReadLine().ToCharArray()"
  cpp do "getline()"
  rkt do "list->vector (string->list (read-line))"
  ruby do "STDIN.readline.split(//)"
  pl do "[split(//, <STDIN>)]"
  lua do "readcharline()"
  java do "scanner.nextLine().toCharArray()"
  groovy do "scanner.nextLine().toCharArray()"
  hs do "join (newListArray <$> (fmap (\\x -> (0, x-1)) ($c)) <*> getLine)"
  scala do "readLine().toCharArray()"
  *  do "E R R O R"
end

macro array<array<int>> py_expand_read_int_matrix(int x, int y)
  py do "[list(map(int, input().split())) for i in range($y)]"
  ruby do "[*1..$y].map { |l| STDIN.readline.split(\" \").map{ |x| x.to_i(10) } }"
  cpp do "read_matrix<int>($y, $x)"
  *  do "E R R O R"
end

macro array<array<char>> py_expand_read_char_matrix(int x, int y)
  cpp do "read_matrix<char>($y, $x)"
  *  do "E R R O R"
end

macro int native_expand_read_int()
  py do "int(input())"
  php do "intval(trim(fgets(STDIN)))"
  csharp do "int.Parse(Console.ReadLine())"
  fsharp do "Console.ReadLine () |> Int32.Parse"
  vb do "Integer.Parse(Console.ReadLine())"
  ml do "Scanf.scanf \"%d \" (fun x -> x)"
  rkt do "string->number (read-line)"
  ruby do "STDIN.readline.to_i(10)"
  pl do "int( <STDIN> )"
  lua do "tonumber(io.read('*l'))"
  java do "Integer.parseInt(scanner.nextLine())"
  groovy do "Integer.parseInt(scanner.nextLine())"
  hs do "fmap read getLine"
  scala do "readInt().toInt"
  st do "stdin nextLine asInteger"
  *  do "E R R O R"
end

def lexems expand_read_int()
if current_language() == LANG_Fun_ml
then
  return {
  return native_expand_read_int()
  }
	elsif current_language() == LANG_Py ||
	current_language() == LANG_Php ||
	current_language() == LANG_Rkt ||
	current_language() == LANG_Pl ||
	current_language() == LANG_Cs ||
	current_language() == LANG_Vb ||
	current_language() == LANG_Fsscript ||
	current_language() == LANG_Java ||
	current_language() == LANG_Groovy ||
	current_language() == LANG_Rb ||
	current_language() == LANG_Lua ||
	current_language() == LANG_Hs ||
	current_language() == LANG_Scala
	then
    return {
    tag use_readline
		tag use_readmacros
    return native_expand_read_int()
    }
  else
    return { def inline read int out skip; return out }
	end
end

def inline int read_int()
  ${ expand_read_int() }
end

def lexems expand_read_int_line(lexems a)
    if current_language() == LANG_Py ||
	current_language() == LANG_Php ||
	current_language() == LANG_Cs ||
	current_language() == LANG_Vb ||
	current_language() == LANG_Fsscript ||
	current_language() == LANG_Pl ||
	current_language() == LANG_Rkt ||
	current_language() == LANG_Java ||
	current_language() == LANG_Groovy ||
	current_language() == LANG_Rb ||
	current_language() == LANG_Lua ||
	current_language() == LANG_Scala ||
	current_language() == LANG_Hs
	  then
      return {
        tag use_readintline
        tag use_java_readline
        tag use_readmacros
        tag use_readline
        return native_expand_read_int_line(${a})
      }
    else
    return {
      def inline array<int> tab[${a}] with i do
      	def inline read int t skip
				return t
      end
      return tab
    }
   end
end

def inline array<int> read_int_line(int n)
  ${expand_read_int_line( {n} )}
end

def lexems expand_read_char_line(lexems a)
  if current_language() == LANG_Lua ||
  current_language() == LANG_Cc ||
  current_language() == LANG_Cpp
  then
    return {
      tag use_cc_readline
      tag use_readcharline
    return native_expand_read_char_line(${a})
    }
  elsif current_language() == LANG_Py ||
	current_language() == LANG_Php ||
	current_language() == LANG_Rkt ||
	current_language() == LANG_Pl ||
	current_language() == LANG_Cs ||
	current_language() == LANG_Vb ||
	current_language() == LANG_Fsscript ||
	current_language() == LANG_Java ||
	current_language() == LANG_Groovy ||
	current_language() == LANG_Rb ||
	current_language() == LANG_Hs ||
	current_language() == LANG_Scala
	  then
      return {
      tag use_readline
			tag use_readmacros
      return native_expand_read_char_line(${a})
      }
    else
    return {
      def inline array<char> tab[${a}] with i do
      	def inline read char t;
				return t;
      end
			skip
      return tab
    }
   end
end

def inline array<char> read_char_line(int n)
    ${expand_read_char_line( {n} )}
end

def lexems expand_read_int_matrix(lexems x, lexems y)
    if current_language() == LANG_Py ||
       current_language() == LANG_Rb ||
       current_language() == LANG_Cpp then
      return {
        tag use_cpp_readmatrix
        return py_expand_read_int_matrix( ${ x }, ${ y } )
      }
    else
    return {
      def inline array<array<int>> tab[${y}] with z do
				return read_int_line(x)
      end
      return tab
    }
   end
end

def inline array<array<int>> read_int_matrix(int x, int y)
    ${expand_read_int_matrix( {x}, {y} )}
end

def lexems expand_read_char_matrix(lexems x, lexems y)
  if current_language() == LANG_Cpp then
    return {
      tag use_cpp_readmatrix
      return py_expand_read_char_matrix( ${ x }, ${ y } )
    }
  else
    return {
      def array<array<char>> tab[${y}] with z do
        return read_char_line(x)
      end
      return tab
    }
  end
end

def inline array<array<char>> read_char_matrix(int x, int y)
    ${expand_read_char_matrix( {x}, {y} )}
end



macro (int, int) native_expand_read_int_couple()
  py do "list(map(int, input().split()))"
  lua do "readintline()"
  php do "array_map(\"intval\", explode(\" \", fgets(STDIN)))"
  ruby do "STDIN.readline.split(\" \").map{ |x| x.to_i(10) }"
  pl do "[ map { int($_) } split(/\\s+/, <STDIN>) ]"
  rkt do "map string->number (regexp-split \" \" (read-line))"
  hs do " (fmap read . head . reads) <$> getLine :: IO (Int, Int)"
  scala do "readf2(\"{0,number} {1,number}\").asInstanceOf[(Long, Long)] match { case x => (x._1.toInt, x._2.toInt) }"
  *  do "E R R O R"
end

def lexems expand_read_int_couple()
  if current_language() == LANG_Vb ||
     current_language() == LANG_Cs ||
     current_language() == LANG_Fsscript ||
     current_language() == LANG_Java ||
     current_language() == LANG_Groovy
  then
    return { def array<int> l = read_int_line(2)
    return (l[0], l[1]) }
  elsif current_language() == LANG_Py ||
    current_language() == LANG_Php ||
    current_language() == LANG_Rb ||
    current_language() == LANG_Rkt ||
    current_language() == LANG_Pl ||
     current_language() == LANG_Lua ||
    current_language() == LANG_Hs ||
     current_language() == LANG_Scala
  then
    return {
      tag use_readintline
      tag use_readtuple
      return native_expand_read_int_couple()
    }
  else
    return {
    def inline read int a skip
    def inline read int b skip
    return (a, b)
    }
  end
end

def inline (int, int) read_int_couple()
  ${ expand_read_int_couple() }
end



macro (int, int, int) native_expand_read_3ints()
  py do "list(map(int, input().split()))"
  lua do "readintline()"
  php do "array_map(\"intval\", explode(\" \", fgets(STDIN)))"
  ruby do "STDIN.readline.split(\" \").map{ |x| x.to_i(10) }"
  pl do "[ map { int($_) } split(/\\s+/, <STDIN>) ]"
  rkt do "map string->number (regexp-split \" \" (read-line))"
  scala do "readf3(\"{0,number} {1,number} {2,number}\").asInstanceOf[(Long, Long, Long)] match { case x => (x._1.toInt, x._2.toInt, x._3.toInt) }"
  *  do "E R R O R"
end

def lexems expand_read_3ints()
  if current_language() == LANG_Vb ||
     current_language() == LANG_Cs ||
     current_language() == LANG_Fsscript ||
     current_language() == LANG_Hs ||
     current_language() == LANG_Groovy ||
     current_language() == LANG_Java then
    return { def array<int> l = read_int_line(3)
    return (l[0], l[1], l[2]) }
  elsif current_language() == LANG_Py ||
    current_language() == LANG_Php ||
    current_language() == LANG_Rb ||
     current_language() == LANG_Lua ||
    current_language() == LANG_Rkt ||
    current_language() == LANG_Scala ||
    current_language() == LANG_Pl
  then
    return {
      tag use_readtuple
      tag use_readintline
      return native_expand_read_3ints()
    }
  else
    return {
    def inline read int a skip
    def inline read int b skip
    def inline read int c skip
    return (a, b, c)
    }
  end
end

def inline (int, int, int) read_3ints()
  ${ expand_read_3ints() }
end
</textarea>
<div id="main">
    <h1>Métalang</h1>
    <div id="left">
      <h2 style="height:2em">Code source</h2>
      <div><textarea id="input_text" cols="80" style="height:100%">main
  print int 10
end
</textarea>
</div>

    </div>

    <div id="right">
      <h2 style="float:left;height:2em">Compiler</h2>
      <div id="tools">
        <select id="language">
          <option value="adb">Ada</option>
          <option value="c">C</option>
          <option value="cc">C++</option>
          <option value="cl">Common lisp</option>
          <option value="cpp">C++ (prologin variant)</option>
          <option value="cs">C#</option>
          <option value="fs">Forth</option>
          <option value="fsscript">F#</option>
          <option value="fun.ml">Ocaml fonctionnel</option>
          <option value="go">Go</option>
          <option value="groovy">Groovy</option>
          <option value="hs">Haskell</option>
          <option value="java">Java</option>
          <option value="js">Javascript</option>
          <option value="lua">Lua</option>
          <option value="m">Objective-C</option>
          <option value="ml">ocaml</option>
          <option value="pas">Pascal</option>
          <option value="php">Php</option>
          <option value="pl">Perl</option>
          <option value="py">Python</option>
          <option value="rb">Ruby</option>
          <option value="scala">Scala</option>
          <option value="st">Smalltalk</option>
          <option value="vb">Visual Basic</option>
        </select>
        <input id="replicate" type="submit" style="display:none"/>
        <input type="submit" value="métalèche" onclick="update();"/>
      </div>
      <div style="clear:both"></div>
      <div id="stderr_box">
      <h2>stderr</h2>
      <p><textarea id="stderr" rows="5" style="width: 80%"></textarea></p>
      </div>
      <div id="copy_box">
      <textarea id="copy" style="width: 80%"></textarea>
      </div>
    </div>
<div id="footer1">
  <div id="footer1_left">
    <h2 style="float:left;height:2em">stdin</h2>
<input id="eval_btn" type="submit" style="display:none"/>
<input type="submit" value="Eval" onclick="updateEval();"/>
    <p><textarea id="stdin" rows="5" style="width: 100%">10
10
</textarea></p>
</div>
  <div id="stdout_box">
    <h2 style="height:2em">stdout</h2>
    <p><textarea id="stdout" rows="5" style="width:100%"></textarea></p>
  </div>
<div style="clear:both;"></div>
</div>
<div style="clear:both;"></div>
</div>
<div id="footer2">
    <ul>
      <li><a href="http://www.prologin.org">Prologin</a></li>
      <li><a href="../"><NAME> (coucou747)</a></li>
<li><a href="https://github.com/prologin/metalang">github</a></li>
    </ul>
</div>

    <script language="javascript">
      var theme = "blackboard";
      var showHide = function(){
          document.getElementById("stderr_box").style.display= document.getElementById("stderr").value == "" ? "none" : "block";
          document.getElementById("stdout_box").style.display= document.getElementById("stdout").value == "" ? "none" : "block";

        if (document.getElementById("copy").value == ""){
          document.getElementById("copy_box").style.display="none";
          return false;
        }else{
          document.getElementById("copy_box").style.display="block";
          return true;
        }
      }

      var code = null;
      var ed = CodeMirror.fromTextArea(document.getElementById('input_text'), {
        lineNumbers: true,
        mode: 'text/x-metalang',
      });

      ed.setOption("theme", theme);

      var update = function(){
        document.getElementById("input_text").value=ed.getValue();
        document.getElementById("replicate").click();

      if (showHide()){
        var lng = 'text/x-csrc';
        switch (document.getElementById("language")){
          case 'ml':
            lng = 'text/x-ocaml';
          break;
          case 'js':
            lng = 'text/x-javascript';
          break;
          case 'pas':
            lng = 'text/x-pascal';
          break;
          case 'php':
            lng = 'text/x-php';
          break;
          case 'py':
            lng = 'text/x-python';
          break;
          case 'rb':
            lng = 'text/x-ruby';
          break;
        }

        if (code == null){
          code = CodeMirror.fromTextArea(document.getElementById('copy'), {
            lineNumbers: true,
            mode: lng,
          });
          code.setOption("theme", theme);
        }else{
          code.setValue( document.getElementById("copy").value );
          code.setOption( "mode", lng );
        }
        }
      }

      var updateEval = function(){
        document.getElementById("input_text").value=ed.getValue();
        document.getElementById("eval_btn").click();
        showHide();
      }
showHide();
</script>
<script type="text/javascript">

  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-51690719-1', 'megami.fr');
  ga('send', 'pageview');

</script>

  </body>
</html>


<|start_filename|>out/aaa_021if.cs<|end_filename|>
using System;

public class aaa_021if
{
  static void testA(bool a, bool b)
  {
    if (a)
        if (b)
            Console.Write("A");
        else
            Console.Write("B");
    else if (b)
        Console.Write("C");
    else
        Console.Write("D");
  }
  
  static void testB(bool a, bool b)
  {
    if (a)
        Console.Write("A");
    else if (b)
        Console.Write("B");
    else
        Console.Write("C");
  }
  
  static void testC(bool a, bool b)
  {
    if (a)
        if (b)
            Console.Write("A");
        else
            Console.Write("B");
    else
        Console.Write("C");
  }
  
  static void testD(bool a, bool b)
  {
    if (a)
    {
        if (b)
            Console.Write("A");
        else
            Console.Write("B");
        Console.Write("C");
    }
    else
        Console.Write("D");
  }
  
  static void testE(bool a, bool b)
  {
    if (a)
    {
        if (b)
            Console.Write("A");
    }
    else
    {
        if (b)
            Console.Write("C");
        else
            Console.Write("D");
        Console.Write("E");
    }
  }
  
  static void test(bool a, bool b)
  {
    testD(a, b);
    testE(a, b);
    Console.Write("\n");
  }
  
  public static void Main(String[] args)
  {
    test(true, true);
    test(true, false);
    test(false, true);
    test(false, false);
  }
  
}



<|start_filename|>out/aaa_missing.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
\ 
\   Ce test a été généré par Metalang.
\ 

: result { len tab }
  HERE len cells allot { tab2 }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i }
    false tab2  i cells +  !
   1 + REPEAT 2DROP
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i1 }
    tab  i1 cells +  @ s>d 0 d.r
    S"  " TYPE
    true tab2  tab  i1 cells +  @ cells +  !
   1 + REPEAT 2DROP
  S\" \n" TYPE
  len 1 - 0 BEGIN 2dup >= WHILE DUP { i2 }
    tab2  i2 cells +  @ INVERT
    IF
      DROP DROP i2 exit
    THEN
   1 + REPEAT 2DROP
  1 NEGATE exit
;

: main
  read-int { len }
  skipspaces
  len s>d 0 d.r
  S\" \n" TYPE
  HERE len cells allot { tab }
  len 1 - 0 BEGIN 2dup >= WHILE DUP { a }
    read-int tab  a cells +  !
    skipspaces
   1 + REPEAT 2DROP
  len tab result s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/euler36.js<|end_filename|>
var util = require("util");
function palindrome2(pow2, n){
    var t = new Array(20);
    for (var i = 0; i < 20; i++)
        t[i] = ~~(~~(n / pow2[i]) % 2) == 1;
    var nnum = 0;
    for (var j = 1; j < 20; j++)
        if (t[j])
            nnum = j;
    for (var k = 0; k <= ~~(nnum / 2); k++)
        if (t[k] != t[nnum - k])
            return false;
    return true;
}
var p = 1;
var pow2 = new Array(20);
for (var i = 0; i < 20; i++)
{
    p *= 2;
    pow2[i] = ~~(p / 2);
}
var sum = 0;
for (var d = 1; d < 10; d++)
{
    if (palindrome2(pow2, d))
    {
        util.print(d, "\n");
        sum += d;
    }
    if (palindrome2(pow2, d * 10 + d))
    {
        util.print(d * 10 + d, "\n");
        sum += d * 10 + d;
    }
}
for (var a0 = 0; a0 < 5; a0++)
{
    var a = a0 * 2 + 1;
    for (var b = 0; b < 10; b++)
    {
        for (var c = 0; c < 10; c++)
        {
            var num0 = a * 100000 + b * 10000 + c * 1000 + c * 100 + b * 10 + a;
            if (palindrome2(pow2, num0))
            {
                util.print(num0, "\n");
                sum += num0;
            }
            var num1 = a * 10000 + b * 1000 + c * 100 + b * 10 + a;
            if (palindrome2(pow2, num1))
            {
                util.print(num1, "\n");
                sum += num1;
            }
        }
        var num2 = a * 100 + b * 10 + a;
        if (palindrome2(pow2, num2))
        {
            util.print(num2, "\n");
            sum += num2;
        }
        var num3 = a * 1000 + b * 100 + b * 10 + a;
        if (palindrome2(pow2, num3))
        {
            util.print(num3, "\n");
            sum += num3;
        }
    }
}
util.print("sum=", sum, "\n");



<|start_filename|>out/euler23.cpp<|end_filename|>
#include <iostream>
#include <vector>

int eratostene(std::vector<int>& t, int max0) {
    int n = 0;
    for (int i = 2; i < max0; i++)
        if (t[i] == i)
        {
            n++;
            int j = i * i;
            while (j < max0 && j > 0)
            {
                t[j] = 0;
                j += i;
            }
        }
    return n;
}


int fillPrimesFactors(std::vector<int>& t, int n, std::vector<int>& primes, int nprimes) {
    for (int i = 0; i < nprimes; i++)
    {
        int d = primes[i];
        while (n % d == 0)
        {
            t[d]++;
            n /= d;
        }
        if (n == 1)
            return primes[i];
    }
    return n;
}


int sumdivaux2(std::vector<int>& t, int n, int i) {
    while (i < n && t[i] == 0)
        i++;
    return i;
}


int sumdivaux(std::vector<int>& t, int n, int i) {
    if (i > n)
        return 1;
    else if (t[i] == 0)
        return sumdivaux(t, n, sumdivaux2(t, n, i + 1));
    else
    {
        int o = sumdivaux(t, n, sumdivaux2(t, n, i + 1));
        int out0 = 0;
        int p = i;
        for (int j = 1; j <= t[i]; j++)
        {
            out0 += p;
            p *= i;
        }
        return (out0 + 1) * o;
    }
}


int sumdiv(int nprimes, std::vector<int>& primes, int n) {
    std::vector<int> t( n + 1, 0 );
    int max0 = fillPrimesFactors(t, n, primes, nprimes);
    return sumdivaux(t, max0, 0);
}

int main() {
    int maximumprimes = 30001;
    std::vector<int> era( maximumprimes );
    for (int s = 0; s < maximumprimes; s++)
        era[s] = s;
    int nprimes = eratostene(era, maximumprimes);
    std::vector<int> primes( nprimes, 0 );
    int l = 0;
    for (int k = 2; k < maximumprimes; k++)
        if (era[k] == k)
        {
            primes[l] = k;
            l++;
        }
    int n = 100;
    //  28124 ça prend trop de temps mais on arrive a passer le test 
    std::vector<bool> abondant( n + 1, false );
    std::vector<bool> summable( n + 1, false );
    int sum = 0;
    for (int r = 2; r <= n; r++)
    {
        int other = sumdiv(nprimes, primes, r) - r;
        if (other > r)
            abondant[r] = true;
    }
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            if (abondant[i] && abondant[j] && i + j <= n)
                summable[i + j] = true;
    for (int o = 1; o <= n; o++)
        if (!summable[o])
            sum += o;
    std::cout << "\n" << sum << "\n";
}



<|start_filename|>js/header.js<|end_filename|>
function caml_sys_getenv(x) { return new MlString(""); }


<|start_filename|>out/aaa_013option.groovy<|end_filename|>
import java.util.*

class Foo {
  int a
  Integer b
  int[] c
  Integer[] d
  int[] e
  Foo f
  Foo[] g
  Foo[] h
}
int default0(Integer a, Foo b, Integer[] c, Foo[] d, int[] e, Foo[] f)
{
  return 0
}
void aa(Foo b)
{
  
}

Integer a = null
print("___\n")



<|start_filename|>out/euler22.fs<|end_filename|>
VARIABLE buffer-index
1000 buffer-index !
VARIABLE NEOF
1 NEOF !
VARIABLE buffer-max
0 buffer-max !
create bufferc 128 allot
: next-char
  buffer-index @ 1 + buffer-index !
  buffer-index @ buffer-max @ > IF
    0 buffer-index !
    bufferc 128 stdin read-line DROP -1 = NEOF ! buffer-max !
    10 bufferc buffer-max @ + !
  THEN ;
: current-char
  buffer-index @ buffer-max @ > IF next-char THEN
  bufferc buffer-index @ + c@ ;
: skipspaces
  BEGIN NEOF @ current-char 13 = current-char 32 = OR current-char 10 = OR AND
  WHILE next-char REPEAT ;
: read-int
  [char] - current-char = IF -1 next-char ELSE 1 THEN
  0 BEGIN current-char [char] 0 >= current-char [char] 9 <= AND
  WHILE 10 * current-char [char] 0 - + next-char REPEAT * ;
: read-char current-char next-char ;
: score {  }
  skipspaces
  read-int { len }
  skipspaces
  0 { sum }
  len 1 BEGIN 2dup >= WHILE DUP { i }
    read-char { c }
    sum c [char] A - 1 + + TO sum
    \ 		print c print " " print sum print " " 
    
   1 + REPEAT 2DROP
  sum exit
;

: main
  0 { sum }
  read-int { n }
  n 1 BEGIN 2dup >= WHILE DUP { i }
    sum i  score * + TO sum
   1 + REPEAT 2DROP
  sum s>d 0 d.r
  S\" \n" TYPE
  ;
main
BYE



<|start_filename|>out/euler02.java<|end_filename|>
import java.util.*;

public class euler02
{
  
  
  public static void main(String args[])
  {
    int a = 1;
    int b = 2;
    int sum = 0;
    while (a < 4000000)
    {
        if (a % 2 == 0)
            sum += a;
        int c = a;
        a = b;
        b += c;
    }
    System.out.printf("%d\n", sum);
  }
  
}



<|start_filename|>out/min4.hs<|end_filename|>
import Text.Printf
import Control.Applicative
import Control.Monad
import Data.Array.MArray
import Data.Array.IO
import Data.Char
import System.IO
import Data.IORef

main :: IO ()
main =
  printf "%d %d %d %d %d %d\n%d %d %d %d %d %d\n%d %d %d %d %d %d\n%d %d %d %d %d %d\n" ((min (min (min 1 2) 3) 4)::Int) ((min (min (min 1 2) 4) 3)::Int) ((min (min (min 1 3) 2) 4)::Int) ((min (min (min 1 3) 4) 2)::Int) ((min (min (min 1 4) 2) 3)::Int) ((min (min (min 1 4) 3) 2)::Int) ((min (min (min 2 1) 3) 4)::Int) ((min (min (min 2 1) 4) 3)::Int) ((min (min (min 2 3) 1) 4)::Int) ((min (min (min 2 3) 4) 1)::Int) ((min (min (min 2 4) 1) 3)::Int) ((min (min (min 2 4) 3) 1)::Int) ((min (min (min 3 1) 2) 4)::Int) ((min (min (min 3 1) 4) 2)::Int) ((min (min (min 3 2) 1) 4)::Int) ((min (min (min 3 2) 4) 1)::Int) ((min (min (min 3 4) 1) 2)::Int) ((min (min (min 3 4) 2) 1)::Int) ((min (min (min 4 1) 2) 3)::Int) ((min (min (min 4 1) 3) 2)::Int) ((min (min (min 4 2) 1) 3)::Int) ((min (min (min 4 2) 3) 1)::Int) ((min (min (min 4 3) 1) 2)::Int) ((min (min (min 4 3) 2) 1)::Int) :: IO()




<|start_filename|>out/euler14.cc<|end_filename|>
#include <iostream>
#include <vector>

int next0(int n) {
    if (n % 2 == 0)
        return n / 2;
    else
        return 3 * n + 1;
}


int find(int n, std::vector<int> * m) {
    if (n == 1)
        return 1;
    else if (n >= 1000000)
        return 1 + find(next0(n), m);
    else if (m->at(n) != 0)
        return m->at(n);
    else
    {
        m->at(n) = 1 + find(next0(n), m);
        return m->at(n);
    }
}

int main() {
    std::vector<int> *m = new std::vector<int>( 1000000 );
    std::fill(m->begin(), m->end(), 0);
    int max0 = 0;
    int maxi = 0;
    for (int i = 1; i < 1000; i++)
    {
        //  normalement on met 999999 mais ça dépasse les int32... 
        int n2 = find(i, m);
        if (n2 > max0)
        {
            max0 = n2;
            maxi = i;
        }
    }
    std::cout << max0 << "\n" << maxi << "\n";
}



<|start_filename|>out/vigenere.java<|end_filename|>
import java.util.*;

public class vigenere
{
  static Scanner scanner = new Scanner(System.in);
  static int position_alphabet(char c)
  {
    int i = (int)(c);
    if (i <= (int)('Z') && i >= (int)('A'))
        return i - (int)('A');
    else if (i <= (int)('z') && i >= (int)('a'))
        return i - (int)('a');
    else
        return -1;
  }
  static char of_position_alphabet(int c)
  {
    return (char)(c + (int)('a'));
  }
  static void crypte(int taille_cle, char[] cle, int taille, char[] message)
  {
    for (int i = 0; i < taille; i++)
    {
        int lettre = position_alphabet(message[i]);
        if (lettre != -1)
        {
            int addon = position_alphabet(cle[i % taille_cle]);
            int new0 = (addon + lettre) % 26;
            message[i] = of_position_alphabet(new0);
        }
    }
  }
  public static void main(String args[])
  {
    int taille_cle;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      taille_cle = scanner.nextInt();
    } else {
      taille_cle = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    char[] cle = new char[taille_cle];
    for (int index = 0; index < taille_cle; index++)
    {
        char out0 = scanner.findWithinHorizon(".", 1).charAt(0);
        cle[index] = out0;
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    int taille;
    if (scanner.hasNext("^-")) {
      scanner.next("^-");
      taille = scanner.nextInt();
    } else {
      taille = scanner.nextInt();
    }
    scanner.findWithinHorizon("[\n\r ]*", 1);
    char[] message = new char[taille];
    for (int index2 = 0; index2 < taille; index2++)
    {
        char out2 = scanner.findWithinHorizon(".", 1).charAt(0);
        message[index2] = out2;
    }
    crypte(taille_cle, cle, taille, message);
    for (int i = 0; i < taille; i++)
        System.out.print(message[i]);
    System.out.print("\n");
  }
  
}



<|start_filename|>out/aaa_00hello.cs<|end_filename|>
using System;

public class aaa_00hello
{
  
  public static void Main(String[] args)
  {
    Console.Write("Hello World\n");
  }
  
}

