## CCCHK '15 S5 - Can I pass the courses?

View as PDF

Points: 25 (partial)
Time limit: 0.2s
Memory limit: 256M

Problem types

There are many students in the University of Hong Kong. Some of them are hardworking, some are clever and some are both hardworking and clever. We use two real numbers to describe a student. HWP (Hard Working Point) describes how hardworking she is, and CP (Clever Point) describes how clever she is.

There are many courses in the University of Hong Kong. For some of the courses, like physics, student must work very hard and do a lot of exercise to pass the course. So students with high HWP can pass it easily. Of course, if a student is clever, it also helps a little. For some other courses, like artificial intelligence, CP helps a lot and HWP helps a little. So we can also use two real numbers and to describe a course. A student can pass the course if and only if

There is a course management system, teachers can create new courses or cancel courses, and students can know if she can pass all the courses that exist right now.

#### Input Specification

The first line of the input contains one integer , representing the number of operations.

Each of the following lines contains some numbers describing an operation.

• If the first number is , it means a teacher creates a new course. Then the following three numbers in this line are of the course. , and is an integer)
• If the first number is , it means a teacher cancels an old course. Then the following one number in this line represents the of the course to cancel. It is guaranteed that this course exist before deleting.
• If the first number is , it means a student wants to know if she can pass all the courses that exists right now, the following two number in this line are HWP and CP of the student.

To avoid precision problems, for any student and any course, .

• For of the test cases, .
• For other of the test cases, there is no cancel operation.
• For of the test cases, .

#### Output Specification

For each student, if she can pass all the courses, print a line with single integer . Otherwise, print a line with single integer .

#### Sample Input 1

8
0 1 2 1
0 5 0.2 2
2 0.1 2
2 0.1 3
0 0.13 0.59 3
0 2.44 0.78 4
2 3 1
2 1 3

#### Sample Output 1

0
1
0
1

#### Sample Input 2

10
0 1 2 1
0 5 0.2 2
2 0.1 2
2 0.1 3
1 2
2 0.1 2
0 0.13 0.59 3
0 2.44 0.78 4
2 3 1
2 1 3

#### Sample Output 2

0
1
1
0
1