#include <stdio.h>

int irishLicensePlateValidator(int year, int halfYear, char county, int sequence) {
    // Validate year
    if (year < 13 || year > 24) {
        return 0; // Invalid year
    }

    // Validate halfYear
    if (halfYear != 1 && halfYear != 2) {
        return 0; // Invalid halfYear
    }

    // Validate county by checking if it is one of the valid counties
    switch (county) {
        case 'C': case 'c':
        case 'D': case 'd':
        case 'G': case 'g':
        case 'L': case 'l':
        case 'T': case 't':
        case 'W': case 'w':
            break; // Valid county
        default:
            return 0; // Invalid county
    }

    // Validate sequence number (should be between 1 and 999999)
    if (sequence < 1 || sequence > 999999) {
        return 0; // Invalid sequence number
    }

    // All checks passed
    return 1;
}

int main() {
    int year, halfYear, sequence;
    char county;

    // Prompt the user for input
    printf("Enter the year (last two digits), half-year (1 or 2), county (single character), and sequence number: \n");
    scanf("%d %d %c %d", &year, &halfYear, &county, &sequence);

    // Output the result of the validation
    int result = irishLicensePlateValidator(year, halfYear, county, sequence);
    printf("License plate validation result: %d\n", result);

    return 0;
}
