cho.sh
Notes
Loading...

Hamburger Love

Time limit

2s

Memory limit

128 MB

Problem

Minhyuk likes two kinds of hamburgers. It takes him n minutes to eat one hamburger of the first kind and m minutes to eat one hamburger of the second kind.

He wants to spend a total of t minutes eating hamburgers. If he starts eating a hamburger, he must finish it before the t minutes end. During any remaining time when he is not eating a hamburger, he drinks cola.

Choose a plan by the following rules.

  1. Make the cola-drinking time as small as possible.
  2. If several plans have the same cola-drinking time, choose one that eats the largest number of hamburgers.

Input

The first line contains n, m, and t, separated by spaces. All three numbers are positive integers no greater than 10,000.

Output

Output two integers on one line, separated by a space. The first integer is the number of hamburgers eaten, and the second integer is the time spent drinking cola.