CodeForces 32C
额 找找规律吧 要用long long 才过。
#include <cstdio>
#include <algorithm> using namespace std;
int main()
{
long long m,n,s;
scanf("%I64d%I64d%I64d",&m,&n,&s);
if(m < n)
swap(m, n);
if(s >= m && s >= n)
printf("%I64d\n",m*n);
else if(s < m && s >= n)
printf("%I64d\n",((m-1)%s+1)*((m-1)/s+1)*n);
else
printf("%I64d\n",((m-1)%s+1)*((m-1)/s+1)*((n-1)%s+1)*((n-1)/s+1));
return 0;
}
CodeForces 32C的更多相关文章
- CodeForces 32C Flea
题目链接:http://codeforces.com/problemset/problem/32/C 本文链接:http://www.cnblogs.com/Ash-ly/p/5513436.html ...
- CodeForces 32C. Flea 水题
C. Flea time limit per test 2 seconds memory limit per test 256 megabytes input standard input outpu ...
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
- 【Codeforces 738C】Road to Cinema
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...
- 【Codeforces 738A】Interview with Oleg
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...
- CodeForces - 662A Gambling Nim
http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...
- CodeForces - 274B Zero Tree
http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...
- CodeForces - 261B Maxim and Restaurant
http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...
随机推荐
- git常用命令行
查看.添加.提交.删除.找回,重置修改文件 git help <command> # 显示command的help git show # 显示某次提交的内容 git show $id gi ...
- android组件间共享数据的常用方法
使用Intent在激活组件的时候携带数据,以进行数据的传递 使用广播进行组件间数据的伟递 使用外部存储(sharedPreference,文件,数据库,网络)进行组件间数据共享 使用Static静态成 ...
- 剑指offer_面试题11 数值的整数次方_考察代码的完整性
测试通过代码: package t0825; public class Power { public static void main(String[] args){ System.out.print ...
- Contoso 大学 - 9 - 实现仓储和工作单元模式
原文 Contoso 大学 - 9 - 实现仓储和工作单元模式 By Tom Dykstra, Tom Dykstra is a Senior Programming Writer on Micros ...
- Linux系统下给VMWare安装Tools
1.进入Linux系统. 2.在VMware的窗口菜单中选VM >> install VMware Tools,虚拟机自动将VMware-tools装入虚拟光驱中. 3.在虚拟光驱里找出V ...
- ASP.NET实现折线图的绘制
用到.Net中绘图类,实现折线图的绘制,生成图片,在页面的显示,代码如下: /// <summary> /// 获取数据 /// strChartName:图名称: /// yName:纵 ...
- JavaScript的语法规则
JavaScript的语法规则 JavaScript区分大小写 JavaScript脚本程序须嵌入在HTML文件中 JavaScript脚本程序中不能包含HTML标记代码 每行写一条脚本语句 语句末尾 ...
- Percona-Server-5.5.33-31.1安装
一.下载 http://www.percona.com/downloads/Percona-Server-5.5/ Percona-Server-5.5.33-31.1 选择 binary 选择lin ...
- C++ 读取 pcap文件.
http://blog.csdn.net/haolipengzhanshen/article/details/51854853 1.了解下pcap文件的结构 2.定义pcap文件头部结构体pcapFi ...
- Android Animation ---TranslateAnimation
if(stopBtn.getVisibility()==View.VISIBLE){ Animation animation_stop = new TranslateAnimation( Animat ...