3868 - Earthstone: Easy Version

Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld
& %llu

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 deal Ai points of damage to the opponent. A character whose attack value is zero cannot actively attack.
  • Health Hi: The minion has Hi 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 A1H1A2 and H2 (0 <= A1A2 <=10, 1 <= H1H2 <= 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

3
3 3 2 4
3 2 2 5
0 3 2 2

Sample Output

3 1 2 1
Discard 2 2
Invalid

似乎看到了熟悉的游戏……飘过~

#include <iostream>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <algorithm>
typedef long long LL;
using namespace std;
int main()
{
    int T,a1,h1,a2,h2;
    cin>>T;
    while(T--)
    {
        cin>>a1>>h1>>a2>>h2;
        if(a1==0)
        {
            cout<<"Invalid"<<endl;
            continue;
        }
        h1-=a2;
        h2-=a1;
        if(h1<=0) cout<<"Discard"<<" ";
        else cout<<a1<<" "<<h1<<" ";
        if(h2<=0) cout<<"Discard"<<endl;
        else cout<<a2<<" "<<h2<<endl;
    }
    return 0;
}

ZOJ 3868 - Earthstone: Easy Version的更多相关文章

  1. Ping-Pong (Easy Version)(DFS)

    B. Ping-Pong (Easy Version) time limit per test 2 seconds memory limit per test 256 megabytes input ...

  2. Codeforces 1077F1 Pictures with Kittens (easy version)(DP)

    题目链接:Pictures with Kittens (easy version) 题意:给定n长度的数字序列ai,求从中选出x个满足任意k长度区间都至少有一个被选到的最大和. 题解:$dp[i][j ...

  3. UVA12569-Planning mobile robot on Tree (EASY Version)(BFS+状态压缩)

    Problem UVA12569-Planning mobile robot on Tree (EASY Version) Accept:138  Submit:686 Time Limit: 300 ...

  4. Coffee and Coursework (Easy version)

    Coffee and Coursework (Easy version) time limit per test 1 second memory limit per test 256 megabyte ...

  5. 2016级算法第六次上机-B.ModricWang's FFT : EASY VERSION

    1114 ModricWang's FFT EASY VERSION 思路 利用FFT做大整数乘法,实际上是把大整数变成多项式,然后做多项式乘法. 例如,对于\(1234\),改写成\(f(x)=1* ...

  6. Saving James Bond - Easy Version (MOOC)

    06-图2 Saving James Bond - Easy Version (25 分) This time let us consider the situation in the movie & ...

  7. Codeforces Round #540 (Div. 3) F1. Tree Cutting (Easy Version) 【DFS】

    任意门:http://codeforces.com/contest/1118/problem/F1 F1. Tree Cutting (Easy Version) time limit per tes ...

  8. Codeforces Round #540 (Div. 3) D1. Coffee and Coursework (Easy version) 【贪心】

    任意门:http://codeforces.com/contest/1118/problem/D1 D1. Coffee and Coursework (Easy version) time limi ...

  9. Codeforces Round #521 (Div. 3) F1. Pictures with Kittens (easy version)

    F1. Pictures with Kittens (easy version) 题目链接:https://codeforces.com/contest/1077/problem/F1 题意: 给出n ...

随机推荐

  1. VVDocumenter 注释工具的使用

    首先,前往github上下载工程源代码. 然后,编译VVDocumenter工程. 重启xcode. 然后,只要在你自己的工程中要加入注释的方法前面输入“///”,一切搞定. 很好很强大.

  2. MAX(A,B)

    MAX(A,B)  可以把x,或者y的变量扔进去比较,会自动放出比较结果,这样就避免的三目运算.

  3. Hibernate Annotation笔记

    (1)简介:在过去几年里,Hibernate不断发展,几乎成为Java数据库持久性的事实标准.它非常强大.灵活,而且具备了优异的性能.在本文中,我们将了解如何使用Java 5 注释来简化Hiberna ...

  4. 2-sat 输出任意一组可行解&拓扑排序+缩点 poj3683

    Priest John's Busiest Day Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 8170   Accept ...

  5. poj: 1003

    简单题 #include <iostream> #include <stdio.h> #include <string.h> #include <stack& ...

  6. oracle索引使用时注意

    1.使用不等于操作符(<>, !=)下面这种情况,即使在列dept_id有一个索引,查询语句仍然执行一次全表扫描 select * from dept where staff_num &l ...

  7. zw版【转发·台湾nvp系列Delphi例程】HALCON DirectShow

    zw版[转发·台湾nvp系列Delphi例程]HALCON DirectShow unit Unit1;interfaceuses Windows, Messages, SysUtils, Varia ...

  8. linux系统中grub配置文件

    安装了Windows和Linux时肯定要通过GRUB进行引导,GRUB引导器的主配置文件路径/boot/grub/grub.conf(也可能是/boot/grub2/grub.conf),以#号开头的 ...

  9. MFC 进度条控件

    1.进度条 主要用来进行数据读写.文件拷贝和磁盘格式等操作时的工作进度提示情况,如安装程序等,伴随工作进度的进展,进度条的矩形区域从左到右利用当前活动窗口标题条的颜色来不断填充. 2.进度条控制在MF ...

  10. springmvc简述

    Spring Web MVC 是一种基于 Java 的实现了 Web MVC 设计模式的请求驱动类型的轻量级 Web 框架,即使用了 MVC 架构模式的思想,将 web 层进行职责解耦,基于请求驱动指 ...