diff --git a/CodeChef/recipe.py b/CodeChef/recipe.py new file mode 100644 index 0000000..5b4bda5 --- /dev/null +++ b/CodeChef/recipe.py @@ -0,0 +1,22 @@ +def findGcd(m, n): + while(m != n): + if m > n: + m = m - n; + else: + n = n - m; + return m; + +t = int(input()); + +for i in range(0, t): + ing = list(map(int, input().split(' '))) + + n = ing[0]; + + gcd = ing[1]; + + for j in range(2, n+1): + gcd = findGcd(gcd, ing[j]); + + for j in range(1, n+1): + print(str(int(ing[j]/gcd)), end=' '); \ No newline at end of file diff --git a/HackerRank/sql project planning.txt b/HackerRank/sql project planning.txt new file mode 100644 index 0000000..d750bd6 --- /dev/null +++ b/HackerRank/sql project planning.txt @@ -0,0 +1,13 @@ +#https://www.hackerrank.com/challenges/sql-projects/problem + +SELECT Start_Date, MIN(End_Date) FROM + +(SELECT Start_Date FROM Projects WHERE Start_Date NOT IN (SELECT End_Date FROM Projects)) AS s, + +(SELECT End_Date FROM Projects WHERE End_Date NOT IN (SELECT Start_Date FROM Projects)) AS e + +WHERE Start_Date < End_Date + +GROUP BY Start_Date + +ORDER BY DATEDIFF(MIN(End_Date), Start_Date), Start_Date; \ No newline at end of file