Dcoder icon

The irritating Students @ Dcoder

By Lochard | As a newbie programmer | 5 Jul 2023


Problem: Cody is Professor at Zing University. He teaches English there. During his first class, he found the students are very talkative. So,he decided to divide the class into two sections, A & B such that the difference between the strength of two sections is minimum. Print the strength of two sections in non decreasing order.

Input: First line of the input contains number of test cases T,followed by T integers (n) (total sum of their strengths)

Output: For each test cases print strength of both section in non decreasing order.

Constraints: 1≤T≤100 

 1≤n≤10000

Sample Input: 2

10

15

Sample Output: 

5 5

7 8

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

How do you rate this article?

3


Lochard
Lochard

Asylum seeker in Lithuania. My short-lifed daily on GitHub https://github.com/locharp/asylum_daily/tree/main/en


As a newbie programmer
As a newbie programmer

Sharing entry level codes. My snippets on GitHub https://github.com/locharp/code-snippets

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.