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. python学习视频整理

    python3英文视频教程(全87集) http://pan.baidu.com/s/1dDnGBvV python从入门到精通视频(全60集)链接:http://pan.baidu.com/s/1e ...

  2. c# 大量拼接xml时内存溢出解决方法

    public static string SelectUNnormalPriceSTrans(EUNnormalPriceS rqInfo) { string guidStrJianJclFirst ...

  3. 如何在异步请求时设置RequestHeader

    一.为何要用到setRequestHeader 通常在HTTP协议里,客户端像服务器取得某个网页的时候,必须发送一个HTTP协议的头文件,告诉服务器客户端要下载什么信息以及相关的参数.而 XMLHTT ...

  4. UESTC 75 The Queen's New Necklaces

    题意:一个项链的珠子的颜色有若干种.每种颜色的珠子个数为Ai.求有多少种不同的项链? 我们考虑,如果旋转i个珠子,那么会产生gcd(n,i)个循环节,每个循环节的大小我们假设为K,那么如果有一个颜色的 ...

  5. 【转】ubuntu设置PATH----不错

    原文网址:http://no001.blog.51cto.com/1142339/554927 试了好多遍,多无效.. 最后在/etc/enviroment下设置才有效. 不过让有一些未解问题 我使用 ...

  6. bzoj1379 [Baltic2001]Postman

    Description 邮递员每天给N个村子的人送信,每个村子可能在某个十字路口上,或一条路的中央. 村子里的人都希望早点收到信,因此与邮递员达成一个协议:每个村子都有一个期望值Wi,如果这个村子是邮 ...

  7. 特殊权限:SUID,SGID,Sticky

    特殊权限passwd:s SUID: 运行某程序时,相应进程的属主是程序文件自身的属主,而不是启动者:    chmod u+s FILE    chmod u-s FILE        如果FIL ...

  8. LINQ to SQL 增,删,改

    添加   InsertOnSubmit(单个对象)  或  InsertAllOnSubmit(集合) 删除   DeleteOnSubmit (单个对象)             DeleteAll ...

  9. python学习之路-8 面向对象之进阶

    上篇内容回顾和补充 面向对象三大特性 封装 继承 多态 在python中没有多态的概念 变量的类型允许为多种数据类型称之为多态 # c#/java中的多态 # 伪代码 def func(int arg ...

  10. CDN云主机与传统虚拟主机功能对比

    CDN云主机与传统虚拟主机功能对比 传统的虚拟主机都是单台服务器,一旦机器硬件损坏.IP被封.机房网络故障等,都将导致网站不能访问,严重的情况数据还无法及时取回,即使想换一家服务商也因为没有数据而无能 ...