Text from the official booklet. Refer to the PDF for original mathematical notation, formatting, and linked input files. Printed samples and inputs are reproduced as published.
A GIC researcher has bred a new species called the alomomofa, which multiplies at an incredibly fast rate. Each alomomofa can breed 3 more alomomofa every minute. The GIC researcher is working on a solution to stop them from multiplying, but she needs to know the total number of alomomofa after n minutes to determine how much of the solution to use to reduce the population back to 1. The alomomofa multiply in the following way: ● Initially, with 1 alomomofa, it breeds 3 more every minute ● When there are 20 alomomofa, they will merge into one alomomoja Given that alomomoja are unable to reproduce, help the GIC scientist find out how many alomomofa will be present after n minutes if the initial number of alomomofa is 1. Input Format A single integer n, representing the number of minutes. Output Format The first line should contain the total number of alomomofa after n minutes. The second line should contain the total number of alomomoja after n minutes. Sample Input Sample Output 3 4 3 Explanation After 1 minute, there will be 1 + 3 = 4 alomomofa. After 2 minutes, the total number of alomomofa will be 4 + 3 + 3 + 3 + 3 = 16. After 3 minutes, there will be 16 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 = 64 alomomofa. Every 20 alomomofa will merge to form 1 alomomoja, so there will be 4 alomomofa and 3 alomomoja remaining. Find the output for the following input: 10000000