Dcoder logo

Project Teams @ Dcoder

By Lochard | As a newbie programmer | 12 Mar 2023

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: 


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

How do you rate this article?



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.