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. 异步编程设计模式Demo - AsyncComponentSample

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.C ...

  2. php 和 apache的关系

    例如在客户端游览器输入他也回把这个地址传送到192.168.1.100里的apache里的,apache一看你传过来的是Php文件,如果在服务器没装php的情况下,他也会把这个文件打开,把里面的代码全 ...

  3. CoreData的数据迁移

    CoreData的数据迁移   很多人说CoreData坑多,现在才感觉到,今天上午写代码的时候,发现了一个大问题. 过程如下,之前我自己给coredata的实体添加了几个字段,后来网上的一个用户说我 ...

  4. ET 与RETI 基于51单片机中断跳出指令“RETI”浅议

    最近在基于51单片机编程的过程中出现了个很奇怪的问题“程序执行中在寄存器EA=1,ET0=1,TR0=1条件下,单TF0=1时并没有执行中断”.在有过单片机中断编程经历者都知道当EA=1,ET0=1的 ...

  5. Linux批量重命名

    http://blog.csdn.net/qm4050/article/details/8472464 http://www.jb51.net/article/33902.htm http://hi. ...

  6. device tree website

    每一个设备都有相对应的初始化程序,dts的写法可以参照Documentations/devicetree/下面的文档 http://bbs.chinaunix.net/thread-4139331-1 ...

  7. Poj3468-A Simple Problem with Integers(伸展树练练手)

    Description You have N integers, A1, A2, ... , AN. You need to deal with two kinds of operations. On ...

  8. Colorful Lecture Note(手工栈)

    题目1 : Colorful Lecture Note 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Little Hi is writing an algorithm ...

  9. 基于Android的物理类游戏,源代码(JAVA)分享

    游戏视频DEMO:http://v.youku.com/v_show/id_XNTM5MzM1Mzg0.html?from=s1.8-1-1.2 说明:一个自己做的Android上的物理类游戏,物理引 ...

  10. ofbiz安装优化

    一. 1.安装jdk 2.安装数据库 3.安装ant yum install ant 4.编译启动ofbiz cd /ofbiz目录下 ant run-install ./startofbiz.sh ...