Problem A. Small Addition

Author:A. Klenin   Time limit:5 sec
Input file:input.txt   Memory limit:200 Mb
Output file:output.txt  

Statement

You are to write a problem that reads two positive integers A and B with no more then five decimal digits and outputs their sum A+B.

Input file format

First line of input file contains two integers A and B.

Output file format

Output file must contain a single integer C = A+B.

Constraints

-10000 <= A, B <= 10000

Sample tests

No. Input file (input.txt) Output file (output.txt)
1
3 5
8

Problem B. Very Simple Problem

Author:Far-Eastern Subregional   Time limit:1 sec
Input file:input.txt   Memory limit:8 Mb
Output file:output.txt  

Statement

During a preparation of programming contest, its jury is usually faced with many difficult tasks. One of them is to select a problem simple enough to most, if not all, contestants to solve.

The difficulty here lies in diverse meanings of the term &quot;simple&quot; amongst the jury members. So, the jury uses the following procedure to reach a consensus: each member weights each proposed problem with a positive integer &quot;complexity rating&quot; (not necessarily different for different problems). The jury member calls &quot;simplest&quot; those problems that he gave the minimum complexity rating, and &quot;hardest&quot; those problems that he gave the maximum complexity rating.

The ratings received from all jury members are then compared, and a problem is declared as &quot;very simple&quot;, if it was called as &quot;simplest&quot; by more than a half of the jury, and was called as &quot;hardest&quot; by nobody.

Input file format

The first line of input file contains integers N and P, the number of jury members and the number of problems. The following N lines contain P integers in range from 0 to 1000 each - the complexity ratings.

Output file format

Output file must contain an ordered list of &quot;very simple&quot; problem numbers, separated by spaces. If there are no such problems, output must contain a single integer 0 (zero).

Constraints

1 &le; N, P &le; 100

Sample tests

No. Input file (input.txt) Output file (output.txt)
1
4 4
1 1 1 2
5 900 21 40
10 10 9 10
3 4 3 5
3

Problem C. Bipartite graph

Author:StdAlg (adapted by T. Chistyakov, A. Klenin)   Time limit:2 sec
Input file:input.txt   Memory limit:64 Mb
Output file:output.txt  

Statement

For a given undirected graph with N vertices and M edges you need to figure out whether the graph is bipartite or no.

NOTE. A graph is called bipartite if it's possible to split its vertices into two non-empty sets so that there is no edges between any two vertices from the same set.

Input file format

Input file contains integers N M, then M pairs of integers ai bi describing the edges of the graph.

Output file format

Output BIPARTITE if the graph is bipartite or NO if it is not.

Constraints

1 ≤ N ≤ 100000, 0 ≤ M ≤ 1000000

Sample tests

No. Input file (input.txt) Output file (output.txt)
1
3 2
1 2  1 3
BIPARTITE
2
4 6
1 2  2 3  3 4  4 1  1 3  2 4
NO

0.188s 0.010s 17