IOI'94 - Day 1 - Problem 3: The Primes

Competition Rules

Problem Statement

Example input and output files from the problem statement (see below for format of output file): There are 4 tests. Each successfully completed test gives 8 points. Therefore the maximum number of points for this problem is 40. The maximum execution time is 90 seconds per test.

Test Data

N.B.The following test data were not available during the competition. They were used to judge the programs of the competitors after the competition.

The order in which squares are presented in the output file is free. The test output files contain the squares in one order only; all permutations, however, are correct too.

  1. Input / Output (11, 5; has 1 solution)
  2. Input / Output (37, 9; has 3 solutions)
  3. Input / Output (35, 5; has 1 solution)
  4. Input / Output (13, 4; has 1 solution)

Analysis and Solution