//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的更多相关文章

  1. Codeforces 450C:Jzzhu and Chocolate(贪心)

    C. Jzzhu and Chocolate time limit per test: 1 seconds memory limit per test: 256 megabytes input: st ...

  2. 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 ...

  3. 【Codeforces 449A】Jzzhu and Chocolate

    [链接] 我是链接,点我呀:) [题意] 题意 [题解] 设最后行分成了x行,列分成了y列. 那么答案就是floor(n/x)floor(n/y) 然后x+y-2=k //即平均分配x行.y列 我们可 ...

  4. Codeforces Round #257 (Div. 1)449A - Jzzhu and Chocolate(贪婪、数学)

    主题链接:http://codeforces.com/problemset/problem/449/A ------------------------------------------------ ...

  5. 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 ...

  6. CodeForces 450

    A - Jzzhu and Children Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & % ...

  7. cf 450c Jzzhu and Chocolate

    Jzzhu and Chocolate time limit per test 1 second memory limit per test 256 megabytes input standard ...

  8. codeforces 450C. Jzzhu and Chocolate 解题报告(449A)

    题目链接:http://codeforces.com/contest/450/problem/C 题目意思:给出一个 n * m 大小的chocolate bar,你需要在这个bar上切 k 刀,使得 ...

  9. codeforces C. Jzzhu and Chocolate

    http://codeforces.com/contest/450/problem/C 题意:一个n×m的矩形,然后可以通过横着切竖着切,求切完k次之后最小矩形面积的最大值. 思路:设k1为横着切的次 ...

随机推荐

  1. xml和json选择奖

    xml&json战争,一般能够分离两个对立阵营.党的手感json足够强大以便能够替代xml.有一方感觉json滑稽丑陋,绝对没有和xml赛可能. 为了避免"拉仇恨"(我不是 ...

  2. Android 游戏开发 View框架

    按键盘的上下键矩形就会上下移动: 通过实例化Handler对象并重写handkeMessage方法实现了一个消息接收器.然后再线程中通过sendMessage方法发送更新界面的消息,接收器收到更新界面 ...

  3. C++ Primer 学习笔记_53_类和数据抽象 --友元、static员

    分类 --友元.static成员 一.友元 友元机制同意一个类将对其.友元关系:一个样例 如果一个窗体管理类Window_Mgr可能须要訪问由其管理的Screen对象的内部数据.Screen应该同意其 ...

  4. C++面试宝典2011版

    1.new.delete.malloc.free关系 delete会调用对象的析构函数,和new相应free仅仅会释放内存,new调用构造函数.malloc与free是C++/C语言的标准库函数,ne ...

  5. effective c++ prefer const,enum, inline to #defines

    学习心得 对于纯常量,最好以const对象或者enums替换#define #define FIRST 3 //not good enum { first=1, second=2 } ; int nu ...

  6. android生成apk包出现Unable to add &quot;XXX&quot; Zip add failed问题

    最近试图整合umeng至cocos2d-x围棋项目,一切好工作,准备生成apk当出现了大量的数据包 [2014-06-03 20:02:52 - MyApp] Unable to add 'G:\co ...

  7. [LeetCode129]Sum Root to Leaf Numbers

    题目: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a nu ...

  8. 皮尔逊相似度计算的例子(R语言)

    编译最近的协同过滤算法皮尔逊相似度计算.下顺便研究R简单使用的语言.概率统计知识. 一.概率论和统计学概念复习 1)期望值(Expected Value) 由于这里每一个数都是等概率的.所以就当做是数 ...

  9. Directx11 xnamath.h 报错

    xnamath.h 报错: 在标识符“XMConvertToRadians”的前面 如下报错 >d:\program files\microsoft directx sdk (june )\in ...

  10. NET5实践:项目创建-结构概述-程序运行-发布部署

    ASP.NET5实践01:项目创建-结构概述-程序运行-发布部署   1.项目创建 ASP.NET5项目模板有三种: 新建项目: 选择模板: 2.结构概述 References对应配置是project ...