Measuring Lengths in Baden, lengthsbaden

Source: Internet
Author: User

Measuring Lengths in Baden, lengthsbaden
DescriptionMeasuring Lengths in Badentime limit per test: 2 secondsmemory limit per test: 256 megabytesinput: standard inputoutput: standard output

Lengths are measures in Baden in inches and feet. To a length from centimeters it is enough to know that an inch equals three centimeters in Baden and one foot contains 12 inches.

You are given a length equalNCentimeters. Your task is to convert it to feet and inches so that the number of feet was maximum. The result shocould be an integer rounded to the closest value containing an integral number of inches.

Note that when you round up, 1 cm rounds up to 0 inches and 2 cm round up to 1 inch.

Input

The only line contains an integerN(1 digit ≤ DigitNLimit ≤ limit 10000 ).

Output

Print two non-negative space-separated integersAAndB, WhereAIs the numbers of feet andBIs the number of inches.

Sample test (s)

Input
42
Output
1 2
Input
5
Output
0 2

 

 

 

 

 

 

 

 

Question: Switch the input centimeter to ft. inch, and turn it around ".

Code:

 1 #include <stdio.h> 2 #include <stdlib.h> 3  4 int main() 5 { 6     int n, a, b; 7     scanf("%d", &n); 8     a = n/36; 9     b = (n-36*a)/3;10     if(n-36*a-3*b == 2) {11         b++;12         if(b==12) {13             a++;14             b = 0;15         }16     }17     printf("%d %d", a, b);18     return 0;19 }

 

Problem-125A-Codeforces

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.