#C11947. Strong Password Checker

    ID: 41319 Type: Default 1000ms 256MiB

Strong Password Checker

Strong Password Checker

This problem requires you to determine if a password is strong. A password is considered strong if it meets all of the following criteria:

  • It contains at least 8 characters.
  • It has at least one uppercase letter.
  • It has at least one lowercase letter.
  • It has at least one digit.
  • It has at least one special character from the set: \(\{!@#\$%\^&\*\(\)-\+\}\).

You are given several passwords, and your task is to check each one and print "YES" if the password is strong or "NO" otherwise.

inputFormat

The first line of input contains an integer T, representing the number of passwords. Each of the following T lines contains a single password string.

outputFormat

For each password, output a single line containing "YES" if the password is strong or "NO" otherwise.## sample

5
Password1!
abcd1234
A!c1
StrongPass1$
NoSpecialChar1
YES

NO NO YES NO

</p>