관리 메뉴

솜씨좋은장씨

[BaekJoon] 26561번 : Population (Python) 본문

Programming/코딩 1일 1문제

[BaekJoon] 26561번 : Population (Python)

솜씨좋은장씨 2023. 1. 24. 13:24
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 Population 입니다.

 

26561번: Population

The first line of input will contain a single integer n that indicates the number of lines to follow. Each line will consist of two integers, p and t, where p is the beginning population, and t is the amount of time that will pass. Both p and t will be bet

www.acmicpc.net

👨🏻‍💻 코드 ( Solution )

def population(begin_num, time):
    plus_num = time // 4
    minus_num = time // 7
    
    return begin_num + plus_num - minus_num


if __name__ == "__main__":
    for _ in range(int(input())):
        begin_num, time = map(int, input().split())
        
        print(population(begin_num=begin_num, time=time))
 

GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07

1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.

github.com

Comments