Internet Problem Solving Contest

IPSC 2001

Problem A – Andrew's Exams II

Last year, one problem in the IPSC contest was about hard questions one can encounter on entrance exams to Comenius University. Believe it or not, this year is no different from the previous one and lots of students will be soon taking the exam. And similarly to the previous year, Andrew, who was in charge of preparing the questions, went to a conference and left his colleagues with a copy of the questions. Unfortunately he forgot to include solutions to his problems. His colleagues were able to find correct solutions to all problems but one. Since there is no way how to contact Andrew, they need your help.

A program is given that takes no input and runs for a very long time. In the end, it outputs a single integer N. Your task is to determine this integer.

Input file specification

The input file contains the source code of the program from the exam written in both Pascal and C languages. You may assume that both versions of the program are syntactically correct, do not result in a run-time error and produce the same output.

Note: The programs are designed for a hypothetical computer that allows arbitrarily large numbers (and may result in arithmetic overflow when run with a normal Pascal/C compiler).

Output file specification

The output file should contain a single integer printed by the program the source of which is given in the input file.


Input file:
var a, i: integer;

  a := 0;
  for i:= 1 to 9 do
    a := a * 10 + i;

#include <stdio.h>

void main() {
  int i, a;
  a = 0;
  for(i=1; i<=9; i++)
    a = a * 10 + i;
  printf("%d\n", a);


Output file: