As a newbie programmer

Project Teams @ Dcoder

Dcoder logo

Problem: There are N students in a class and Teacher want to divide these students into some groups . Teacher told  that groups consisting of two or less students not allowed , so Teacher want to have as many groups consisting of three or more students as possible.

 

Divide the students so that the number of groups consisting of three or more students is maximized.

Input: Single integer N

 

Output: Maximum number of groups can be formed

Constraints: 1<=N<100000

Sample Input: 6

Sample Output: 

2

print(int(input()) // 3)

How do you rate this article?

2


Lochard
Lochard

20240228 Arrived in the UK for about 2 week. All my fears persist. Some are even getting worse. https://github.com/locharp/asylum_diary/


As a newbie programmer
As a newbie programmer

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

Publish0x Publish0x

Reward the author with $0.01 in crypto, and earn yourself as you read!

20% to author / 80% to me.
Rewards are FREE. Publish0x pays them, not you.

Page not displaying correctly?