Your Ride Is Here


/*
ID: tausiq11
LANG: C
TASK: ride
*/

#include <stdio.h>

int main ()
{
    freopen ("ride.in", "r", stdin);
    freopen ("ride.out", "w", stdout);

    char comet_name[7];
    scanf ("%s", comet_name);

    char group_name[7];
    scanf ("%s", group_name);

    int comet_number = 1;
    int group_number = 1;

    int i;
    for ( i = 0; comet_name [i] != 0; i++ )
        comet_number *= (comet_name [i] - 64);

    for ( i = 0; group_name [i] != 0; i++ )
        group_number *= (group_name [i] - 64);

    if ( comet_number % 47 == group_number % 47 )
        printf ("GO\n");

    else
        printf ("STAY\n");

    return 0;
}

One thought on “Your Ride Is Here

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s