Problems
10138 - Friends

Friends

Time Limit: 1 sec

The Problem

A, B and C are three best friends. One day they are collecting mangoes from a tree in a deep forest. After collecting some mango they feel very tired and make decision to take rest for a while. After few hours A wake up from sleep and “divides all mangos into three equal divisions but there are one extra mango reminds after division”. Then A takes his part with extra one and goes back to the home. After that B wake up from sleep and do the same process as like as A does on the mango left. And C also does the process like his other two friends. After the last division processed by C, some mangos left in this forest. You can safely assume that they all will must takes extra one mango.

Find the minimum possible total number of mangos they collect before sleep. On which they can run their processes. The amount of mango can’t be negative.

The sample solution will be looks like below in C:

The Input

There is no input in this problem.

The Output

The output will contain one line with an integer which is the required minimum possible total number of mangoes.

[Note: The sample output is not the required answer of this problem.]

Sample Output

96

Inter University Programming Contest - 2017 [BGC Trust University Bangladesh]

Problem Setter: Milton Deb