1798: Twinkle Twinkle Little Star

内存限制:128 MB 时间限制:3.000 S
评测方式:文本比较 命题人:
提交:0 解决:0

题目描述

Twinkle, twinkle, little star, how I wonder what you are. Up above the world so high, like a diamond in the sky. Twinkle, twinkle, little star, how I wonder what you are. When the blazing sun is gone, when he nothing shines upon. The you show your little light, Twinkle, twinkle, little star Twinkle, twinkle, little star, How I wonder what you are. Twinkle, twinkle, little star, how I wonder what you are. ---- < Twinkle, twinkle, little star. >
Well, this song may take us back to our childhood. When we were young, we often looked up at the stars. How amazing they were! But, unfortunately, as we are becoming older and older, what used to be interesting can not interest us now. So what we can do is to find something more interesting! Here is one, maybe. Assume that all the stars are so far from us that we can treat them as points in a plane. You are given N stars in the plane, and a number K (0≤K≤N). What you need to do is to find the minimum square covering at least K stars, whose edges are all parallel to the axis. The stars which are on the edges of the square are also covered.

输入

The input will consist of multiple cases. Your program should process to the end of the input file.In the first line of one case, there are two integer N and K, 0i and Yi, |Xi|<1000000, |Yi|<1000000.

输出

The output will consist of one line for each case, in the format of “Case X: Y”, while X is the case number counting from 1, and Y is the edge length of the minimum square. X and Y are all integers.

样例输入 复制

4 4
0 0
0 1
1 0
2 2
4 2
0 0
1 1
2 2
3 3

样例输出 复制

Case 1: 2
Case 2: 1

提示

Huge input, scanf is recommended.