Takashi is playing a puzzle game. The puzzle involves placing multiple puzzle pieces on a square board to fill it completely without any gaps or overlaps. Your task is to write a program to check whether the board and the given pieces can form a valid puzzle. Rules & Definitions The Board: • The board is a square of size N * N, divided into 1 * 1 squares. The Pieces: • There are M pieces in total. • Each piece consists of one or more 1 * 1 tiles. • The tiles within a single piece must be connected by sharing an entire side (not just a corner). Placement Rules:
Output Format Output Yes if the board can be filled exactly with all the given pieces according to the rules. Otherwise, output No.
Constraints • 1<=N<=4, integer • 1<=M<=N^2 integer • S(i, j) is a string of length N consisting of only . or #.
Quickshell Backend • Pending