Day 1 : Mathematics

https://practice.geeksforgeeks.org/contest/special-21-day-1-mathematics/problems/

Problems

M and N

Solved on: April 10th 2020

t=int(input())
for i in range(t):
    m, n=map(int, input().split())
    if len(str(m+n)) == len(str(n)):
        print (n)
    else:
        print (m+n)

Triangle and Square

Solved on: April 10th 2020

t=int(input())
for i in range(t):
    n=int(input())
    n=(n-2)//2
    print((n*(n+1))//2)

Satisfy the condition


Last updated

Was this helpful?