Stamps X80452


Statement
 

pdf   zip

We want to send a postcard by mail. We need to stamp worth nn cents. Stamps have values 7 and 4 cents. As space is limited we want to know the minimum number of stamps we need to put on the postcard, without losing a cent.

Input

The input is a sequence of integer numbers. Each number in the sequence is greater than 1919.

Output

For each integer nn in the input, a line with two numbers p0p \ge 0 and q0q \ge 0 such that n=7p+4qn = 7p + 4q and p+qp+q is minimum among all possible choices.

Public test cases
  • Input

    20
    31
    53
    127
    

    Output

    0 5
    1 6
    7 1
    17 2
    
  • Information
    Author
    Jorge Castro
    Language
    English
    Translator
    Original language
    Catalan
    Other languages
    Catalan Spanish
    Official solutions
    Unknown.
    User solutions
    C++