We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d074e68 commit e55802bCopy full SHA for e55802b
A - Diagonals
@@ -0,0 +1,42 @@
1
+
2
+/*
3
+ yildiz
4
+*/
5
+#include <string>
6
+#include <iostream>
7
+#include <cmath>
8
+#include <algorithm>
9
+#include <vector>
10
+#include <unordered_map>
11
+#include <queue>
12
+#include <map>
13
+using namespace std;
14
+#define habboosh main
15
+#define ll long long
16
+#define i int
17
+int habboosh()
18
+{
19
+ i t;
20
+ cin >> t;
21
+ i s = 0;
22
+ while (t--) {
23
+ i n, k;
24
+ cin >> n >> k;
25
+ i s= 0;
26
+ if (k > 0) {
27
+ k =k-n;
28
+ s =s+1;
29
+ }n =n- 1;
30
+ while (k > 0) {
31
32
+ s =s+ 1;
33
+ if ( k > 0) {
34
+ s = s + 1;
35
+ k =k- n;
36
+ }n =n-1;
37
38
+ }
39
+ cout << s << "\n";
40
41
+ return 0;
42
0 commit comments