Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int A, B, N;
- A = scanner.nextInt();
- B = scanner.nextInt();
- N = scanner.nextInt();
- int min = 0;
- if (B % N != 0)
- min++;
- min += B / N;
- if (A > min)
- System.out.println("Yes");
- else
- System.out.println("No");
- }
- }
- /////
- import java.util.Scanner;
- import java.util.ArrayList;
- public class Main {
- public static String strStr(String haystack, String needle) {
- if (haystack == null || needle == null) return null;
- int hLength = haystack.length();
- int nLength = needle.length();
- if (hLength < nLength) return null;
- if (nLength == 0) return haystack;
- for (int i = 0; i <= hLength - nLength; i++) {
- if (haystack.charAt(i) == needle.charAt(0)) {
- int j = 0;
- for (; j < nLength; j++) {
- if (haystack.charAt(i + j) != needle.charAt(j)) {
- break;
- }
- }
- if (j == nLength) return haystack.substring(i);
- }
- }
- return null;
- }
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- ArrayList<String> list = new ArrayList<>();
- list.add("abc");
- list.add("acb");
- list.add("bac");
- list.add("bca");
- list.add("cab");
- list.add("cba");
- for (int i = 0; i < 3; i++) {
- char ch = scanner.next().charAt(0);
- if (ch == '>') {
- String needle;
- if (i == 0)
- needle = "ab";
- else {
- if (i == 1)
- needle = "ac";
- else
- needle = "bc";
- }
- list.removeIf(s -> strStr(s, needle) != null);
- } else {
- if (ch == '<') {
- String needle;
- if (i == 0)
- needle = "ba";
- else {
- if (i == 1)
- needle = "ca";
- else
- needle = "cb";
- }
- list.removeIf(s -> strStr(s, needle) != null);
- }
- }
- }
- for (String s : list)
- System.out.println(s);
- }
- }
- //////
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- long N = scanner.nextLong();
- while (N % 10 == 0)
- N /= 10;
- int res = 0;
- while (N != 0) {
- if (N % 10 == 0)
- res++;
- N /= 10;
- }
- System.out.println(res);
- }
- }
- ///
- import java.util.ArrayList;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- ArrayList<Character> list = new ArrayList<>();
- ArrayList<String> strings = new ArrayList<>();
- for (char i = 'a'; i <= 'z'; i++)
- list.add(i);
- int N = scanner.nextInt();
- int tmp = 0;
- if (N % 2 != 0)
- tmp++;
- for (int i = 0; i < N / 2 + tmp; i++) {
- String str = "";
- int k = i;
- while (k > 0) {
- str += list.get(k % 26);
- k--;
- }
- int j = 0;
- while (j < N / 2 - i) {
- str += list.get(j % 26);
- j++;
- }
- if (N % 2 != 0)
- str += list.get(j % 26);
- j--;
- while (j >= 0) {
- str += list.get(j % 26);
- j--;
- }
- k = 1;
- while (k <= i) {
- str += list.get(k % 26);
- k++;
- }
- strings.add(str);
- }
- if (N % 2 == 0) {
- for (String string : strings) System.out.println(string);
- for (int i = strings.size() - 1; i >= 0; i--)
- System.out.println(strings.get(i));
- } else {
- for (String string : strings) System.out.println(string);
- for (int i = strings.size() - 2; i >= 0; i--)
- System.out.println(strings.get(i));
- }
- }
- }
Add Comment
Please, Sign In to add comment