Earthstone: Easy Version

来源:互联网 发布:中国大国沙文主义 知乎 编辑:程序博客网 时间:2024/04/30 00:28
H - Earthstone: Easy Version
Crawling in process...Crawling failedTime Limit:2000MS    Memory Limit:65536KB     64bit IO Format:%lld & %llu
SubmitStatus Practice ZOJ 3867

Description

Earthstone is a famous online card game created by Lizard Entertainment. It is a collectible card game that revolves around turn-based matches between two opponents. Players start the game with a substantial collection of basic cards, but can gain rarer and more powerful cards through purchasing packs of additional cards, or as rewards for competing in the arena. Card packs can be purchased with gold, an in-game currency rewarded for completing random daily quests and winning matches, or by using real money in the in-game store.

Each Earthstone battle is a one on one turn-based match between two opponents. During a player's turn, he can choose to play any of his cards and command the minions to attack targets. Those played cards will be placed on the table as they are 'summoned' as minions. Each card has two basic attributes:

  • Attack Ai: If a minion attacks a character or was attacked, it will dealAi points of damage to the opponent. A character whose attack value is zero cannot actively attack.
  • Health Hi: The minion hasHi points of initial health. After being damaged, the minion's health will decrease by the corresponding damage value. The minion will be killed and discarded if its health is less than or equal to zero. If a minion attacks another minion, both of them will receive damage simultaneously.

Given two minions, please calculate the result if the first minion attacked the second one.

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

There are four integers A1,H1, A2 andH2 (0 <= A1,A2 <=10, 1 <= H1,H2 <= 10), which are the attributes of two minions.

Output

For each test case, output "Invalid" (without quotes) if the first minion cannot attack, otherwise output the minions attributes as the format in input. If the minion is killed, output "Discard" instead (without quotes).

Sample Input

33 3 2 43 2 2 50 3 2 2

Sample Output

3 1 2 1Discard 2 2Invalid
#include<stdio.h>int main(){    int t,a,b,c,d;    scanf("%d",&t);    while(t--)    {    scanf("%d %d %d %d",&a,&b,&c,&d);        if(a<=0)        printf("Invalid\n");        else        {  int p,w;             p=b-c;            w=d-a;            if(p<=0)            printf("Discard ");            else            printf("%d %d ",a,p);            if(w<=0)            printf("Discard\n");            else            printf("%d %d\n",c,w);        }    }    return 0;}

0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 苹果电脑螺丝拧花了怎么办 苹果螺丝滑牙了怎么办 苹果7螺丝滑丝了怎么办 外六角螺丝滑牙怎么办 六角螺帽滑丝了怎么办 内六角螺丝滑头了怎么办 内六角螺丝滑失了怎么办 内六角螺钉滑了怎么办 三视图看不出来怎么办 小猫断奶以后母猫涨奶怎么办 手机螺丝滑丝了怎么办 螺丝孔道滑丝了怎么办 螺丝生锈了拧不下来怎么办 钣金加工六角网孔变形怎么办 外六角螺帽滑丝怎么办 内六角螺丝螺帽滑丝怎么办 一字螺丝钉脱扣拧不下来怎么办 一字螺丝拧花了怎么办 小螺丝卸不下来怎么办 机油螺丝滑丝了怎么办 刚滑双板膝盖滑的疼怎么办 lv包真皮弄脏了怎么办 lv包压变形了怎么办 lv的包包被压了怎么办 固态硬盘太小了怎么办 联想笔记本网络连接不可用怎么办 联想g50玩dnf卡怎么办 手机有wifi电脑没有网怎么办 电脑网卡被禁用了怎么办 win8系统装win7蓝屏怎么办 联想笔记本装win7蓝屏怎么办 联想g40-70开机黑屏怎么办 新主机开不了机怎么办 联想720s笔记本闪屏怎么办 华硕k40ie显卡坏了怎么办 开机黑屏进入bois后怎么办 2根内存条不兼容怎么办 联想笔记本r720系统崩溃怎么办 联想天逸310卡怎么办 新买的鼠标没反应怎么办 联想笔记本触屏鼠标失灵怎么办