Codeforces 450 C. Jzzhu and Chocolate
//area=(n*m)/ ((x+1)*(k-x+1))
//1: x==0;
//2: x=n-1
//3: x=m-1
# include <stdio.h>
long long max(long long x,long long y)
{
return x>y? x:y;
}
int main()
{
long long n,m,k,sum,t,ans;
scanf("%lld%lld%lld",&n,&m,&k);
sum=n+m-2;
if(k>sum)
printf("-1\n");
else if(sum==k)
printf("1\n");
else
{
ans=0;
if(n>=k+1)//x=0
{
ans=max(ans,m*(n/(k+1)));
}
else//x=n-1
{
t=k-n+2;
ans=max(ans,m/t);
}
if(m>=k+1)//x=0
{
ans=max(ans,n*(m/(k+1)));
}
else//x=m-1
{
t=k-m+2;
ans=max(ans,n/t);
}
printf("%lld\n",ans);
}
return 0;
}
版权声明:本文博主原创文章,博客,未经同意不得转载。
Codeforces 450 C. Jzzhu and Chocolate的更多相关文章
- Codeforces 450C:Jzzhu and Chocolate(贪心)
C. Jzzhu and Chocolate time limit per test: 1 seconds memory limit per test: 256 megabytes input: st ...
- codeforces 450 B Jzzhu and Sequences
题意:给出f1=x,f2=y,f(i)=f(i-1)+f(i+1),求f(n)模上10e9+7 因为 可以求出通项公式:f(i)=f(i-1)-f(i-2) 然后 f1=x; f2=y; f3=y-x ...
- 【Codeforces 449A】Jzzhu and Chocolate
[链接] 我是链接,点我呀:) [题意] 题意 [题解] 设最后行分成了x行,列分成了y列. 那么答案就是floor(n/x)floor(n/y) 然后x+y-2=k //即平均分配x行.y列 我们可 ...
- Codeforces Round #257 (Div. 1)449A - Jzzhu and Chocolate(贪婪、数学)
主题链接:http://codeforces.com/problemset/problem/449/A ------------------------------------------------ ...
- Codeforces Round #257 (Div. 2) C. Jzzhu and Chocolate
C. Jzzhu and Chocolate time limit per test 1 second memory limit per test 256 megabytes input standa ...
- CodeForces 450
A - Jzzhu and Children Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & % ...
- cf 450c Jzzhu and Chocolate
Jzzhu and Chocolate time limit per test 1 second memory limit per test 256 megabytes input standard ...
- codeforces 450C. Jzzhu and Chocolate 解题报告(449A)
题目链接:http://codeforces.com/contest/450/problem/C 题目意思:给出一个 n * m 大小的chocolate bar,你需要在这个bar上切 k 刀,使得 ...
- codeforces C. Jzzhu and Chocolate
http://codeforces.com/contest/450/problem/C 题意:一个n×m的矩形,然后可以通过横着切竖着切,求切完k次之后最小矩形面积的最大值. 思路:设k1为横着切的次 ...
随机推荐
- 【剑指offer】两个队列实现堆栈
转载请注明出处:http://blog.csdn.net/ns_code/article/details/25076689 题目:用两个队列模拟一个栈,即用两个队列的出队和入队操作.来实现栈的 ...
- Oracle SQL Lesson (11) - 创建其他数据库对象(试图/序列/索引/同义词)
schema(模式)一个用户下一组对象的集合,一般与用户名一致. 视图 CREATE [OR REPLACE] [FORCE|NOFORCE] VIEW view [(alias[, alias].. ...
- 小猪的Android入门之路 Day 4 - part 1
小猪的Android入门之路 Day 4 - part 1 Android事件处理机制之--基于监听的事件处理机制 本节引言: 在開始本个章节前,我们先回想下,如今我们已经知道了android的一些相 ...
- 兔子--Fragment与ViewPager要切换滑动效果
效果图: 文件夹结构: 代码分析: MainActivity.java package com.example.myfragment; /** * @author Arthur Lee * @time ...
- python可变交换性能优化
离许多新的压力python性能优化见交换两个变量值可以使用 a,b = b,a 这样能够提高性能 >>> from timeit import Timer >>> ...
- ios ios7 取消控制拉升
//推断是否ios7 取消控制拉升 if ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0) { self.edgesFo ...
- 国内PaaS概述和EEPlat定位
2014国内云计算产业进入快速发展阶段.热火多年来,所以云计算的云计算产业迅速进入栈桥的应用.IaaS.PaaS.SaaS各大厂商具有较强的市场布局,所以,云计算应用在这三个层次的访问,以实际使用阶段 ...
- 在 VS 类库项目中 Add Service References 和 Add Web References 的区别
原文:在 VS 类库项目中 Add Service References 和 Add Web References 的区别 出身问题: 1.在vs2005时代,Add Web Reference(添加 ...
- NEON简单介绍
个128位四字寄存器Q0-Q15,32个64位双字寄存器D0-D31,两个寄存器是重叠的,在使用的时候须要特别注意,不小心就会被覆盖掉. NEON的数据类型:无符号整数.有符号整数.未指定类型的整数. ...
- 开源Math.NET基础数学类库使用(07)一些常用的数学物理常数
原文:[原创]开源Math.NET基础数学类库使用(07)一些常用的数学物理常数 本博客所有文章分类的总目录:http://www.cnblogs.com/asxinyu/ ...