TEST CASE TROUBLE T__T
import java.util.Scanner; import java.util.StringTokenizer; import java.util.ArrayList; import java.util.Collections; public class Waiting { public static void main(String[] args) { Scanner input = new Scanner(System.in); String N = input.next(); int n = input.nextInt(); String oN = input.nextLine(); String S = oN + " "+ N; StringTokenizer S1 = new StringTokenizer(S); ArrayList<String> A = new ArrayList<String>(S.length()); int j = 0; while(S1.hasMoreTokens()){ A.add(S1.nextToken()); j++; } Collections.sort(A); float m = 0; for(int i = 0; i<A.size(); i++){ if(N.equals(A.get(i))){ m = 20 +(20*i/n);} } System.out.println((int)m); } } My code can't pass the test 1 'cause the output is supposed =20. But I entered the input when running the code on my laptop, its output is 100 as expect.Help me, please