#include <stdio.h>
#include <conio.h>

int main()
{
    int N,X,i,pc;
    float Y,SN,CR;
    printf("Nhap so nguoi trong thanh pho: ");
    scanf("%d",&N);
    for(i=1;i<100;i++)
    {
        if(N<0)
        {
            printf("Nhap lai so nguoi trong thanh pho: ");
            scanf("%d",&N);
        }
        else 
            break;
    }
    printf("Nhap vao so wizard: ");
    scanf("%d",&X);
    for(i=1;i<100;i++)
    {
    if((X>N)||(X<0))
    {
        printf("Nhap lai Wizard: ");
        scanf("%d",&X);
    }
    else break;
    }
    printf("Nhap so phan tram nguoi tham gia (nho hon 100): ");
    scanf("%d",&pc);
    for(i=1;i<N;i++)
    {
    if((pc>N)||(pc<0))
    {
        printf("Nhap lai so phan tram nguoi tham gia: ");
        scanf("%d",&pc);
    }
    else break;
    }
    Y=((float)pc/100);
    SN=Y*(float)N;
    CR=SN-X;
    if(X>=SN) printf("So con roi la 0\n");
    else printf("So con roi can %0.0f \n:",CR);
}