1.000s
128MB
输入包括 lns="http://www.w3.org/1998/Math/MathML">n+m+1n+m+1 行。
第一行两个整数 lns="http://www.w3.org/1998/Math/MathML">n,mn,m。
接下来 lns="http://www.w3.org/1998/Math/MathML">nn 行,第 lns="http://www.w3.org/1998/Math/MathML">i+1i+1 行两个整数 lns="http://www.w3.org/1998/Math/MathML">x_i,y_ixi,yi 表示第 lns="http://www.w3.org/1998/Math/MathML">ii 支军队的位置。
接下来 lns="http://www.w3.org/1998/Math/MathML">mm 行,每行首先是一个字符 lns="http://www.w3.org/1998/Math/MathML">cc。
m
x
y
3 3 0 0 4 -3 6 7 x m -1 2 y
1 2 -3 5 -5 -5
对于 lns="http://www.w3.org/1998/Math/MathML">30\%30% 的数据,lns="http://www.w3.org/1998/Math/MathML">1\leqslant n,m\leqslant 10001⩽n,m⩽1000。
对于 lns="http://www.w3.org/1998/Math/MathML">100\%100% 的数据,lns="http://www.w3.org/1998/Math/MathML">1\leqslant n,m\leqslant 5\times 10^51⩽n,m⩽5×105,lns="http://www.w3.org/1998/Math/MathML">x_i,y_ixi,yi 在 int 范围内。
int