| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 321 人关注过本帖
标题:再次希望大家帮忙哈
只看楼主 加入收藏
katherine2o1
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2011-4-3
结帖率:100%
收藏
 问题点数:0 回复次数:1 
再次希望大家帮忙哈
There is a rectangular city with N rows and M columns, and every grid has some people living there. Now Alibaba wants to choose some grids to build K service stations. The best way to build service stations is to make the largest distance among all distances between a grid and its nearest service station as short as possible. The distance between two grids (x1, y1) and (x2, y2) is max(|x1-x2|, |y1-y2|), where |x| is the absolute value of x. Now it’s you work to build service stations optimally.
 

Input
The first line of input contains an integer T (T <= 1000), which is the number of data sets that follow.

Every test case consists of three integers N, M, K, which are specified before.



1 <= N, M, K <= 1000000000.

 

Output
For every test case, you should output "Case #k: " first, where k indicates the case number and starts at 1. Then output the largest distance among all distances between a grid and its nearest police station while you build police stations optimally.
 

Sample Input
3
1 1 1
2 2 1
3 3 1

 

Sample Output
Case #1: 0
Case #2: 1
Case #3: 1

搜索更多相关主题的帖子: where 
2011-04-03 15:43
qq1023569223
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
来 自:湖南科技大学
等 级:贵宾
威 望:26
帖 子:2753
专家分:13404
注 册:2010-12-22
收藏
得分:0 
chinese,please!

   唯实惟新 至诚致志
2011-04-03 20:26
快速回复:再次希望大家帮忙哈
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014718 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved