4. Лесни задачи

Трудности при решаване на "лесни" задачи:
Примери:
1. Прости дроби - нареждане по големина

2. Геометрични задачи
3. Задачи за низове:


 Intersection

You are to write a program that has to decide whether a given line segment intersects a given rectangle.  The line is said to intersect the rectangle if the line and the rectangle have at least one point in common. The rectangle consists of four straight lines and the area in between. Although all input values are integer numbers, valid intersection points do not have to lay on the integer grid.

Input
The input consists of n test cases. The first line of the input file contains the number n. Each following line contains one test case of the format:

xstart ystart xend yend xleft ytop xright ybottom

where (xstart, ystart) is the start and (xend, yend) the end point of the line and (xleft, ytop) the top left and (xright, ybottom) the bottom right corner of the rectangle. The eight numbers are separated by a blank. The terms top left and bottom right do not imply any ordering of coordinates.

Output
For each test case in the input file, the output file should contain a line consisting either of the letter "T" if the line segment intersects the rectangle or the letter "F" if the line segment does not intersect the rectangle.

Sample Input
1
4 9 11 2 1 5 7 1

Sample Output

F


Неповтарящ се символ
Да се напише програма, която намира първия неповтарящ се символ в даден низ.
Bходът съдържа един низ, в който може да се срещат произволни символи от ASCII таблицата. Няма ограничение за дължината на низа. Изходът съдържа един символ - първия неповтарящ се символ или "none" ако няма такъв символ.
Примерен вход
tatoo
Изход за примерния вход
a


Редици еднакви числа

Дадена е редица от N цели неотрицателни числа (N<10001). Да се намери най-дългата подредица, съдържаща еднакви числа.

Вход:
Първият ред съдържа число N - дължината на редицата. Следващите редове съдържат точно N цели числа. Последният ред съдържа числото 0.

Изход:
Ред от изхода съдържа дължината на намерената подредица.

Примерен вход:
16
1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 8
4
1 2 3 4
0

Изход за примерния вход:
14
1