Master Spark
题号:NC238005
时间限制:C/C++/Rust/Pascal 4秒,其他语言8秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

You are playing Touhou Impershiable Night, a bullet curtain shooting game, and are fighting against Kirisame Marisa, the boss in stage 4B, who launchs master sparks to attack players. Following is a illustration of this scene.


输入描述:

The first line contains one integer , denoting the number of test cases.

For each test case:

The first line contatins three integers , denoting the size of the game region and the number of sparks.

Following n lines each contains four integers , denoting the parameters of given sparks.

It's guaranteed that .

输出描述:

Output one 01-string S of length T in one line where  iff such autowinning point exists in case i while  iff no such points.
示例1

输入

复制
2
1 1 2
1 -1 -1 0
2 -1 0 2
1 1 2
1 -1 -1 0
1 -2 0 1

输出

复制
01

说明

Following are the illustrations of two sample cases.