This post is all about the solution of the "A. Cowardly Rooks" Educational Codeforces Round 138 (Rated for Div. 2) Problem Statement.

Codeforces logo

Codeforces




Problem Statement :

A chess game of size nn does have m rooks placed on it in a way that:

There are not two rooks within the same cell.

There aren't any rooks that attack one another.

A rook attacks every cell in its column or row.



Is it possible to relocate exactly each rook (you get to choose which one) to a variety of cell types to ensure that no two rooks strike each other? Unless other rooks are in its way, a rook can move into any cell in its column or row.



Format of Input :

The contribution includes one line with a solitary numeric m (1m105), the highest allowable significance of y.

Format of the Output :

Publish "YES" for every test case if it's possible to move exactly each rook into a variety of cell types so that no two rooks strike each other. Or else, type "NO."


Also Check this out:-

B. Death's Blessing Educational Codeforces Round 138 (Rated for Div. 2) Problem Solution Click Here

C. Number Game Educational Codeforces Round 138 (Rated for Div. 2) Problem Solution Click Here

D. Counting Arrays Educational Codeforces Round 138 (Rated for Div. 2) Problem Solution Click Here



Also Read :- Top Programming Languages of 2022 Click Here

Solution of the Problem: Click Here