Burek
Baker Crumble has just baked N triangular burek2 pastries. Each pastry can be represented in the Cartesian coordinate system as a triangle with vertices in integer coordinate points. The baker's mischievous son Joey has just taken a large knife and started to cut the pastries. Each cut that Joey makes corresponds to a horizontal (y = c) or vertical (x = c) line in the coordinate system. Help the baker assess the damage caused by Joey's pastry cutting. Your task is to determine, for each Joey's cut, how many pastries are affected (such that both the left and right parts of the cut pastry have areas greater than zero).
3
1 0 0 2 2 2
1 3 3 5 4 0
5 4 4 5 4 4
4
x = 4
x = 1
y = 3
y = 1Output
0
1
1
2 Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.