I want to make a parking fee program by using visual stidio :         int min1, min2, won;

	printf("parking minutes(분)? ");
	scanf("%d", &min1);

	min2 = (min1 - 30) % 10;

	if (min1 <= 39) 
		won = 2000;


	else
	{
		if (min2 = 0)
			won = 2000 + 1000 * (min1 - 30) % 10;
		else
			won = 2000 + 1000 * (min1 - min2 - 20) % 10;
	}
	printf("parking fee: %d", won);
	


The conditions of this program
1.until 30min, 2000won
2. after 30min, 1000won per 10min
3.max 25000won per a day
4.parking minutes cant be over than 24 hours


I thought that '%' means remainder so i write like that but when i input 52, the results say 5200! I want to make result to be 5000. And i want to know what to do for condition 3&4. What can i do? Should i use 'for' and 'sum'?