Z algorithm and aplication un a problem
B_div1 round 182 solved using floyd-warshall algorithm