#C108. Fraud Detection Evaluation

    ID: 40044 Type: Default 1000ms 256MiB

Fraud Detection Evaluation

Fraud Detection Evaluation

In this problem, you are required to determine whether a financial transaction is potentially fraudulent based on several given criteria. The transaction is analyzed based on its amount, the time at which it occurred, the transaction location, and whether the account has been previously flagged. Additionally, a list of trusted locations is provided. The criteria are as follows:

  1. If the account is flagged, the transaction is immediately classified as "Very Suspicious".
  2. Otherwise, a counter is increased for each of the following conditions: (\bullet) The transaction amount exceeds (10{,}000) ((amount > 10{,}000)). (\bullet) The transaction occurred early in the morning, specifically in the interval ([1, 5)) (i.e. (1 \le \text{time_of_day} < 5)). (\bullet) The transaction location is not included in the set of trusted locations.

The final classification is determined by the number of conditions met:

  • If three or more conditions are met, the transaction is classified as "Very Suspicious".
  • If exactly two conditions are met, it is classified as "Suspicious".
  • If exactly one condition is met, it is classified as "Potentially Fraudulent".
  • If none of the conditions are met, the transaction is classified as "Legitimate".

Your task is to implement this logic. The program should read the transaction details from standard input and output the corresponding transaction classification to standard output.

inputFormat

The input consists of five lines:

  1. The first line contains a floating point number representing the transaction amount.
  2. The second line contains an integer representing the time of day (in hours, using a 24-hour clock).
  3. The third line contains a string representing the transaction location (this may include spaces).
  4. The fourth line contains a string representing the account flagged status: either "True" or "False".
  5. The fifth line contains a comma-separated list of trusted locations.

All inputs are provided via standard input (stdin).

outputFormat

Output a single line to standard output (stdout) containing one of the following strings:

• "Very Suspicious" • "Suspicious" • "Potentially Fraudulent" • "Legitimate"

This output indicates the fraud risk classification for the transaction.## sample

15000.0
2
Los Angeles
False
New York,Los Angeles,Chicago
Suspicious