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 ...
随机推荐
- MyEclipse中配置SWT/JFace/SWT-Designer 艰辛路程
我最近受一个老师所托,写一个小系统,为了更加熟练使用Java,我决定用Java写一个PC软件. 我是一个比较追求完美的孩子,所以虽然老师对界面没啥要求,但是为了加快速度和界面美观,果断选择SWT/JF ...
- 选用 get 与 post 的一些建议
1.http的请求方法:get post 2. get:会把请求的内容 放到链接地址里面(数据请求的时候 默认的是get请求) 例:www.baidu.com/user/login?userna ...
- IPointCollection转IPolyline
IPointCollection转线IPolyline: IPolyline pl = new PolylineClass(); IPointCollection ptc = pl as IPoint ...
- 选择问题(选出第i个最小元素)
通过分治法解决的分析(还有其他方法解决选择问题如使用 堆) 1 同快速排序一样,对输入的数组进行递归分解 不同的是:快速排序会递归处理分解的两边,而选择问题只处理需要的一边 2 选择问题的期望时间代价 ...
- ubuntu 阿里云安全配置
1. 添加新用户, 加入 root 组, 赋予 sudo 权限 2. 禁用 root 3.
- 将C# dataTable 做为参数传入到存储过程
1.list转换为DataTable(如果有需要) public static DataTable ListToDataTable<T>(List<T> entitys) { ...
- 发送邮件(遵循smtp协议即简单的邮件发送协议)
HandleSendEmail.aspx逻辑 protected void Page_Load(object sender,EventArgs e) { foreach(var item in Req ...
- .net 页面跳转方式【转】
1 Response.Redirect这个跳转页面的方法跳转的速度不快,因为它要走2个来回(2次postback),但他可以跳 转到任何页面,没有站点页面限制(即可以由雅虎跳到新浪),同时不能跳过登录 ...
- AngularJS(10)-数据验证
AngularJS 表单和控件可以提供验证功能,并对用户输入的非法数据进行警告.客户端的验证不能确保用户输入数据的安全,所以服务端的数据验证也是必须的. <!DOCTYPE html> & ...
- 基于Golang的游戏服务器框架cellnet开发日记(二)
看官们肯定还有大部分不是很熟悉Actor模型. 我这里基于Erlang, Skynet等语言和框架库来实战型解释下Actor模型. Actor概念 Actor模型和OO类似, 都是符合人的思维模式进 ...