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 个杯子,里面有不同体积的水,然后问你要把所有的杯子的水的体积都一样,至少要倒少多少个杯子. 析:既然最后都一样,那么先求平均数然后再数一下,哪个杯子的开始的体积就大于平均数,这是一定要 ...
随机推荐
- windows 环境变量%SystemDrive%和%SystemRoot%、%AppData%、%LocalAppData%、%TEMP% 等简写
windows 环境变量%SystemDrive% 和%SystemRoot%.%AppData%.%LocalAppData%.%TEMP% 等简写 假设操作系统安装在 C: 盘 %SYSTEMRO ...
- 杭电oj_2047——阿牛的EOF牛肉串(java实现)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2047 思路:先是列出了四个,但是没发现规律,然后开始画递归树,在其中找到了规律,算出递归式为f(n) ...
- VScode usage
Common settings editor.minimap.enabled //close the preview workbench.editor.show tabs // show f ...
- 我的第一个Maven Helloworld
使用MAVEN创建项目可以有两种方式进行创建,第一种,使用mvn命令创建Maven项目,第二种,使用eclipse创建Maven项目. 在创建Maven项目之前,我们需要安装maven,并和配置JDK ...
- Spring Boot整合Freemarker
一.首先导入依赖 <!-- 添加freemarker模版的依赖 --> <dependency> <groupId>org.springframework. ...
- 利用Master库spt_values表 连续数字
SELECT CONVERT ( ), dateadd(d, number, GETDATE()), ) AS every_time FROM master..spt_values n WHERE n ...
- python3练习100题——033
链接:http://www.runoob.com/python/python-exercise-example33.html 题目:按逗号分隔列表. l=[1,2,3,4] k=1 for i in ...
- 15分钟带你了解前端工程师必知的javascript设计模式(附详细思维导图和源码)
15分钟带你了解前端工程师必知的javascript设计模式(附详细思维导图和源码) 前言 设计模式是一个程序员进阶高级的必备技巧,也是评判一个工程师工作经验和能力的试金石.设计模式是程序员多年工作经 ...
- xshell如何将Windows文件上传到linux
1. 首先先将你xshell配置好用户名及密码等,必须使用有权限下载的账号进行操作. 使用 yum provides */rz 这条命令,查看你系统自带的软件包的信息. 2.在输出的信息中可 ...
- [CCPC2019秦皇岛] F. Forest Program
[CCPC2019秦皇岛 F] Link https://codeforces.com/gym/102361/problem/F Description 给定一个仙人掌,删去一些边可以让它变成一个森林 ...