Given two rectangles, find if the given two rectangles overlap or not.

A rectangle is denoted by providing the x and y co-ordinates of two points: the left top corner and the right bottom corner of the rectangle.

Note that two rectangles sharing a side are considered overlapping.

Input:

The first integer T denotes the number of test cases. For every test case, there are 2 lines of input. The first line consists of 4 integers: denoting the co-ordinates of the 2 points of the first rectangle. The first integer denotes the x co-ordinate and the second integer denotes the y co-ordinate of the left topmost corner of the first rectangle. The next two integers are the x and y co-ordinates of right bottom corner. Similarly, the second line denotes the cordinates of the two points of the second rectangle.

Output:

For each test case, output (either 1 or 0) denoting whether the 2 rectangles are overlapping. 1 denotes the rectangles overlap whereas 0 denotes the rectangles do not overlap.

Constraints:

1 <= T <= 10

-10000 <= x,y <= 10000

T denotes the number of test cases. x denotes the x co-ordinate and y denotes the y co-ordinate.

Example:

Input:


- -  

Output:

下面是我的代码实现:

最新文章

  1. Laravel与Repository Pattern(仓库模式)
  2. 用AXIS2发布WebService的方法
  3. 一个关于C#中基类与接口混合继承的疑问总结
  4. iOS语音合成
  5. vijosP1371 方程的解
  6. SQL rank() 用法
  7. How to Validate XML using Java
  8. HDU 4288 线段树+离散化
  9. Spring Boot 集成 Hystrix
  10. iOS开发多线程之GCD
  11. 支付-stripe
  12. L3-020 至多删三个字符 (30 分)(DP)
  13. Nginx 日志文件 access_log 详解
  14. 关于redis集群的问题no reachable node in cluster
  15. excel随机函数
  16. Spark学习笔记——在集群上运行Spark
  17. 【Web】移动端下拉刷新、上拉加载更多插件
  18. PHP获取数组中奇偶数
  19. 「TJOI 2018」游园会 Party
  20. mybatis源码分析(3)-----SqlSessionHolder作用

热门文章

  1. LINQ学习系列-----1.4 匿名对象
  2. JAVAFX-3 开发应用
  3. 题目八 one + two = 3 soj
  4. python实战--数据结构二叉树
  5. Imageloader框架
  6. phpstorm快捷键记录
  7. Hexo + github 打造个人博客
  8. 最近整理AI相关感想
  9. Natural Hazards 隐私政策
  10. Hibernate学习(三)自动建表