F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

stars

Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2624    Accepted Submission(s): 698


Problem Description
John loves to see the sky. A day has Q times. Each time John will find a new star in the sky, or he wants to know how many stars between $(x_1, y_1, z_1)$ and $(x_2, y_2, z_2)$.
 

Input
The first line contains a single integer $T(1 \leq T \leq 10)$ (the data for $Q > 100$ less than 6 cases),, indicating the number of test cases.
The first line contains an integer $Q(1 \leq Q \leq 50000)$,indicating how many times in a day.
Next Q lines contain some integers, first input an integer $A(1 \leq A \leq 2)$.If A=1 then input 3 integers x, y and z, indicating a coordinate of one star.. If A=2 then input 6 integers $x_1, y_1, z_1, x_2, y_2, z_2(1 \leq x, y, z, x_1, y_1, z_1, x_2, y_2, z_2 \leq 10^9, x_1 \leq x_2, y_1 \leq y_2, z_1 \leq z_2)$.
 

Output
For each ¡°A=2¡±,output an integer means how many stars in such a section.
 

Sample Input
2 11 1 1 1 1 2 1 1 1 1 1 1 1 2 2 2 1 1 1 2 2 1 1 1 2 2 2 1 3 3 3 1 4 4 4 1 5 5 5 1 6 6 6 2 1 1 1 6 6 6 2 3 3 3 6 6 6 11 1 1 1 1 2 1 1 1 1 1 1 1 2 2 2 1 1 1 2 2 1 1 1 2 2 2 1 3 3 3 1 4 4 4 1 5 5 5 1 6 6 6 2 1 1 1 6 6 6 2 3 3 3 6 6 6
 

Sample Output
1 3 7 4 1 3 7 4
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-18 12:30:04, Gzip enabled