Description
Measuring Lengths in Baden
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: 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 equal to n centimeters. Your task is to convert it to feet and inches so that the number of feet was maximum. The result should 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 integer n (1 ≤ n ≤ 10000).

Output

Print two non-negative space-separated integers a and b, where a is the numbers of feet and b is the number of inches.

Sample test(s)

input
42
output
1 2
input
5
output
0 2

题解:输入厘米 转换为英尺英寸 注意四舍五入,"得寸进尺"。

代码:

 #include <stdio.h>
#include <stdlib.h> int main()
{
int n, a, b;
scanf("%d", &n);
a = n/;
b = (n-*a)/;
if(n-*a-*b == ) {
b++;
if(b==) {
a++;
b = ;
}
}
printf("%d %d", a, b);
return ;
}

Problem - 125A - Codeforces

Measuring Lengths in Baden的更多相关文章

  1. CF125A Measuring Lengths in Baden 题解

    Content 在 Baden,一英寸等于 \(3\) 厘米,一英尺等于 \(12\) 英寸. 现在有一个 \(n\) 厘米的物体,求在 Baden,它是几英尺又几英寸. 数据范围:\(1\leqsl ...

  2. codeforces 125 A-E 补题

    A Measuring Lengths in Baden 进制转换 水题 #include<bits/stdc++.h> using namespace std; int main() { ...

  3. Measuring Signal Similarities

    http://cn.mathworks.com/help/signal/examples/measuring-signal-similarities.html Open This Example   ...

  4. Measuring the amount of writes in InnoDB redo logs

    Choosing a good InnoDB log file size is key to InnoDB write performance. This can be done by measuri ...

  5. [java bug记录] java.util.zip.ZipException: invalid code lengths set

    1. 描述:将代码迁移到maven工程,其中用ZipInputStream读取/src/main/resources下的zip文件时报错:“java.util.zip.ZipException: in ...

  6. USACO Section 5.3 Milk Measuring (IDDFS+dp)

    迭代加深搜索,从小到大枚举桶数的上限maxd:对每个maxd,枚举每个组合,判断是否能够倒出q:直到得到answer.判断的部分就用dp(完全背包). ------------------------ ...

  7. Measuring & Optimizing I/O Performance

    By Ilya Grigorik on June 23, 2009 Measuring and optimizing IO performance is somewhat of a black art ...

  8. Measuring Text Difficulty Using Parse-Tree Frequency

    https://nlp.lab.arizona.edu/sites/nlp.lab.arizona.edu/files/Kauchak-Leroy-Hogue-JASIST-2017.pdf In p ...

  9. AtCoder Regular Contest 102 D - All Your Paths are Different Lengths

    D - All Your Paths are Different Lengths 思路: 二进制构造 首先找到最大的t,使得2^t <= l 然后我们就能构造一种方法使得正好存在 0 到 2^t ...

随机推荐

  1. AngularJS中的控制器示例_3

    <!doctype html> <html ng-app="myApp"> <head> <script src="C:\\Us ...

  2. secure_file_priv 配置项对数据导入导出的影响

    secure_file_priv  mysqld 用这个配置项来完成对数据导入导出的限制. 例如我们可以通过 select * from tempdb.t into outfile '/home/my ...

  3. C51工具是怎么进行覆盖分析的

    C51工具针对8051微控制器的有限存储器资源进行了优化设计. 为了最有效地利用存储器,根据一个很容易解释的方法,自动变量和函数参数在存储器中均进行覆盖处理. 首先,连接器根据源程序生成调用树.例如: ...

  4. DEVExpress For WPF 中GridControl如何实现滚动分页(延迟查询)

    在显示大量数据时一般采用分页显示,但是最近用户需要滚动显示,那么问题来了,滚动显示要求将数据全部查询回来,这显然会导致显示速度很慢. 好在想到一种方式,就是当用户滚动鼓动条的时候再查询下面的数据.好吧 ...

  5. rsyslog input 不支持变量

    input(type="imfile" File="/usr/local/apache-tomcat-7.0.55_8082/logs/localhost_access_ ...

  6. 发送cookie

  7. Reverse Linked List II 解答

    Question Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Giv ...

  8. Gray Code 解答

    Question The gray code is a binary numeral system where two successive values differ in only one bit ...

  9. 【POJ1003】Hangover(二分搜索)

    直接用库函数二分即可. #include <iostream> #include <cstring> #include <cstdlib> #include < ...

  10. JQuery 选择器 *很重要 多记

    1)基本选择器: 跟CSS选择器类似 2) 层次选择器 div>span   紧接这div同一级下的全部span .one+div     同一等级的div #two~div    同一等级di ...