Tuenti Challenge 9

Challenge 20 - Where is my money??

We have a problem here at Drunk-Tech... a HUGE problem.

Last week we left some of our interns alone to watch over our databases after having multiple beers. Who would ever imagine this could cause such a catastrophic situation??

This month we've noticed the monthly income from our clients has fallen a lot compared to previous months. We suspect something went wrong after the party. But we can't figure out where the problem is.

Because we love our clients and don’t want to raise our rates, we want to fix the situation ASAP and keep being the coolest telco. As you may know, our current rates are €0.03 a minute for calls and €0.10 for every full 100Mb of data.

We want you, our beloved DBA to calculate how much money we've really earned this month after fixing all our invoices. We'll share our invoice database with you so you can interact with it as you like. The DB is based on the original MariaDB Docker image.

You can download our database running docker pull drunktech/databases:1.0

Test your code

You can test your program against both the input provided in the test phase and the input provided in the submit phase. A nice output will tell you if your program got the right solution or not. You can try as many times as you want to. Be careful with extra whitespaces, the output should be exactly as described.

Test your program against the input provided in the test phase

Download test input

Program output:

Test your program against the input provided in the submit phase

Download input

Program output:

During the submit phase, in some problems, we might give your program harder inputs. As with the test token, a nice output will tell you if your program got the right solution or not. You can try as many times as you need.

In the actual contest you first need to solve the test phase before submitting the code, you must provide the source code used to solve the challenge and you can only submit once (once your solution is submitted you won't be able to amend it to fix issues or make it faster).

If you have any doubts, please check the info section.