数列的方阵找位置的问题,利用C语言程序过程的编写的思路怎么才能实现的?

Problem Description
A group of K friends is going to see a movie. However, they are too late to get good tickets, so they are looking for a good way to sit all nearby. Since they are all science students, they decided to come up with an optimization problem instead of going on with informal arguments to decide which tickets to buy.

The movie theater has R rows of C seats each, and they can see a map with the currently available seats marked. They decided that seating close to each other is all that matters, even if that means seating in the front row where the screen is so big it’s impossible to see it all at once. In order to have a formal criteria, they thought they would buy seats in order to minimize the extension of their group.

The extension is defined as the area of the smallest rectangle with sides parallel to the seats that contains all bought seats. The area of a rectangle is the number of seats contained in it.

They’ve taken out a laptop and pointed at you to help them find those desired seats.

Input
Each test case will consist on several lines. The first line will contain three positive integers R, C and K as explained above (1 <= R,C <= 300, 1 <= K <= R × C). The next R lines will contain exactly C characters each. The j-th character of the i-th line will be ‘X’ if the j-th seat on the i-th row is taken or ‘.’ if it is available. There will always be at least K available seats in total.
Input is terminated with R = C = K = 0.

Output
For each test case, output a single line containing the minimum extension the group can have.

Sample Input
3 5 5
...XX
.X.XX
XX...
5 6 6
..X.X.
.XXX..
.XX.X.
.XXX.X
.XX.XX
0 0 0

Sample Output
6
9

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!

相似问题

1
一个数列数组的求和再求比率的问题,如何利用C语言的方法编程算法解决
0
数列级数的极值的计算的一个问题,请问是如何利用C语言的编程代码实现的呢
0
数列对的问题,如何运用C语言的方式作答,利用C语言如何解决这个问题
0
数列整数相邻判断的问题,如何利用C语言的功能去实现的
0
如何利用C语言编程实现对数列的搜索问题,采用C语言代码的编写的方式是怎么做?
0
数列的倍增的一个算法题目的求解的过程,如何利用C语言的计算的编程?
0
数列累积核的问题,数据结构的算法怎么利用C语言的形式实现
0
整数在数列中的位置的查找问题,利用C语言编程技术的解答的思路
0
二进制线段数列的枚举的典型问题,使用C语言编写程序设计解决这个算法是怎么做的
0
数列的翻转表的一个算法的问题的求解,用C语言的程序编写怎么实现的啊
0
数列数组的增加删除修改寻找的一个问题,采用C语言的程序设计的方式怎么实现代码的编写
0
数列的单向遍历的方式如何解决这个问题啊,C语言程序代码具体怎么实现
0
一个数列级数的判断计算的问题的解答的方式,如何利用C语言的程序设计的方式来实现
0
判断数列是否达到最大和的算法,怎么利用C程序的语言设计技术来编写
0
序数和的编号的问题,数列配对运用 C语言的程序的设计的形式怎么做
0
提取数列中的因子的一个算法问题,怎么利用C语言的程序的计算的方式实现?
0
反推递增数列的一个算法的思路问题,怎么采用C语言的程序的设计的思想实现?
0
数列删除+求合的算法怎么利用C语言的程序的设计的思想是现代码的编写的呢?
0
计算第n项Fibonacci数值运用的问题,怎么采用C语言的程序的编写的思路的方式实现了的呢?
0
数列的整理的一个算法的运算,怎么采用C程序的语言的代码的编写的技术来实现?