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 个杯子,里面有不同体积的水,然后问你要把所有的杯子的水的体积都一样,至少要倒少多少个杯子. 析:既然最后都一样,那么先求平均数然后再数一下,哪个杯子的开始的体积就大于平均数,这是一定要 ...
随机推荐
- 《深入理解java虚拟机》读书笔记二——第三章
第三章 垃圾收集器与内存分配策略 1.判断对象是否已死 引用计数法: 给对象添加一个引用计数器,每当有一个地方引用它时,计数器值就加1,每当引用失效时,计数器值就减1. 任何时刻计数器为0的对象就是不 ...
- 【PAT甲级】1118 Birds in Forest (25分)(并查集)
题意: 输入一个正整数N(<=10000),接着输入N行数字每行包括一个正整数K和K个正整数,表示这K只鸟是同一棵树上的.输出最多可能有几棵树以及一共有多少只鸟.接着输入一个正整数Q,接着输入Q ...
- LED Keychain-A Tool To Drive Specific Market Segments
LED keychain are an excellent tool to drive specific market segments. They can focus on a small grou ...
- 利用 Hexo + Github 搭建自己的博客
扯在前面 在很久很久以前,一直就想搭建属于自己的一个博客,但由于各种原因,最终都不了了之,恰好最近突然有了兴趣,于是就自己参照网上的教程,搭建了属于自己的博客. 至于为什么要搭建自己的博客了?哈哈,大 ...
- 更新了svn 后,某个文件多了几个副本如:xxx.r1 xxx.r3 xxx.mine等,正常文件名xxx
分析:更新了svn后 原因: 是的,修改完后,还要把问号文件全部删除,再重新提交(话说,你的SVN名字和我的名字一样,wk).你每次修改之前都更新一下最好了.
- HTML /和./的区别 - Web开发
"/"访问根目录 例1 https://www.cnblogs.com/test 里有 <a href="/Edsuns"></a> 则 ...
- rest_framework:解析器
一.解析器的作用 根据请求头content-type选择对应的解析器对请求体内容进行处理. 有application/json,x-www-form-urlencoded,form-data等格式 二 ...
- PHP 把秒数转为时分秒格式
PHP函数 1.gmdate $seconds = 174940;$hours = intval($seconds/); $time1 = $hours."小时".gmdate(' ...
- C++ 实例练习-替换原生数组
C++ 实例练习-替换原生数组 main.cpp #include <stdio.h> #include "intarray.h" int main(int argc, ...
- linux 命令 mkdir
mkdir -p 如果要创建目录A并创建目录A的子目录B,没有用-p的情况下mkdir 逐个的创建目录(mkdir A,mkdir A/B); 如果用-p 可以直接创建2个目录 mkdir -p A/ ...