A. Theatre Square(math)
1 second
256 megabytes
standard input
standard output
Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city's anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a × a.
What is the least number of flagstones needed to pave the Square? It's allowed to cover the surface larger than the Theatre Square, but the Square has to be covered. It's not allowed to break the flagstones. The sides of flagstones should be parallel to the sides of the Square.
The input contains three positive integer numbers in the first line: n, m and a (1 ≤ n, m, a ≤ 109).
Write the needed number of flagstones.
6 6 4
4
水题但是错了n次,归其原因还是对C语言不太熟悉,很多东西我还都不知道——int64,什么时候用这个,真的不太了解,未来的路还很长,加油
AC代码
#include<stdio.h>
#include<math.h> int main()
{
__int64 n,m,a;
__int64 L,W; scanf("%I64d%I64d%I64d",&n,&m,&a);
if( n%a == )
L = n/a;
else
L = n/a + ; if( m%a == )
W = m/a;
else
W = m/a + ; printf("%I64d\n", W*L); return ;
}
A. Theatre Square(math)的更多相关文章
- Educational Codeforces Round 88 (Rated for Div. 2) B. New Theatre Square(贪心)
题目链接:https://codeforces.com/contest/1359/problem/B 题意 有一块 $n \times m$ 的地板和两种瓷砖: $1 \times 1$,每块花费为 ...
- 组合数学(math)
组合数学(math) 题目描述 为了提高智商,zjy开始学习组合数学.某一天她解决了这样一个问题:“给一个网格图,其中某些格子有财宝.每次从左上角出发,只能往右或下走.问至少要走几次才能把财宝全部捡完 ...
- js 算數(Math)對象
算數對象不需要聲明,可以直接使用, Math對象方法及作用: round()四捨五入: random()生成0到1的隨機數: max()選擇較大的數: min()返回較小的數:
- Digital Square(hdu4394)搜索
Digital Square Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- HDU 1518 Square(DFS)
Problem Description Given a set of sticks of various lengths, is it possible to join them end-to-end ...
- UVA 11520 Fill the Square(模拟)
题目链接:https://vjudge.net/problem/UVA-11520 这道题我们发现$n\leq 10$,所以直接进行暴力枚举. 因为根据字典序所以每个位置试一下即可,这样的复杂度不过也 ...
- HDU1518 Square(DFS)
Square Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Su ...
- Codeforces 112B-Petya and Square(实现)
B. Petya and Square time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- 模拟摇奖:从1-36中随机抽出8个不重复的数字(math)
public class Yaojiang { public static void main(String[] args) { // TODO 自动生成的方法存根 int[] a=new int[8 ...
随机推荐
- DIDAO.Common --- 项目中的常用类及其中函数
常用函数: CommonHelper.cs using System; using System.Collections.Generic; using System.IO; using System. ...
- Nunit 2.6 无法调试.Net Framework 4.0
<configuration> <!-- The GUI only runs under .NET 2.0 or higher. The useLegacyV2RuntimeActi ...
- java代码异常普通的====
总结:对于各种流类, package com.da; //包括运行异常,和非运行异常 import java.io.*; public class ryl { public static void m ...
- java.nio.ByteBuffer中flip、rewind、clear方法的区别
对缓冲区的读写操作首先要知道缓冲区的下限.上限和当前位置.下面这些变量的值对Buffer类中的某些操作有着至关重要的作用: limit:所有对Buffer读写操作都会以limit变量的值作为上限. p ...
- 映射块设备提示rbd: sysfs write failed的解决方法
标签(空格分隔): ceph ceph运维 rbd 问题描述: 创建完镜像foo后,映射镜像时提示下面的错误: [root@node3 ~]# rbd map testpool/foo rbd: sy ...
- 如何平衡MMO游戏
转自:http://blog.sina.com.cn/s/blog_9f56a65f01013eti.html 前言 这是一篇出自国外博客“Elder Game”的一篇文章,笔者觉得里面很多东西说的很 ...
- OpenCV 视频监控(Video Surveilance)的算法体系
如前面说到的,OpenCV VS提供了6组算法的接口,分别是:前景检测.新目标检测.目标跟踪.轨迹生成.跟踪后处理.轨迹分析,除了轨迹生成用于轨迹数据的保存以外,其他5个部分都是标准的视频监控算法体系 ...
- springmvc----demo---login---bai
web.xml配置: <?xml version="1.0" encoding="UTF-8"?> <web-app version=&quo ...
- DVWA平台v1.9-Brute Force
Low: 随便输一下用户名,密码,test 点击Login 显示用户名或密码错误 在owasp-zap查看数据包 点击,就会转到这 右键,点击Fuzz 点击Remove删除默认的 选定参数变量值,点击 ...
- vue-cli脚手架build目录中的dev-server.js配置文件
本文系统讲解vue-cli脚手架build目录中的dev-server.js配置文件 这个配置文件是命令npm run dev 和 npm run start 的入口配置文件,主要用于开发环境 由于这 ...