ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Olimpiada Kombetare > задача:


2014-2. 50738 - Median value

Гость
• Обсуждение задачи (1)

Задачи сборника

• 2013-1. 50591 - Viti i brishte
• 2013-3. 50570 - Numrat prim ne se...
• 2013-4. 50958 - ATM
• 2013-5. Dhomat e hotelit
• 2013-6. 50562 - Lista e studenteve
• 2012-1. Bursa
• 2012-4. 50680 - Trekendeshi
• 2012-5. 50551 - Kamelot
• 2014-2. 50738 - Median value
• 2012-3. 50721 - Palindroma

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Prepared by: Evis Hoxha. Сложность Бета

Median value

Given N objects with different materials, whose hardness is specified by a natural number Y. Scientists want to make some experiments. For this they need a program to calculate the median of the numbers.

Your program should be able to calcualate the median of three numbers specified by their index and the median of all the numbers.

Input
The first line is the number of objects N, which is an odd number. The following line contains N numbers, which are the hardness of the objects. The next line contains a number K. The following K lines contain three numbers which represent the indexes of the objects.(index starts with 0)

Output
The first line is the median value of the N objects. Then, the following K lines contain the position of the median value.

Input I
5
2 5 4 3 1
3
0 1 2
2 3 0
3 2 4
Output 1
3
2
3
3

Для отправки решений необходимо выполнить вход.

www.contester.ru