A - Time

Description

standard input/output
Statements

A plane can go from city X to city Y in 1 hour and 20 minutes. However, when it returns from city Y to city X, with the same speed, it spends only 80 minutes! If you don’t know how might that happen, just remember that 1 hour and 20 minutes is the same as 80 minutes ;-) In this problem you will have 2 durations of time and you have to decide if they are equal or not.

Input

The first line will be the number of test cases T. Each test case has two lines, the first line represents the first duration and contains 3 integers: h, m, s; these are the Hours, Minutes and Seconds. The second line represent the second duration with 3 integers also, in the same way. All integers are positive and below 5000.

Output

For each test case, print one line which contains the number of the test case. Then print “Yes” if the 2 durations are equal and print “No” otherwise, see the samples and follow the output format.

Sample Input

 
 
 

Input
3
1 20 0
0 80 0
0 2 10
0 0 130
2 10 5
2 11 0
Output
Case 1: Yes
Case 2: Yes
Case 3: No
/*
给出时分秒,看两个时间是否相同
*/
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<vector>
#define N 200010
using namespace std;
int main()
{
//freopen("in.txt","r",stdin);
int t,n;
scanf("%d",&t);
for(int l=;l<=t;l++)
{
long long s1=,s2=;
for(int i=;i<;i++)
{
scanf("%d",&n);
s1+=n;
s1*=;
}
for(int i=;i<;i++)
{
scanf("%d",&n);
s2+=n;
s2*=;
}
if(s1==s2)
printf("Case %d: Yes\n",l);
else
printf("Case %d: No\n",l);
}
return ;
}

暑假练习赛 007 A - Time的更多相关文章

  1. 暑假练习赛 007 E - Pairs

    E - Pairs Description standard input/outputStatements In the secret book of ACM, it’s said: “Glory f ...

  2. 暑假练习赛 007 C - OCR

    C - OCR Description standard input/outputStatements Optical Character Recognition (OCR) is one of th ...

  3. 暑假练习赛 007 B - Weird Cryptography

    Weird Cryptography Description standard input/outputStatements Khaled was sitting in the garden unde ...

  4. 暑假练习赛 003 F Mishka and trip

    F - Mishka and trip Sample Output   Hint In the first sample test: In Peter's first test, there's on ...

  5. 暑假练习赛 003 B Chris and Road

    B - Chris and Road Crawling in process... Crawling failed Time Limit:2000MS     Memory Limit:262144K ...

  6. 暑假练习赛 003 A Spider Man

    A - Spider Man Crawling in process... Crawling failed Time Limit:2000MS     Memory Limit:262144KB    ...

  7. 暑假练习赛 006 B Bear and Prime 100

    Bear and Prime 100Crawling in process... Crawling failed Time Limit:1000MS     Memory Limit:262144KB ...

  8. 暑假练习赛 006 E Vanya and Label(数学)

    Vanya and LabelCrawling in process... Crawling failed Time Limit:1000MS     Memory Limit:262144KB    ...

  9. 暑假练习赛 006 A Vanya and Food Processor(模拟)

    Description Vanya smashes potato in a vertical food processor. At each moment of time the height of ...

随机推荐

  1. Data_Struct(LinkList)

    最近在学数据结构,学到链表这节作业有链表,毕竟菜鸟代码基本照看书上算法写的,再加上自己的小修改,这里先记录下来,万一哪天想看了,来看看. 里面有用到二级指针,还是不太理解,还有就是注释不多,后续有了更 ...

  2. ArrayList,LinkedListd等容器使用时注意点:

    1.对这两个List(包括其他的类似容器),如果向里面加入一个元素(引用数据类型),那么这个List里面保存的是这个对象的引用: 如果想要避免这种现象可以这样:在加入新的元素时不直接压,将已有的对象复 ...

  3. Redis的安装以及在项目中使用Redis的一些总结和体会

    第一部分:为什么我的项目中要使用Redis 我知道有些地方没说到位,希望大神们提出来,我会吸取教训,大家共同进步! 注册时邮件激活的部分使用Redis 发送邮件时使用Redis的消息队列,减轻网站压力 ...

  4. AngularJS中的DOM与事件

      前 言 AngularJS中的DOM与事件   AngularJS 为 HTML DOM 元素的属性提供了绑定应用数据的指令.  ng-disabled="true/false" ...

  5. PHP数据库45道题整理~~~啦啦啦

    select * FROM student-- 二:查询student表中所有记录select * FROM score WHERE Degree>60 AND Degree<80-- 四 ...

  6. XtraGrid滚轮翻页

    滚轮翻页与传动的翻页更为方便,经过本人一番探讨与琢磨终于在XtraGrid的GridView中实现了鼠标滚轮翻页. 我新建了一个组件继承原本的GridControl,在组件中添加了一个ImageLis ...

  7. 两句话动态修改table数据并提交到后台

    //为所有的input 添加click事件,我将对象的id放入到name属性中,行数放入到alt属性中 $("input").click(function(obj){ //获得当前 ...

  8. HTTP协议报文、工作原理

    一.web及网络基础       1.HTTP的历史            1.1.HTTP的概念:                 HTTP(Hyper Text Transfer Protocol ...

  9. Charles Proxy v4.1.4 免费注册激活方法

    去官网下载最新版Charles,目前是v4.1.4 下载后安装Charles,然后先打开一次Charles软件(Mac系统需要先打开一次,Windows不需要) 到网站 http://charles. ...

  10. hud 2577 How to Type

    How to Type Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...