# CSAW CTF Quals 2018 - Take an L Writeup

This task is not a common CTF problem, but a very well-known math olympiads and informatics olympiads problem. It’s not very difficult, but I’m doing this writeup because I think it’s one of the problems you have to know before any math or informatics competition.

The server says that we have a

## Problem Analysis

We’ll now prove the following: let

*Proof: let’s prove this by induction: for trivially we can just use one polyomino and cover the remaining 3 squares. So assuming it works for let’s prove it for : without loss of generality we can assume that the missing square lies in the portion of grid between (we’re labeling the squares from top left) and (otherwise we can just rotate the grid) so filling with one polyomino the squares labeled , and and cutting the grid in four parts we obtain 4 different grids with one missing square, and so by the inductive hypothesis we are done.*

## Solution

Why have we proven that result? Because the algorithm used in the proof is our solution! We just have to implement it recursively and we are done. The following Python script does the job:

1 | from pwn import * |

and we can find the flag `flag{m@n_that_was_sup3r_hard_i_sh0uld_have_just_taken_the_L}`