BOJ - 12790 - Mini Fantasy War

Updated:

import sys

def solution():
    T = int(input())

    for i in range(T):
        HP, MP, ATK, DEF, incHP, incMP, incATK, incDEF = map(int, sys.stdin.readline().split(' '))

        if HP + incHP < 1: HP = 1
        else: HP = HP + incHP

        if MP + incMP < 1: MP = 1
        else: MP = MP + incMP

        if ATK + incATK < 0: ATK = 0
        else: ATK = ATK + incATK

        DEF = DEF + incDEF

        print(HP + (MP * 5) + (ATK * 2) + (DEF * 2))
        
solution()

https://www.acmicpc.net/problem/12790

Categories:

Updated:

Leave a comment