IMAT 2022 Q8 Logical Reasoning

Hey guys, I would like to know how to solve this question in the correct way. Can someone please explain to me?

There are 10 students in a class and they like visiting each other. A visit means that one student visits the home of another student. We know that each student in the class has visited the same number of students. No two students in the class have both visited each other.

What is the maximum number of students that a student in this class could have visited?

A) 2
B) 4
C) 5
D) 8
E) 9

The max no. of visits that all students could have is 10x9/2 = 45 visits.
Each students in the class has visit the same x other friends. Hence the total visits that have been done is 10x.
10x < 45 → x max = 4

First stu can visit 9 houses except himself.
Second stu can visit 8 houses because he cannot visit himself and first stu(they cannot visit each other).
So it goes 9+8+7+6+5+4+3+2+1
This is the maximum number
So 4.5 per each person.
Answer should be C