Your task is to construct a directed acyclic graph with nodes and exactly different paths from the node to the node . The graph can have at most edges and every edge must be different.
For example, when , one possible solution consists of the edges In this case, the paths are:
You may assume that is an integer in the range . You can construct any graph that satisfies the conditions.
In a file paths.py
, implement a function create
that returns the graph as a list of edges.
def create(x): #TODO if __name__ == "__main__": print(create(2)) # esim. [(1,2), (1,100), (2,100)] print(create(5)) print(create(10)) print(create(123456789))