Sunday, April 24, 2016

UVA 11364: Parking -Solution

Unknown
#include <stdio.h>
int main()
{
    int t, n, p,i, max,min,d;
    scanf("%d",&t);
    while (t--)
    {
        scanf("%d",&n);
        max=0;
        min=50000;
        for (i=0;i<n;i++)
        {
            scanf("%d",&p);
            if (max<p) max=p;
            if (min>p) min=p;
        }
        d=(max-min)*2;
        printf("%d\n",d);
    }
    return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

1 comments:

  1. আসসালামু আলাইকুম, ভাই, এ প্রশ্নটা বুঝাই দেয়া যাবে, প্লিজ?

    ReplyDelete

Coprights @ 2016,