Wednesday, 26 August 2020

Drawing Book Hacker Rank Solution in C

#include<stdio.h>
int main()
{
    int n,p;
    scanf("%d%d",&n,&p);
    if( p/2 <n/2-p/2)
        printf("%d",p/2);
    else
        printf("%d",n/2-p/2);
}

No comments:

Post a Comment