Hi,Welcome to Health care magic forum.
For a 21 years, 52 kg is low, and for 5'11" it is not fine to sea. Any how you should gain food.
You wrote that you sleep, 1am, to 10am, it is absurd, then how do you attend classes.Any how try to have good sleep.
Take food rich in fats, and
proteins. Take more of green leafy vegetables, pulses, and sprouts.
Practice
yoga, and exercises.
If your parents, maternal, and paternal grand parents and uncles, and aunts majority of them are very thin you may not gain weight by any means.
Wishing for a quick and complete recovery of weight. Thank you.