@@ -0,0 +1,1458 @@
+import java.io.*;%0Aimport java.math.*;%0Aimport java.security.*;%0Aimport java.text.*;%0Aimport java.util.*;%0Aimport java.util.concurrent.*;%0Aimport java.util.regex.*;%0A%0A%0Apublic class Solution %7B%0A%0A    // Complete the repeatedString function below.%0A    static long repeatedString(String s, long n) %7B%0A        char%5B%5D str = s.toCharArray();%0A        int i,j=0;%0A        long k=n;%0A        if(n%3C=str.length)%7B%0A            for(i=0;i%3Cstr.length;i++)%7B%0A                if(str%5Bi%5D=='a') j++;%0A                if(i==n-1) break;%0A            %7D%0A            return j;%0A        %7D%0A        else%7B%0A            for(i=0;i%3Cstr.length;i++)%7B%0A                if(str%5Bi%5D=='a') j++;%0A             %7D%0A            long q=n/str.length;%0A            long total=q*j;%0A            long l=n%25str.length;%0A            for(i=0;i%3Cl;i++)%7B%0A                if(str%5Bi%5D=='a') total++;%0A             %7D%0A            return total;%0A        %7D%0A        %0A    %7D%0A%0A    private static final Scanner scanner = new Scanner(System.in);%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv(%22OUTPUT_PATH%22)));%0A%0A        String s = scanner.nextLine();%0A%0A        long n = scanner.nextLong();%0A        scanner.skip(%22(%5Cr%5Cn%7C%5B%5Cn%5Cr%5Cu2028%5Cu2029%5Cu0085%5D)?%22);%0A%0A        long result = repeatedString(s, n);%0A%0A        bufferedWriter.write(String.valueOf(result));%0A        bufferedWriter.newLine();%0A%0A        bufferedWriter.close();%0A%0A        scanner.close();%0A    %7D%0A%7D%0A

Add RepeatedString.java