Screen resolution of Polycarp's monitor is a \times ba×b pixels. Unfortunately, there is one dead pixel at his screen. It has coordinates (x, y)(x,y) (0 \le x < a, 0 \le 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 \le t \le 10^41≤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 \le a, b \le 10^41≤a,b≤104; 0 \le x < a0≤x<a; 0 \le 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.

Sample 1

Inputcopy Outputcopy
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

Note

In the first test case, the screen resolution is 8 \times 88×8, and the upper left pixel is a dead pixel. Here you can see one of two possible layouts of the maximal window.

题意:

在一个axb的屏幕上有一个坏点(x,y),问不包含坏点的最大矩形面积。

思路:

比较可能四个矩形的大小。

代码:

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<map>
#include<vector>
using namespace std;
typedef long long ll;
void slove(){int t;cin>>t;while(t--){int a,b,x,y;cin>>a>>b>>x>>y;int ans=a*y;ans=max(ans,b*x);ans=max(ans,a*(b-y-1));ans=max(ans,b*(a-x-1));cout<<ans<<endl;}
}
int main(){slove();
}

Dead Pixel相关推荐

  1. isp 图像算法(二)之dead pixel correction坏点矫正

    代码在git 相机中的坏点就是那些和周围不一样的点,就是那些数值极大或者极小值点,你可以理解一张曲面的山峰或者山谷,人群中也是一样,那些与大众不一样的人就是"坏人",衡量好坏用他与 ...

  2. Dead Pixel CodeForces - 1315A(思维)

    Screen resolution of Polycarp's monitor is a×b pixels. Unfortunately, there is one dead pixel at his ...

  3. Codeforces Round #623 (Div. 2, based on VK Cup 2019-2020 - Elimination Round, Engine) A Dead Pixel

    讨论坏点的左右上下的矩形大小. #include <bits/stdc++.h> using namespace std; int main() {int t;cin >> t ...

  4. ISP——坏点矫正(Defective Pixel Correction,DPC)

    文章目录 一.出现原因 二.坏点分类 三.矫正方法 动态矫正 1.PINTO算法 2.中值梯度滤波法 3.DPC和demosaic结合法 4.行检测法 四.代码 一.出现原因 1.感光元件芯片自身工艺 ...

  5. ISP——DPC(Defective Pixel Correction)

    现象 造成坏点的原因 感光元件芯片自身工艺技术瑕疵造成: 光线采集存在缺陷: 制造商产品差异: 坏点分类 hot pixel: 固定保持较高的像素值,一般呈现为画面高亮的点: dead pixel: ...

  6. [译] Facebook杯2013年编程挑战赛——第一轮题目及答案

    原文 https://www.facebook.com/notes/facebook-hacker-cup/2013-round-1-solutions/606859202663318 第一题 纸牌游 ...

  7. Chillingo分享三款游戏图标的设计经验

    每个月在iTunes上发布的游戏多达6000款以上,因此,游戏图标在如此狭窄的空间里激烈地竞争着用户的注意力.时间和屏幕空间.对于全方位普及免费模式的手游产业而言,要想在万千游戏图标中脱颖而出,无疑更 ...

  8. ISP(图像信号处理)之——坏点校正

    什么是坏点 坏点的定义:在数码相机上,坏点指无法正确捕捉光线的感光组件单元,若感光元件出现坏点,会直接造成成像的暇疵.LCD的坏点包括亮点.暗点与色点三类,感光元件与LCD相似,也存在这三类坏点. 引 ...

  9. 液晶屏常见问题_如何解决液晶显示器最常见的问题

    液晶屏常见问题 Computer monitors are fairly simple, in use if not in actual construction: plug 'em in, turn ...

  10. 数字图像处理与Python实现-图像信号处理-图像坏点修复

    图像坏点修复 文章目录 图像坏点修复 1.图像坏点介绍 2.图像坏点修复方法 3.图像坏点修复算法实现 3.1 均值滤波修复 3.2 基于梯度滤波修复 1.图像坏点介绍 **Misbehaving p ...

最新文章

  1. 多线程中使用mktime和setenv函数
  2. 【图文】Excel中vlookup函数的使用方法
  3. mysql用户权限管理和增删改查操作
  4. word怎么设置图片编号(图片下标,图片标签,图片序号,图片注释,题注)(交叉引用)
  5. Python+Opencv实现自动化阅卷
  6. java \t怎么从头开始_如何从头开始以正确的面向对象方式创建Java Web Framework
  7. Linux中配置ftp服务器
  8. 【Day10】项目中如何处理安全问题
  9. C++socket编程(三):3.4 listen监听
  10. QQ空间面试题放送,速度教科书式扑街补救offer!
  11. SystemVerilog 2005 语法
  12. 水槽中倒水,Pour Water
  13. 从网易云、QQ音乐下载音乐
  14. 一个简单证件照的设计过程
  15. 【Linux os7】--详细搭建LAMP+安装Zabbix4监控服务
  16. 阿里云服务器密码重置
  17. Spark的Cache和Checkpoint区别和联系拾遗
  18. android壁纸设置,android设置壁纸 的方法
  19. nyist 第二次招新赛 I 董学姐与朱学姐的爱恨情仇
  20. OFDM和OFDMA区别笔记

热门文章

  1. wsdl2java validate_使用cxf wsdl2java进行客户端证书身份验证
  2. ActivityMQ
  3. 法拉克机器人自动怎么调_发那科机器人的简单设置你知道吗
  4. VMP学习笔记之壳基础(一)
  5. 得力考勤机excel密码_可以修改原始考勤记录数据的是哪种人脸指纹考勤机?
  6. ISO50001认证咨询,ISO50001能源管理体系建立的基本步骤及企业的管理权限范围
  7. 反编译exe文件并替换图片资源
  8. 二进制编辑和进程监控工具
  9. 威纶触摸屏与电脑连接_如何将威纶通tk6070ip触摸屏程序上传到电脑里。请大侠讲解具体步骤...
  10. SQL常用字符串截取