Triangular Paths Solution Codeforces Round #710 Div. 3

Consider an infinite triangle made up of layers. Let’s number the layers, starting from one, from the top of the triangle (from top to bottom). The kk-th layer of the triangle contains kk points, numbered from left to right. Each point of an infinite triangle is described by a pair of numbers (r,c)(r,c) (1≤c≤r1≤c≤r), where rr is the number of the layer, … Read more