【编码】Font Sie-微软实习笔试编程题(一)-2016.04.06

题目1 : Font Size

时间限制:10000ms
单点时限:1000ms
内存限制:256MB

描述
Steven loves reading book on his phone. The book he reads now consists of N paragraphs and the i-th paragraph contains ai characters.
Steven wants to make the characters easier to read, so he decides to increase the font size of characters. But the size of Steven's phone screen is limited. Its width is W and height is H. As a result, if the font size of characters is S then it can only show ⌊W / S⌋ characters in a line and ⌊H / S⌋ lines in a page. (⌊x⌋ is the largest integer no more than x)
So here's the question, if Steven wants to control the number of pages no more than P, what's the maximum font size he can set? Note that paragraphs must start in a new line and there is no empty line between paragraphs.
输入
Input may contain multiple test cases.
The first line is an integer TASKS, representing the number of test cases.
For each test case, the first line contains four integers N, P, W and H, as described above.
The second line contains N integers a1, a2, ... aN, indicating the number of characters in each paragraph.

For all test cases,
1 # include

include

include

using namespace std;

int main(){
int ta;cin>>ta;
for(int i=0;i>n>>p>>w>>h;
int *a=new int[n+1];//new
for(int j=0;j>a[j];
}
a[n]='\0';
int s;
int wh= w>h ? h:w;
//coutp)
s--;
else
break;
}
delete []b;
delete []a;
cout

c++

版权声明

本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处。如若内容有涉嫌抄袭侵权/违法违规/事实不符,请点击 举报 进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部