Back To School '18: Harambe

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type

As we all know, plagiarism is a huge issue, especially in Junyi's school. Being the exceptional student Junyi is, he is helping his Engrish teacher check for plagiarism.

Students nowadays are extremely lazy, meaning that they will only change individual letters in words to other letters. They will not change spaces to letters, or vice versa.

Plagiarism only occurs when the number of letters changed is less than or equal to K.

Junyi is busy this weekend, so he asks you to help him determine whether some sentences were plagiarized or not.

Input Specification

The first line will contain the original sentence, S\ (1 \le |S| \le 1\ 000).

The second line will contain the student's potentially plagiarized sentence, T\ (|T| = |S|).

The third line will contain the integer K\ (1 \le K \le |S|).

Both sentences will only consist of lowercase latin characters and spaces. There will only be one space between any 2 words, and there will be no leading/trailing spaces.

Output Specification

Print Plagiarized if the number of characters changed is less than or equal to K.

Print No plagiarism if the number of characters changed is greater than K, or a letter is in the place of a space, and vice versa.

Sample Input 1

this is definitely not plagiarized
thas as dafanataly nat plagaarazad

Sample Output 1


Sample Input 2

english is the best subject
engrish is the good subject

Sample Output 2

No plagiarism

Sample Input 3

this is the sentence
this is a sentencess

Sample Output 3

No plagiarism

Explanation for Sample Input 3

There is a space in the place of a letter, so No plagiarism is printed despite the value of K = 20.


  • 6
    geese  commented on Sept. 13, 2018, 12:00 p.m.

    Very misleading title. Tremendous disappointment. Sad!