Skip to content

Commit

Permalink
chore: day_20
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemincoder authored Apr 14, 2024
1 parent 13caeba commit e8d1595
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hard/day_20/problem.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Once Bluemin decided to adorn his living room with a tessellated floor.
The living room boasts dimensions n x m meters.
Bluemin had at his disposal planks of three varieties:
-a planks measuring 1 x 2 meters,
-b planks measuring 2 x 1 meters,
-c planks measuring 2 x 2 meters.

Your task is to aid Bluemin in determining whether it's feasible to embellish the living room with such a collection of planks. If possible, you should provide one potential arrangement.

Input:
The initial line presents 5 space-separated integers: n , m , a , b , and c ( 1 ≤ n, m ≤ 100 , 0 ≤ a, b, c ≤ 10^4 ). Here, n and m denote the living room dimensions, while a , b , and c represent the quantities of planks measuring 1 x 2 , 2 x 1 , and 2 x 2 meters respectively. It's imperative not to rotate the planks.

Output:
If it proves impossible to adorn the room with the given set of planks, you should output "IMPOSSIBLE". Otherwise, you should provide one potential arrangement, consisting of n lines with m lowercase Latin letters each. Adjacent squares containing the same letter signify that they belong to the same plank. If the answer isn't unique, any valid arrangement will suffice.
23 changes: 23 additions & 0 deletions hard/day_20/sample_test_cases.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Examples

input
2 6 2 2 1

output
aabcca
aabdda

input
1 1 100 100 100

output
IMPOSSIBLE

input
4 4 10 10 10

output
aabb
aabb
bbaa
bbaa
1 change: 1 addition & 0 deletions hard/day_20/solution.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//write your code here

0 comments on commit e8d1595

Please sign in to comment.