Evan has just just finished writing an English essay about the importance of computer security and realizes that he used some words too much!
Can you help Evan write a program that finds the number of occurrences of a substring in a string and replace the occurrence with a different string?
Evan would really appreciate it!
The first line will contain the string to search within.
The second line will contain the substring to search for.
The third line will contain the substring to replace it with.
The final line will contain a single integer, , the occurrence number to replace.
All strings will only contain alphanumeric characters and spaces, and will be at most characters in length.
No string will begin or end with a space or have a length of . There will be at most space between any two alphanumeric characters.
The first line of output should contain the number of occurrences of the substring.
The second line of output should contain the string after replacing the occurrence with the given replacement. It is guaranteed the occurrence exists.
Subtask 1 [25%]
All strings will be at most characters in length.
Subtask 2 [75%]
No further constraints.
Computer security is very important because it is the basis of our trust of companies of in 2
2 Computer security is very important because it is the basis of our trust in companies