import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
{
String test2
= "20 hrs 50 mins"; String test3
= "1 d 20 hrs 50 min"; String test4
= "3 meses 15 dias 20 horas 50 minutos";
System.
out.
println(format
(test1
)); System.
out.
println(format
(test2
)); System.
out.
println(format
(test3
)); System.
out.
println(format
(test4
)); }
Scanner scanner = new Scanner(string);
StringBuilder sb = new StringBuilder();
while(scanner.hasNext()){
sb.append(scanner.next())
.append(scanner.next())
.append(" ");
}
return sb.toString();
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU3RyaW5nIHRlc3QxID0gIjUwIG1pbiI7CiAgICAgICAgU3RyaW5nIHRlc3QyID0gIjIwIGhycyA1MCBtaW5zIjsKICAgICAgICBTdHJpbmcgdGVzdDMgPSAiMSBkIDIwIGhycyA1MCBtaW4iOwogICAgICAgIFN0cmluZyB0ZXN0NCA9ICIzIG1lc2VzIDE1IGRpYXMgMjAgaG9yYXMgNTAgbWludXRvcyI7CiAgICAgICAgCiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKGZvcm1hdCh0ZXN0MSkpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihmb3JtYXQodGVzdDIpKTsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oZm9ybWF0KHRlc3QzKSk7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKGZvcm1hdCh0ZXN0NCkpOwoJfQoJCglwcml2YXRlIHN0YXRpYyBTdHJpbmcgZm9ybWF0KFN0cmluZyBzdHJpbmcpewogICAgICAgIFNjYW5uZXIgc2Nhbm5lciA9IG5ldyBTY2FubmVyKHN0cmluZyk7CiAgICAgICAgU3RyaW5nQnVpbG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