Limits 1s, 512 MB

Inside each of us, there is the seed of both good and evil. It's a constant struggle as to which one will win. And one cannot exist without the other.
~Eric Burdon

Segment দের নির্দিষ্ট পরিমাণে ভালো আর খারাপ পার্ট থাকে।
উদাহরণের জন্য চলুন একটি segment নেই পয়েন্ট LL থেকে পয়েন্ট RR পর্যন্ত। ধরি MM == ((L+R)/2)\lfloor{((L+R)/2)}\rfloor হচ্ছে একটি integer point যা নিচের দিকে রাউন্ড করা হয়েছে। সেগমেন্ট এর পার্ট LL থেকে MM পর্যন্ত ভালো আর বাকি অংশটুকু খারাপ।

শুরুতে আপনার কাছে একটি খালি set আছে integer segment এর। আপনাকে সেট এর উপর QQ সংখ্যক অপারেশন চালাতে হবে মোট তিন ধরণেরঃ

Type 1: একটি segment LL থেকে RR সেটি set এ যোগ করুন।
Type 2: একটি segment LL থেকে RR যেটি এখন set এ আছে, সেটিকে বাদ দিন সেট থেকে।
Type 3: একটি integer point XXদেওয়া আছে, সে পয়েন্টটি মোট কতোগুলো ভালো আর খারাপ পার্ট এর অংশ সেটি খুঁজে বের করুন।

Input

ইনপুটের প্রথম লাইনে থাকবে একটি integer QQ (3Q2×105)(3 \leq Q \leq 2×10^5) যা মোট অপারেশনের সংখ্যা নির্দেশ করে।
পরবর্তী মোট QQ লাইনের প্রতিটি লাইন একটি করে কুয়েরি নির্দেশ করে।
Type 1: 11 LL RR (1L<R1016)(1 \leq L < R \leq 10^{16}).
Type 2: 22 LL RR (1L<R1016)(1 \leq L < R \leq 10^{16}).
Type 3: 33 XX (1X1016)(1 \leq X \leq 10^{16}).

For 40 Points: Every constraint is less than or equal to 10310^3.
For 100 Points: Original constraints.

Output

প্রতিটি তৃতীয় ধরণের কুয়েরি এর জন্য, দুটি integers GG এবং EE প্রিন্ট করুন, যা space দিয়ে আলাদা করা থাকবে প্রতি লাইনে। GG হচ্ছে মোট ভালো segments এর সংখ্যা আর EE হচ্ছে মোট খারাপ segments এর সংখ্যা যেগুলোর অংশ হচ্ছে point XX

Sample

InputOutput
7
1 1 9
1 3 9
3 6
3 5
2 3 9
3 9
3 10
1 1
2 0
0 1
0 0

The first operation is to add a segment from 1 to 9. Here from 1 to 5 is good and 6 to 9 is evil.
The second operation adding another segment from 3 to 9. Here, 3 to 6 is good and 7 to 9 is evil.
The third operation is a query for point 6. Point 6 is intersecting with the first segment’s evil part and the second segment’s good part.


Submit

Login to submit.

Statistics

68% Solution Ratio
user.545264Earliest, Aug '21
nusuBotFastest, 0.1s
prajjwal07Lightest, 14 MB
Md_AbdullahShortest, 1571B
Toph uses cookies. By continuing you agree to our Cookie Policy.