Codeforces 1315A Dead Pixel (水题)
Screen resolution of Polycarp's monitor is a×ba×b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x,y)(x,y) (0≤x<a,0≤y<b0≤x<a,0≤y<b ). You can consider columns of pixels to be numbered from 00 to a−1a−1 , and rows — from 00 to b−1b−1 .
Polycarp wants to open a rectangular window of maximal size, which doesn't contain the dead pixel. The boundaries of the window should be parallel to the sides of the screen.
Print the maximal area (in pixels) of a window that doesn't contain the dead pixel inside itself.
Input
In the first line you are given an integer tt (1≤t≤1041≤t≤104 ) — the number of test cases in the test. In the next lines you are given descriptions of tt test cases.
Each test case contains a single line which consists of 44 integers a,b,xa,b,x and yy (1≤a,b≤1041≤a,b≤104 ; 0≤x<a0≤x<a ; 0≤y<b0≤y<b ) — the resolution of the screen and the coordinates of a dead pixel. It is guaranteed that a+b>2a+b>2 (e.g. a=b=1a=b=1 is impossible).
Output
Print tt integers — the answers for each test case. Each answer should contain an integer equal to the maximal possible area (in pixels) of a rectangular window, that doesn't contain the dead pixel.
Example
6
8 8 0 0
1 10 0 3
17 31 10 4
2 1 0 0
5 10 3 9
10 10 4 8
56
6
442
1
45
80
找出这个点左右上下四部分最大的一部分即可。
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
int a,b,x,y;
while(t--)
{
cin>>a>>b>>x>>y;
int s1=a*y;
int s2=b*x;
int s3=a*(b-y-);
int s4=b*(a-x-);
s2=max(s1,s2);
s4=max(s3,s4);
cout<<max(s2,s4)<<endl;
}
return ;
}
Codeforces 1315A Dead Pixel (水题)的更多相关文章
- Codeforces Gym 100531G Grave 水题
Problem G. Grave 题目连接: http://codeforces.com/gym/100531/attachments Description Gerard develops a Ha ...
- codeforces 706A A. Beru-taxi(水题)
题目链接: A. Beru-taxi 题意: 问那个taxi到他的时间最短,水题; AC代码: #include <iostream> #include <cstdio> #i ...
- codeforces 569B B. Inventory(水题)
题目链接: B. Inventory time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- Codeforces 489A SwapSort (水题)
A. SwapSort time limit per test 1 second memory limit per test 256 megabytes input standard input ou ...
- codeforces 688A A. Opponents(水题)
题目链接: A. Opponents time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- CodeForces 534B Covered Path (水题)
题意:给定两个速度,一个一初速度,一个末速度,然后给定 t 秒时间,还每秒速度最多变化多少,让你求最长距离. 析:其实这个题很水的,看一遍就知道怎么做了,很明显就是先从末速度开始算起,然后倒着推. 代 ...
- Codeforces Gym 100286I iSharp 水题
Problem I. iSharpTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/ ...
- CodeForces 705A(训练水题)
题目链接:http://codeforces.com/problemset/problem/705/A 从第三个输出中可看出规律, I hate that I love that I hate it ...
- CodeForces Gym 100685C Cinderella (水题)
题意:给定 n 个杯子,里面有不同体积的水,然后问你要把所有的杯子的水的体积都一样,至少要倒少多少个杯子. 析:既然最后都一样,那么先求平均数然后再数一下,哪个杯子的开始的体积就大于平均数,这是一定要 ...
随机推荐
- 静态区间第k小 - 整体二分
蒟蒻终于学会整体二分啦! 思路 实现 丑陋无比的代码 #include <bits/stdc++.h> using namespace std; const int N = 200005; ...
- 使用饿了么el-date-picker里及如何将后台给的时间戳js转化为时间格式
首先代码是这个样子的,使用v-model <el-date-picker v-model="formData.createTime" :disabled="true ...
- python+selenium自动化禅道登录测试
本文以禅道登录测试为例,思路主要分openBrowser.openUrl.findElement.sendVals.checkResult.ReadUserdate六部分 openBrowser de ...
- Qt中实现点击一个label,跳转到打开一个浏览器链接
配置模块 首先需要在.pro配置文件中添加QT += network 重写自定义Label .h文件 class MyClickLabel : public QLabel { Q_OBJECT pub ...
- 论Mac与windows的STS下的路径问题
mac下的 <!-- javaBean生成在哪里 --> <javaModelGenerator targetPackage="com.atcrowdfunding.bea ...
- Codeforces Round #601 (Div. 2) A Changing Volume
好吧,其实我拿到这个题的时候,首先想到了bfs,写完之后,开开森森的去交代码,却在第二个数据就TEL,然后优化半天,还是不行. 最终,我盯着1,2,5发呆半天,wc,然后直接贪心 #include&l ...
- 【网站】网站不能在QQ,微信中访问,申诉办法
使用这个网站申诉即可 https://appeal.anquan.org/
- Illegal target for the requested operation
org.tigris.subversion.javahl.ClientException: Illegal target for the requested operation svn: Commit ...
- C#画图超出屏幕的部分无法显示的解决方法
C#画图超出屏幕的部分无法显示,通过AutoScrollMinSize属性及相关方法解决问题. 可以实现 到 的转变. 代码如下: using System.Drawing; using System ...
- bbs论坛登录相关功能(2)
昨天把注册功能页面做出来,接下来就是登录页面 登录功能: 1,用户账号,密码后台效验,错误信息在登录按钮右边显示 2.验证码,根据图片生成,点击图片刷新产生新的验证码 修改密码 注册 先把前端页面lo ...