Teacher2Teacher 
Q&A #1592 
View entire discussion [<< prev]
From: jack <jackfeb2012@gmail.com> To: Teacher2Teacher Public Discussion Date: 2013021120:43:22 Subject: Please explain me how to solve and what approach i should use to solve these problems You have 4 types of lego blocks, of sizes 1 * 1 * 1, 1 * 1 * 2, 1 * 1 * 3 and 1 * 1 * 4. Assume you have infinite number of blocks of each type. You want to make a wall of height N and width M out of these blocks. The wall should not have any holes in it. The wall you build should be one solid structure. A solid structure means that it should not be possible to separate the wall along any vertical line without cutting any lego block used to build the wall. The blocks can only be placed horizontally. In how many ways can the wall be built? Input: The first line contains the number of test cases T. T test cases follow. Each case contains two integers N and M. Output: Output T lines, one for each test case containing the number of ways to build the wall. Sample Input: 4 2 2 3 2 2 3 4 4 Sample Output: 3 7 9 3375
Post a reply to this message

[Privacy Policy] [Terms of Use]
Math Forum Home 
The Math Library 
Quick Reference 
Math Forum Search