This post is all about the solution of the "Mario and the Broken String" Starters 64 (Rated till 5-stars) Problem Statement.

Building Race Codechef solution

Codechef 



Problem Statement:

Mario intended to present Princess with a string SS of even duration NN.

Mario has been clumsy, and as a result, the string snapped in the centre. He now has two strings, AA and BB, with A = S[1, fracN2]. A=S[1,2N] and B = S[fracN2 + 1, N]. B=S[2N+1,N].



Mario is unsure of the sequence in which the strings AA and BB should be joined to form the string SS. As a result, he can enlist the strings in just about any randomized order. Determine whether Mario will always get the same string SS if he joins the substring AA and BB in any sequence.



S[L, R] denotes a substring of string SS beginning at index LL and having a length of (R - L + 1)(RL+1).

Format of Input :

The set of test cases will be indicated by a single numeric TT in the first line of input.
Evey testing phase has a single line of input with 3 space-separated integers X, YX, Y, and ZZ: the values mentioned in the statement.

Format of the Output :

For every testing phase, output each integer on a new product: the minimum of cartons required to bundle all the novels.


Also Check this out:-

Avoid Squares Please Starters 63 (Rated till 6-stars) Problem Solution Click Here

Also Read :- Top Programming Languages of 2022 Click Here

Solution of the Problem: Click Here