You will be given 5 algorithmic tasks with various levels of difficulty. I've tried my best to write short and clear, but also interesting statements. The main character of every task will be Miguel. I want to mention that this is my first contest and I really hope you will enjoy it.
Huge thanks to Alex Vasiluță for testing the problems and providing useful feedback.