腾讯俱乐部ACM训练赛入门组试题

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

腾讯俱乐部ACM训练赛入门组试题

1000.Love Message

Description:

Jiangshan and Zhao Yiran is a sweetheart lover in different class.So, Jiangshan developed a application to send message to Zhao Yiran through wireless.However,so unfortunately,their teachers are so great that all they send will be received by their teachers too.In order to keep their message secrecy, they have to encrypt the message.

When a char X appear n times,Jiangshan will show it as Xn,for example bb->b2. In order to get the love message,Zhao Yiran have to deciphering the message with mind acts upon mind.Could you help they to deciphering.

Input:

A string S,indicates the message Zhao Yiran get,all the char is lower case. There may be several test cases in the input file and end when S equal to XXX. Output

A string T,indicates the message after deciphering.

Sample Input

a3

go12gle

XXX

Sample Output

aaa

goooooooooooogle

1001.99division

Description Time Limit:1sec Memory Limit:256MB

Given a big integer n,please determine whether it can divided by99or not.

Input

Input consists of multiple test cases.The first line of input contains a positive integer T,the number of test cases.

Each test case consists of a single line which only contains a big integer n(0<=n<10^10000).

Output

For each test case,output on a single line.If n can be divided by99,output"Yes". If n can not be divided by99,output"No".

Sample Input

3

99

121

Sample Output

No

Yes

Yes

No

1002.Love Story

Description

The QGG has loved QMM for a long time.Actually QMM loves QGG,too.But there is a long distance between QGG and QMM.They want to see each other every day. They understand each other as the idiom”Mind acts upon mind”.Each of them will choose a place inside the house to ensure that is the shortest distance between them。(Their houses are both rectangles)

Now the QGG wants to know the shortest distance.He will ask you to help him to calculate it.

(Definition of distance:the shortest distance of two points,with one point inside or on the edge of one rectangle and the other point inside or on the edge of the other rectangle.The egdes of rectangles are parallel to the axis.Get more information from the example.)

Input

The first line contains an integer N(N<10),indicating the number of test cases. Each test case contains two descriptions of the two rectangles,each with four integers,Xa,Ya,Xb,and Yb(-1000

In each test case,two rectangles won't overlap,contain or touch each other. Output

the shortest distance of the two rectangles with4digits after the decimal point

相关文档
最新文档