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. Tempter of the Bone--hdu1010--zoj2110

    Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  2. Linux - Reset a MySQL root password

    Use the following steps to reset a MySQL root password by using the command line interface. Stop the ...

  3. JDK PATH 和 CLASSPATH环境变量的作用及其配置

    (1)PATH环境变量的作用 在安装JDK程序之后,在安装目录下的bin目录中会提供一些开发Java程序时必备的工具程序. 对于Java的初学者,建议在命令符模式下使用这些工具程序编译运行Java程序 ...

  4. CSS3----background:-webkit-gradient()渐变效果

    input[type="button"], input[type="button"]:visited { background: -webkit-gradien ...

  5. LeetCode_Palindrome Partitioning

    Given a string s, partition s such that every substring of the partition is a palindrome. Return all ...

  6. MVC后台绑定dropdownList

     public ActionResult Index()         {             List<SelectListItem> items = new List<Se ...

  7. vb串口通信界面

    界面如上: 程序如下: Dim num As Byte     '申明一个全局变量为单字节型 '单击“清空接收缓冲区”按钮时,将接收缓冲区清空,此过程为“清空接收缓冲区”的单击事件 Private S ...

  8. 安全:加固你的ssh 登录

    SSH 是我们控制虚拟主机的一种途径,这个途径可以让我们拥有完全的控制权,如果对于这个控制权没有进行很好的安全处理,那么将会造成很大的安全问题.      我们可以在系统的日志文件 (例如:/var/ ...

  9. SSH2.0编程 ssh协议过程实现

    之前为了自己做一套SSH,先自己实现了一套telnet.但经过这么多天的苦逼,发现以前的工作都是徒劳.ssh的协议很繁杂,核心的内容在于密码算法,而且自己很难在网上找到周全的细节讲解与详细的实现,只有 ...

  10. tcp 状态示码 及 三次握手

    TCP的几个状态对于我们分析所起的作用. 在TCP层,有个FLAGS字段,这个字段有以下几个标识:SYN, FIN, ACK, PSH, RST, URG. 其中,对于我们日常的分析有用的就是前面的五 ...